Skip to main content

How To Hide Data Behind File Using Python

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..!!


hidden-data-behind-image

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
The Process :-
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.

Comments



  1. If 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

    ReplyDelete

Post a Comment

Popular posts from this blog

Free Download DELmE's Batch Virus Creator Tool (Updated 2018)

DELmE's Virus Generator DELmE’s Batch Virus Generator is an amazing virus creation program with lots of options to infect the victim’s PC such as formating C: drive, deleting all files in Hard Disk Drive, disabling admin Privileges , cleaning registry, changing home page, killing tasks, disabling/removing antivirus and firewall and lots more.

How to Hack Facebook Account Using Phishing (Wapka)

Hey geeks here I am with this cool post to show you how to hack any facebook account using phishing easily. As we all know facebook is very popular social media now days. There are more fb id are there on facebook then people living on earth. In this post we will be hacking a facebook account easily by using phishing method. This post is for educational purpose only. First of all...What is Phishing...? Phishing is a trick in which we provide the target with a fake login page. As soon as the target types its username and password and hits enter the credentials of the target automatically saves to your system. So Let's get started...

Virus Creating Tool Free Download

Hey geeks in today's trick I will show you how to create a deadly virus by your own without doing any coding. As you all know virus are purely threat to our systems and can cause sever damage to the system.