python-geeks / Automation-scripts

Repo for creating awesome automation scripts to make my panda lazier
MIT License
1.06k stars 566 forks source link

Image steganography #401

Closed Sandhya1708 closed 3 years ago

Sandhya1708 commented 3 years ago

Script Title - Image Steganography

Brief - When we give an image and a message as an input , the message given would be encrypted twice ,i.e., the message is encrypted and a cypher text is obtained. The cypher text is then encrypted into the edge of the image.

Instructions

Programming Language

Happy Coding

jonyeru23 commented 3 years ago

Hi this is my first time contributing, i would love to give it a shot!

jonyeru23 commented 3 years ago

Is the image a path to the image file?

Sandhya1708 commented 3 years ago

Well, the code I wrote takes the image as input.

Sandhya1708 commented 3 years ago

I have not yet added the code into this page. I wanted to contribute , so I had put up this issue . This is my first time to contribute too.

jonyeru23 commented 3 years ago

def encrypt_and_hide(text, image): public_key, private_key = rsa.newkeys(512)

encMessage = rsa.encrypt(text.encode(), public_key)

with open(image, 'ab') as f:
    f.write(encMessage)

well this is the little function i wrote for your problem, tell me if it works for you