Decrypt P File Matlab
.Skip if you're familiar with pixel values and ASCIIEach pixel in a RGB image is represented by three 8-bit unsigned(non-negative) integers for the red, green and blue intesities. 8 bit means the intensities range from 0 to 255. In a grayscale image, each pixel is given by single integer value. 0 means total black, 255 means total white. The in-betweens are shades.Each character of text is represented by ASCII values that run from 0 to 128.
The extended ASCII is 8-bit and matches with the pixels' intensity range, which is 0 to 255.So encryption using these two can be done very simply just by treating them as normal integers and doing any operation which limits the encrypted value within 0 to 255, the encrypted result can also be represented as a pixel or as a character.Here you see the ASCII table for reference. Yeah, start with a grayscale. Once you understand that, you can proceed with RGB. You can select BMP format also but it is advisable to avoid JPEG if you are not using Matlab since it is compressed using compressing techniques.You can select a RGB image and convert it to grayscale using photoshop (open image select Image select Mode select grayscale). Sometimes an image seeming to be grayscale is actually RGB.
M Code Matlab
So do check beforehand.It's better to select a noisy image since after encrypting, the encrypted part will seem totally noisy. So an image which is already noisy will serve as a better camouflage.
I chose this noisy satellite image of an area.Keep it in mind that this original image will be your password to decrypting the coded image. Keep it safe.(The attached code will work on an image named 'original.png'. Change the code on your wish.). You can use various methods of encryption between the data and image pixels. Here a most basic algorithm is followed. You can easily check and modify the matlab codes attached.Put all the files (matlab file encrypto.m, text file and original image file) in the same folder and run the encrypto.m script.
If matlab asks to change default folder then do so.When the script is run, an image will be created. If you look closely on the image above you'll see the pixels at the top in which the text is hidden (but one can't decipher it without the original image).P.S. You can use bitwise XOR for encryption and decryption although I didn't use it here. Also be careful of proper conversion of the variables between 16-bit unsigned integer and 8-bit unsigned integer.P.P.S.: go and search for the commands and functions used in the codes if and when you need help. If you want to make your own program, this may help.
Here I'm showing the simple bitwise XOR approach.Encrypter:1. Open the text and image file.2.
Decrypt Matlab P File
Loop while( character count.