Answer the question
In order to leave comments, you need to log in
How to open encrypted photo as photo?
I load the bytes of a photo (eg JPEG) into my program, manipulate those bytes, and write the encrypted bytes to a new file. I want to open this new file in the same way as the original JPEG in the photo viewer, but it does not recognize this file as a photo and therefore does not show anything but an error (the file extension was automatically set to JPEG when opening). Having rummaged a little in the internet, I realized that different file extensions have some kind of service bytes of their own. But how can I restore them?
I use the DES block encryption algorithm. In general, I need to do this not only with photos, I want to encrypt any files (music, for example). But I decided to start with something simple. In short, the question is how to open encrypted files, in particular photos, in the same format as they were before encryption. Here is an example from wikipedia.
Photo before encryption:
Photo after encryption (in JPEG format):
I hope I explained it clearly.
Answer the question
In order to leave comments, you need to log in
you have porridge
read up on what you encrypted - studied and google steganography
What you are doing is complete nonsense.
By uploading a picture and performing manipulations, you are manipulating not with the picture, but with the jpeg format.
In order to manipulate the picture, you must understand the format of the picture, and when loading it, CONVERT to an image, and not encrypt the undecoded data of the JPEG file.
Read the format, get a binary image that can be displayed on the screen, convert this image, and save as jpeg (or other).
Learn how to use image libraries.
The author mixed together
- cryptography
- steganography
- different file formats (compressed lossy)
These are three different topics and you can start 3 different questions on them to clarify what is what. Without these basics, there is simply no point in continuing experiments. Otherwise, the author will be eternal why.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question