Coder Social home page Coder Social logo

extiop / yet-another-shade-of-lsb Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.28 MB

Yet another shade of LSB (YASLSB) technique bridges the well-knowns LSB and PVD steganography approaches together. It can be applied to PNG images.

License: MIT License

Python 100.00%
lsb pvd steganography

yet-another-shade-of-lsb's Introduction

Yet another shade of LSB

Yet another shade of LSB (YASLSB) technique bridges the well-knowns LSB and PVD steganography approaches together. It can be applied to PNG images.

How it works

This proof of concept is only working for the green channel at the moment, it hides data using a variant of the LSB steganography. Input data is converted to base2, then for each "0" or "1" to encode, a trick is used. The latter is to alter the image a tiny bit to get the right delta between two following pixels.

For a green pixel g and its previous one pg, delta_green = g - pg can be computed. To encode "0", delta_green < 0 is set, to encode "1", delta_green > 0 is set. Hence, for decryption, delta_green is evaluated: - if it is less than 0, a "0" is encoded. - if it is greater than 0, a "1" is encoded.

Proof of concept with the green channel

I encrypt my data 4n0th3r_cust0m_pr0duct10n:

python3 encrypt.py -i images/pepo.png -d 4n0th3r_cust0m_pr0duct10n -o images/encrypted.png
[+] Base2 length data: 200
[+] Successfully encoded plaintext in ./images/encrypted.png

Keep in mind that I need that length and it is encoded in the decryption process, I might figure out how automate that in the future. Anyway, I decrypt it:

python3 decrypt.py -i images/encrypted.png                                                  
[+] Retrieved plaintext from ./images/encrypted.png: 4n6th3r_cust0m_pr0duct10n

Voilà! Give it a try yourself by cloning my repository!

Limitations

Only green channel is supported for encoding at the moment, as a proof of concept.

Dependency

sudo pip install pillow

Roadmap

  • Add support for encoding into red, blue and alpha channels.
  • Improve accuracy of threshold to encode data to minimize image modification
  • Implement a way to unhide a secret without knowing its size
  • Add support for other kind of images (JPG, GIF...)

Contributing

Please if you want to bring your stone to the building, read and follow CONTRIBUTING.md.

yet-another-shade-of-lsb's People

Watchers

 avatar

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.