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.

Simple Trick To Block Facebook On Your Computer Easily

Its been long since I have posted about facebook tricks so here I am with this new tutorial in this tutorial I will share with you guys an amazing programme or small little tool that will allow you block facebook on your computer easily in just few simple steps. So lets get started 

Change User Account Password in Windows 7 and 10 Without Knowing Old Password (Method 2)

Hey readers, in previous article I showed how to change user account password using Windows management tool, in this article we will do the same by using CMD. This will be easier than previous trick.  Follow the link below if you missed 1st method Change User Account Password in Windows 7 and 10 Without Knowing Old Password (Method 1) Step 1: Open an elevated Command Prompt. Click on Start button, go to All Programs -> Accessories and right click on Command Prompt and select "Run as Administrator" from context menu. In Windows 10, you can do this by simply searching in Start menu. Step 2: You can use the net user command to change Windows password easily, without supplying the old password: net user username  new_password Replace username with your Windows account name, and new_password with your desired new password. Thanks for Visiting..