The Algorithm I designed-Triseed Algorithm

For the purpose of developing this software such that it doesnt have the predictability drawback of the LSB algorithm, I developed my own algorithm which included using 3 random seed values as a result of which I named it Triseed algorithm for Steganography

The algorithm works as follows


  1. Takes the message from the user and changes it into its corresponding ascii codes

  2. Converts the message into a string of 0s and 1s

  3. Takes a random number input from the user say “int a”

  4. Now it begins to generate seed values

  • First it generates an interval a*3 and a*7 with lower and upper limit respectively.

  • Then from within this interval selects one number say n1, and mods it with 7 which gives n11. So n11 is the first seed called the inversion seed. The inversion seed decides that at what interval will each bit of the message be inverted in order to encrypt the message before embedding it in the picture

  • Then next it takes an interval where lower limit is a*3 and upper limit is 24. It selects one number from this interval. The selected number is supposed to be the number of bit of a pixel of the image that is supposed to be changed. Bits 1-12 fall in the red and earlier green component of the image and a change in the same would cause a visible change in the image. Hence here it checks, if the generated number is less than 12 it takes its mirror image bit number from the end, for eg if it generates 4 then the 4th bit from the last is considered that is 21. If the number is greater than 12 then it takes the number itself.

  • Again taking a*3 and a*7 as lower and upper limit respectively it chooses another random number say “r”, then r+6 is chosen as the pixel number from which the embedding starts. The first 6 bits are reserved to send the secret key for the decoder to decode the message.

  1. Now it takes the message which has been converted into binary form and inverts bits as dictated by n11 .

  2. Next it takes an image as input. In the first two pixels it embeds a watermark or a fixed string so as to indicate that the image is from a trusted source. This is called digital watermarking.

  3. The 3rd bit stores the length of the message, the 4th bit stores the start position, the 5th stores the inversion bit and 6th stores the embedding bit.

  4. After this the embedding of the message begins. According to the value of the embedding bit the green or blue component of the pixel is extracted and changed into the binary form. The required but is replaced by first bit of the message and then it continues till the message is completed


  1. The decoder first reads the first two pixels to check for the watermark.

  2. Next it reads pixels 3,4,5,6 for the secret key and according to that starts decoding

  3. Using the start bit and embedding bit it begins to extract the message bits and then inverts the required bits again.

  4. Then it changes binary string back into ascii values and then string values to give back the original message which is then displayed to the user.


Constructive and genuine appreciation and/or criticism most welcome

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s