Giter Club home page Giter Club logo

lsb-steganography's Introduction

Hi there! 👋

I'm Robin - I am Software Security Researcher @ Quarkslab. You can find below some projects I am developing or contributing to.

⚡ Projects

Fuzzing / Symbolic Execution:

  • PASTIS: Collaborative fuzzing infrastructure. It leverages AFL++, Honggfuzz and TritonDSE (thus greybox and whitebox fuzzing) for program coverage and bug discovery.
  • TritonDSE: Symbolic Execution engine based on Triton built for automatic program coverage exploration. It has been design to encompass multiple program analysis use-cases.

Deobfuscation / Program Synthesis:

Diffing / Firmware Analysis: Portal

Other:

  • pydimacs, simple module to manipule CNF (Conjonctive Normal Form), graphs using Z3 Python API

📞 Contact

⬅️ just here

✍️ Technical Blog Posts

📈 Stats

Github stats Top Langs

More details 🔬 https://www.githubwrapped.io/RobinDavid

lsb-steganography's People

Contributors

jamesevickery avatar khavishbhundoo avatar robindavid avatar samhilmw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lsb-steganography's Issues

gif file is not supported

I tried to embed a string into an image however this error occurs.
looks like image function problem

Traceback (most recent call last):
  File "testlsb.py", line 74, in <module>
    main()
  File "testlsb.py", line 25, in main
    steg = LSBSteg.LSBSteg(cv2.imread(inputImg))
  File "/app/stargazer/LSBSteganography/LSBSteg.py", line 29, in __init__
    self.height, self.width, self.nbchannels = im.shape
AttributeError: 'NoneType' object has no attribute 'shape'

Can't round-trip

I downloaded the "disaster girl" meme, created a "test.txt" file with all-text contents, and invoked:
LSBSteg.py -image disaster-girl.jpg -binary test.txt -out disaster-steg.jpg
I then attempted to retrieve the steganographically hidden txt:
LSBSteg.py -steg-image disaster-steg.jpg -out test-round.txt
I received an OverflowError:

Traceback (most recent call last):
File "./LSBSteg.py", line 242, in
main(av)
File "./LSBSteg.py", line 236, in main
binary_steg_reveal(args.steg_image, args.out)
File "./LSBSteg.py", line 212, in binary_steg_reveal
bin = steg.unhideBin()
File "./LSBSteg.py", line 194, in unhideBin
for i in range(l):
OverflowError: range() result has too many items

Attribute error:

I am trying to hide image using function "hideImage()", and it is raising an attribute error.

File "./main.py", line 64, in
1:hideText(),
File "./main.py", line 16, in hideText
steg = LSBSteg(carrier)
File "/home/sada_varti/Desktop/Project/stegano.py", line 16, in init
self.nbchannels = im.channels
AttributeError: 'cv.iplimage' object has no attribute 'channels'

My opencv version is : 2.0.0

MemoryError

LSBSteg.py decode -i file.png -o output.txt

Traceback (most recent call last):
File "/usr/local/bin/LSBSteg.py", line 189, in
main()
File "/usr/local/bin/LSBSteg.py", line 183, in main
raw = steg.decode_binary()
File "/usr/local/bin/LSBSteg.py", line 165, in decode_binary
for i in range(l):
MemoryError

Distribution Request

We would like to add LSB-Steganography to the ArchAssault project repos. Can you please provide a license file as well as give permission to distribute? Thank you.

Overflow in range() when unhiding

Trying to unhide a png with a hidden text, recieving that error:

python LSBSteg.py -steg-image steganography_lsb.png -out steg.bin Traceback (most recent call last): File "LSBSteg.py", line 242, in <module> main(av) File "LSBSteg.py", line 236, in main binary_steg_reveal(args.steg_image, args.out) File "LSBSteg.py", line 212, in binary_steg_reveal bin = steg.unhideBin() File "LSBSteg.py", line 194, in unhideBin for i in range(l): OverflowError: range() result has too many items

shape problem

when I do
steg = LSBSteg("4092333.png")
AttributeError: 'str' object has no attribute 'shape'

Binary data destruction after decode

The binary data after decode is different from original data.

$ hexdump message.txt.gpg 
0000000 8c 0d 04 07 03 02 a5 25 df b2 ac 9f 26 ca d9 d2
0000010 51 01 f4 53 68 4e 50 24 3c 58 30 90 b0 81 d9 b7
0000020 54 40 9f 24 2a 8e 2a d4 2f 40 f7 42 68 8f b3 17
0000030 ff d1 8f aa b4 1b 73 34 64 b2 eb a5 f7 c8 7c 8b
0000040 e4 22 7a 0b 09 ca d9 71 21 b3 f6 2d f7 7c 6a b2
0000050 52 aa 30 ed 84 0c 28 b8 1b eb 2c c5 c7 11 5c 5b
0000060 d6 20                                          
0000062

