Hiding .exe file inside JPEG using python3
I would like to hide calc.exe inside the jpg and when I click to my JPEG I would like the calc.exe will execute.
My python script do this
1.hide calc.exe file inside jpeg.
2.run calc.exe when I open my jpeg.
I will be thankful if you have better way!

import os, sys

input_file = "python.jpeg"
program = "calc.exe"
output_filen = "snake.jpeg"

open( output_filen, "wb" ).write( open( input_filen, "rb" ).read() + open( payload, "rb" ).read())


good question... what you were trying is very interesting......but can you please explain how your trying to bind those two...

if you could explain me this line

open( output_filen, "wb" ).write( open( input_filen, "rb" ).read() + open( payload, "rb" ).read())

Thanks for your answer,I think my code was wrong.
I have study steganography in university how to hide file inside jpeg .
it was special tools we used both i Linux and windows.
For me its so interesting how to write own tools with python
in fact Im bigger for python programming.
I will be thankful if you have any idea.

well i have no idea how to do, but did know some basic of python, let start doing it, will be a fun to create some thing like that.........well to start with, if you could explain what exactly that tool does...as you know steganography you could tell us how to exactly hide thing happen, just in general way, not in terms of python...

Hi Sir
Thank you for your answer if you like to learn about Steganography its best that you can Google it.

okay gr8, no problem......you idea was interesting, will try it..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.