Package: cryptosteganography
A python steganography module to store messages or files protected with
AES-256 encryption inside an image.Steganography is the art of concealing information within different
types of media objects such as images or audio files, in such a way that
no one, apart from the sender and intended recipient, suspects the
existence of the message. By default steganography is a type of security
through obscurity.Additionally this module also enhance the security of the steganography through data encryption. The data concealed
is encrypted using AES 256 encryption, a popular algorithm used in symmetric key cryptography.PrerequisitesPython 3+pip3(Most Linux systems comes with python 3 installed by default).Dependencies Installation (Ubuntu)$sudoapt-getinstallpython3-pipDependencies Installation (MacOS)To install Python3 I recommend use Homebrew package managerThe script will explain what changes it will make and prompt you before
the installation begins.$ruby-e"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/master/install)"Edit your ~/.profile to include (if it is not already there)exportPATH=/usr/local/bin:/usr/local/sbin:$PATHTo install Python 3:$brewinstallpython3InstallationTo install the package just run$pip3installcryptosteganographyUsageUse as a library in a python programStore a message string inside an imagefromcryptosteganographyimportCryptoSteganographycrypto_steganography=CryptoSteganography('My secret password key')# Save the encrypted file inside the imagecrypto_steganography.hide('input_image_name.jpg','output_image_file.png','My secret message')secret=crypto_steganography.retrieve('output_image_file.png')print(secret)# My secret messageStore a binary file inside an imageNote: This only works if the concealed file size is smaller than the input imagefromcryptosteganographyimportCryptoSteganographymessage=Nonewithopen('sample.mp3',"rb")asf:message=f.read()crypto_steganography=CryptoSteganography('My secret password key')# Save the encrypted file inside the imagecrypto_steganography.hide('input_image_name.jpg','output_image_file.png',message)# Retrieve the file ( the previous crypto_steganography instance could be used but I instantiate a brand new object# with the same password key just to demonstrate that can it can be used to decrypt)crypto_steganography=CryptoSteganography('My secret password key')decrypted_bin=crypto_steganography.retrieve('output_image_file.png')# Save the data to a new filewithopen('decrypted_sample.mp3','wb')asf:f.write(secret_bin)Use as a python programCheck help at command line prompt to learn how to use it.$cryptosteganography-husage:cryptosteganography[-h]{save,retrieve}...Apythonsteganographyscriptthatsave/retrieveatext/file(AES256encrypted)insideanimage.positionalarguments:{save,retrieve}sub-commandhelpsavesavehelpretrieveretrievehelpoptionalarguments:-h,--helpshowthishelpmessageandexitSave sub command help$cryptosteganographysave-husage:cryptosteganographysave[-h]-iINPUT_IMAGE_FILE(-mMESSAGE|-fMESSAGE_FILE)-oOUTPUT_IMAGE_FILEoptionalarguments:-h,--helpshowthishelpmessageandexit-iINPUT_IMAGE_FILE,--inputINPUT_IMAGE_FILEInputimagefile.-mMESSAGE,--messageMESSAGEYoursecretmessagetohide(nonbinary).-fMESSAGE_FILE,--fileMESSAGE_FILEYoursecrettohide(Textoranybinaryfile).-oOUTPUT_IMAGE_FILE,--outputOUTPUT_IMAGE_FILEOutputimagecontainingthesecret.Retrieve sub command help$cryptosteganographyretrieve-husage:cryptosteganographyretrieve[-h]-iINPUT_IMAGE_FILE[-oRETRIEVED_FILE]optionalarguments:-h,--helpshowthishelpmessageandexit-iINPUT_IMAGE_FILE,--inputINPUT_IMAGE_FILEInputimagefile.-oRETRIEVED_FILE,--outputRETRIEVED_FILEOutputforthebinarysecretfile(Textoranybinaryfile).Save message example$cryptosteganographysave-i4824157.png-m"My secret message..."-ooutput.pngEnterthekeypassword:Outputimageoutput.pngsavedwithsuccessRetrieve message example$cryptosteganographyretrieve-ioutput.pngEnterthekeypassword:Mysecretmessage...Save file example$cryptosteganographysave-iinput_image_name.jpg-fduck_logo.pem-ooutput_file.pngEnterthekeypassword:Outputimageoutput_file.pngsavedwithsuccessRetrieve file example$cryptosteganographyretrieve-ioutput.png-odecrypted_fileEnterthekeypassword:decrypted_filesavedwithsuccessLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsAuthorsVin Busquetfile for detailsLimitationsOnly works with python 3It does not work if the conceived file is greater than original input
fileOuput image is limited to PNG format only.I did not tested with all conceived file types. Feel free toreportany bug you findContributingFor details, check outCONTRIBUTING.md.ChangelogFor details, check outCHANGELOG.md.AcknowledgmentsPyCryptodomeStéganô