Category Archives: Programming

Text Encryption and Decryption python script

So i have been back to programming for a few weeks now. I started visiting some other languages before i decided whether i wanted to stay with python or not. Ultimately i decided to stick with python and i love it so. It had been a few months since i coded anything and needed to brush up on my python skills.

I wrote a few programs to get back into the flow of things, one of which i will post here. Its not that great or that hard to be honest. Its a simple text encryption and decryption script. Basically you give it a string of words or a word and it will encrypt it in whatever encryption method is chosen by the user and is available. It will then give you the encrypted message and also write the message to EncodedMessage.txt which will go into whatever folder the .py script is located.

Likewise for decryption it will ask you for a .txt file name which will need to be in the same folder as the .py script. Then it will give you the decrypted message and also write the message to DecodedMessage.txt which will be located in the same folder as the .py script.

I have a few more plans for this program like adding some more encryption methods and i would also like to add the functionality of the decryption function to allow the user to type in the encrypted message or reading it from the text file. At the moment it will just read it from a text file. Hopefully someone out there enjoys it or learns from it.

here is the git repository

Steg Img update

Before I release Steg Img I would like to go over some basic steganography techniques used in the program. At present       Steg Img does 3 different scans. The first scan will test for certain text within the file. For instance if you take any image and open it with a text editor you will see a bunch of characters that make no sense what so ever. However text can be hidden within all the non sense characters.

The second scan will see if the image file contains another file within it. To be more specific using a command prompt you can combine a text file, mp3 file, and many others with the image file. This in no way changes the image file and the image is still able to be viewed with your favorite image viewing software.

The last scan is a bit more complicated. To explain look at the picture below


A pixel is made up of red, blue, and green, or RGB value. The value of either the red, blue, or green can be between 0-255. Download the image and open it in your favorite image manipulation program, and zoom in as far as possible. Next we will be converting the pixels to letters. Use a color picker and choose the first blue pixel of the blue strip.  Its R,G,B value is 0,0,112 meaning the pixel has 0 red, 0 green, and 112 blue.

Now if we head over to we can convert the pixels to letters. We can see by using the table that the decimal 112 is = p. Next we will check the second pixel. As you can see it has a value of 0,0,97 which is = a. The last 2 pixels are 0,0,115 which is the letter s.

The reason I used the word “pass” is because if the word “password” is located within the image it would’nt be necessary to search for the whole word since pass is inside password. The algorithm Steg Img currently uses only looks for the word “pass”.  Im sure by now you can guess what the other 2 pixel strips say. Keep in mind this is a very basic method and is predicated on having 0 in the other two RGB values.

Hopefully with the next  Steg Img update i will have something worth releasing.