The Python Way :-
It is possible to hide some data into an image using CMD as demonstrated in my previous post. In this post we are going to accomplish just that but by using Python. Now you must be thinking if we can do it using command prompt in Windows then why should we bother with python, so the answer to that question is Because We Can..!!
Behind The Scene :-
Before i tell you how to hide the data into an image, let's discuss what is really happening in the background :-
The process opens each file at it's binary state and merges them into one. To view the image you can open it simply and if you want to view the hidden data open it with any archiver software like 7zip or WinRAR as the files must be first archived before merging into the image.
Don't Miss :- Password Protect Any Folder In Windows (No Software)
Requirement :-
The Process :-
Type the following lines in a text file and save it with .py extension :
Here image.jpg is the image behind which the data will be hidden and file.zip is the file which contains the data to be hidden.
So, with just 5 lines of code we can easily hide our data from the eyes of an unsuspecting user. Note that it doesn't encrypt the data in any way, a user with some know-how could still find the information that is hidden.
If you feel the need to split the files again you can create and run this python script same as above :
Just run this script and your file will be splitted in no time.
It is possible to hide some data into an image using CMD as demonstrated in my previous post. In this post we are going to accomplish just that but by using Python. Now you must be thinking if we can do it using command prompt in Windows then why should we bother with python, so the answer to that question is Because We Can..!!
Behind The Scene :-
Before i tell you how to hide the data into an image, let's discuss what is really happening in the background :-
The process opens each file at it's binary state and merges them into one. To view the image you can open it simply and if you want to view the hidden data open it with any archiver software like 7zip or WinRAR as the files must be first archived before merging into the image.
Don't Miss :- Password Protect Any Folder In Windows (No Software)
Requirement :-
- Python Compiler
- Text Editor
Type the following lines in a text file and save it with .py extension :
- image = open("image.jpg", "ab")
- archive = open("file.zip","rb")
- image.write("\n"+archive.read())
- image.close()
- archive.close()
Here image.jpg is the image behind which the data will be hidden and file.zip is the file which contains the data to be hidden.
So, with just 5 lines of code we can easily hide our data from the eyes of an unsuspecting user. Note that it doesn't encrypt the data in any way, a user with some know-how could still find the information that is hidden.
If you feel the need to split the files again you can create and run this python script same as above :
- import os
- imgsize = os.stat("image.jpg").st_size
- image = open("image.jpg", "ab")
- archsize = os.stat("file.zip").st_size
- archive = open("file.zip","rb")
- image.write("\n"+archive.read())
- image.close()
- archive.close()
- narchive = open("file2.zip", "wb")
- old = open("image.jpg", "rb")
- oldr = old.read()
- data = oldr[-archsize:]
- narchive.write(data)
- narchive.close()
- old.close()
Just run this script and your file will be splitted in no time.
ReplyDeleteIf you ever want to change or up your university grades contact cybergolden hacker he'll get it done and show a proof of work done before payment. He's efficient, reliable and affordable. He can also perform all sorts of hacks including text, whatsapp, password decrypt,hack any mobile phone, Escape Bancruptcy, Delete Criminal Records and the rest
Email: cybergoldenhacker at gmail dot com