$ ./LSBSteg.py encode -i before_hidden.png -o after_hidden.png -f message.txt.gpg

$ ./LSBSteg.py decode -i after_hidden.png -o result.txt.gpg

$ hexdump result.txt.gpg 
0000000 c2 8c 0d 04 07 03 02 c2 a5 25 c3 9f c2 b2 c2 ac
0000010 c2 9f 26 c3 8a c3 99 c3 92 51 01 c3 b4 53 68 4e
0000020 50 24 3c 58 30 c2 90 c2 b0 c2 81 c3 99 c2 b7 54
0000030 40 c2 9f 24 2a c2 8e 2a c3 94 2f 40 c3 b7 42 68
0000040 c2 8f c2 b3 17 c3 bf c3 91 c2 8f c2 aa c2 b4 1b
0000050 73 34 64 c2 b2 c3 ab c2 a5 c3 b7 c3 88 7c c2 8b
0000060 c3 a4 22 7a 0b 09 c3 8a c3 99 71 21 c2 b3 c3 b6
0000070 2d c3 b7 7c 6a c2 b2 52 c2 aa 30 c3 ad c2 84 0c
0000080 28 c2 b8 1b c3 ab 2c c3 85 c3 87 11 5c 5b c3 96
0000090 20                                             
0000091

My environment: Python 3.6.4

Save result to jpeg file fail to get unhide text

This is my code:
`from LSBSteg import LSBSteg
import cv

Hide

str = "Hello World"
carrier = cv.LoadImage("1472282893350.jpg")
steg = LSBSteg(carrier)
steg.hideText(str)
steg.saveImage("result.jpg") # change to result.png will be ok

Unhide

im = cv.LoadImage("result.jpg") # change to result.png will be ok
steg = LSBSteg(im)
print "Text value:",steg.unhideText()
`
I get result like that:
image

But if change result.jpg to result.png will be fine.

Overflow error

Hello,
I don't get your script working. I had to install the modules python-opencv and python-docopt via apt (working on debian), to fix the import errors. But now I get an Overflow Error:

  File "LSBSteg.py", line 189, in <module>
    main()
  File "LSBSteg.py", line 183, in main
    raw = steg.decode_binary()
  File "LSBSteg.py", line 165, in decode_binary
    for i in range(l):
OverflowError: range() result has too many items

I am running the command: python LSBSteg.py decode --in=export.png --out=outfile
How can I fix it?
Thanks in advance.

AttributeError: 'numpy.ndarray' object has no attribute 'width'

Execute line

new_im = steg.encode_image(cv2.imread("backgournd_image.jpg"))

Error message:
AttributeError: 'numpy.ndarray' object has no attribute 'width'

the return of cv2.imread(~) doesn't has no attribute width. Becuase, the return is numpy.ndarray.

curwidth & height

Hi,

I think the curwidth and curheight and reversed on line 34 and line 40...?

switched them and seems to be working fine for me now. Thanks!

UnicodeDecodeError

Whenever trying to decode an image, I get UnicodeDecodeError: 'ascii' codec can't decode byte 0x8a in position 0: ordinal not in range(128) from line 166 (output += chr(int(self.read_byte(),2)).encode("utf-8")). The problematic byte changes depending on the image. This happens whenever the format of the carrier is a bmp or png and the file is an image. Text can be successful encoded and decoded, but images produce this error during extraction. By importing and reseting sys with default encoding as UTF8, the error persists as a UnicodeDecodeError but with UTF-8 codec unable to decode the byte because of an invalid start byte instead.

How to hide a text "n" times?

Hi, I really like this repository, thank you so much Robin for developing it.
I would like to hide a piece of short text (<100 bytes) "n" times in random places within the carrier. I tried to follow the functions but I got lost and couldn't figure out.

Any tips please?

OverflowError

$ ./LSBSteg.py -steg-image flag.png -out res

Traceback (most recent call last):
File "./LSBSteg.py", line 242, in
main(av)
File "./LSBSteg.py", line 236, in main
binary_steg_reveal(args.steg_image, args.out)
File "./LSBSteg.py", line 212, in binary_steg_reveal
bin = steg.unhideBin()
File "./LSBSteg.py", line 194, in unhideBin
for i in range(l):
OverflowError: range() result has too many items

name 'cv' is not defined

Working on a Mac with brew installed utilities and I am getting this error message (from the sample code):
gil$ python foo.py
Traceback (most recent call last):
File "foo.py", line 14, in
inp = cv.LoadImage("source.bmp")
NameError: name 'cv' is not defined

I had a bunch of issues around not having cv at all but seemed to have fixed that with:

brew install homebrew/science/opencv
....
==> Installing opencv
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/science/ope

################################################################## 100.0%

==> Pouring opencv-2.4.10.1.yosemite.bottle.tar.gz

I could be barking up the wrong tree entirely :-(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.