mobeets / bpcs Goto Github PK
View Code? Open in Web Editor NEWdigital image steganography using BPCS (Bit-Plane Complexity Segmentation Steganography)
License: MIT License
digital image steganography using BPCS (Bit-Plane Complexity Segmentation Steganography)
License: MIT License
Encode and decode works fine. However when I tried to get the capacity from images, including the given example, it throws
TypeError: '>=' not supported between instances of 'float' and 'NoneType'
$ python -m bpcs.bpcs capacity -i examples/vessel.png -a 0.45
Output:
Slicing...
Graying...
Loaded image as array with shape (300, 300, 3, 8)
Creating histograms of image complexity...
Found 34656 grids
D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py:15: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
vals = [arr_bpcs_complexity(arr[dims]) for dims in get_next_grid_dims(arr, grid_size)]
Grid 10000 of 34656
Grid 20000 of 34656
Grid 30000 of 34656
Traceback (most recent call last):
File "C:\Users\CHE-Main\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\CHE-Main\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Documents\GitHub\bpcs\bpcs\bpcs.py", line 62, in <module>
capacity(opts.infile, opts.outfile, opts.alpha)
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 96, in capacity
histogram(infile, outfile, alpha, greater)
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 76, in histogram
hist = x.modify(alpha, comp_fcn)
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 53, in modify
hist, navail, ntotal = histogram_of_complexity(self.arr, grid_size, alpha, comp_fcn)
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 21, in histogram_of_complexity
navail = sum([n for n, bin in zip(ns, bins) if comp_fcn(bin, alpha)])
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 21, in <listcomp>
navail = sum([n for n, bin in zip(ns, bins) if comp_fcn(bin, alpha)])
File "D:\Documents\GitHub\bpcs\bpcs\bpcs_steg_capacity.py", line 95, in <lambda>
greater = lambda x,thresh: x>=thresh
TypeError: '>=' not supported between instances of 'float' and 'NoneType'
Windows 10 2004 and Windows 10 1909
Python 3.8.3
This library also seem to need matplotlib
but it is not stated in the requirements.txt
Hello sir,
Currently I am experimenting by combining AES file encryption (cryptography) and BPCS (steganography) for better data security on Jupyter Notebook. All went smooth, until i want to decode the encfile (image with encrypted file in it). It says :
UnicodeEncodeError: 'charmap' codec can't encode character '\x92' in position 309: character maps to
Can you help me fix this issue? i guess there is a problem in Notebook but i cannot figure it out
Hello once again.
I was experimenting around with this library, I found that the decoding part has quite a bit of issues.
Take the following 3 test payloads.
test1.txt
test
test2.txt
test test
test3.txt
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
test test
All these ran using the example image with 0.45 alpha.
test1.txt
and test3.txt
successfully encoded and decoded. However the decoded test1.txt
and test3.txt
has 3 and 5 null bytes respectively at the end of file.
test2.txt
passed encoding but suddenly fails at decoding as it throws AssertionError
. I tested around the length of message and found it always would fail if it takes up around more than 2 grids but less than 64.
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/runner/BPCS-Test/bpcs_mobeets/bpcs/bpcs.py", line 55, in <module>
decode(opts.infile, opts.outfile, opts.alpha)
File "/home/runner/BPCS-Test/bpcs_mobeets/bpcs/bpcs_steg_decode.py", line 34, in decode
write_conjugated_message_grids(outfile, grids, alpha)
File "/home/runner/BPCS-Test/bpcs_mobeets/bpcs/array_message.py", line 190, in write_conjugated_message_grids
messages, conj_map_grids, nbits_per_map = separate_conj_map_from_message(grids, alpha)
File "/home/runner/BPCS-Test/bpcs_mobeets/bpcs/array_message.py", line 174, in separate_conj_map_from_message
x = get_n_message_grids(nbits_per_map, ngrids)
File "/home/runner/BPCS-Test/bpcs_mobeets/bpcs/array_message.py", line 154, in get_n_message_grids
assert x > 0
AssertionError
I have setup a REPL.it workspace to show my test results:
https://repl.it/@Cerlancism/BPCS-Test#main.sh
I have reduced the size of image to 150x150 to speed up in REPL.it. Similar results shows for the provided example image.
One of my friend catkane-doodles has forked this repo and he seemed to have fixed this. However, he did a complete revamp. Not sure if we could PR in.
Good day Sir, sorry to bother you again. I am currently experimenting with both your repo and a repo i found on the previous (currently active) issue by Pekai-tan.
This repo is fine and working well if the message grids are either 1 grid or more than 64 grids, and repo by Pekai-tan only working if the message grids are between 2 and 64 grids and if more than that, the decoded message will be null.
I wonder if there is a way to make it work well without the message grids problem.
Again, sorry to bother you again Sir
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.