2
Step1: Start Step2: Read the message MSG and the image IMG Step3: Set C=First character of the MSG and set J=1 Step4: If C<END of MSG go to Step 5 Else go to Step 13 Step 5: VAL=ASCII value of C Step 6: If VAL<10 Set X=0, Y=0, Z=VAL Else If 10<=VAL>100 Set X=0, Y=VAL/10, Z=VAL%10 Else If 100<VAL Set X=VAL/100, Y=(VAL%100)/10, Z=VAL%10 Step 7: R=Red Value of Pixel[J] of IMG G=Green Value of Pixel[J] of IMG B=Blue Value of Pixel[J] of IMG Step 8: If R>240 Set R=240 If G>240 Set G=240 If B>240 Set B=240 Step 9: Set R1 = (R/10)*10+X Set G1 = (G/10)*10+Y Set B1 = (B/10)*10+Z Step 10:Set R Value of Pixel[J]=R1 Set G Value of Pixel[J]=G1 Set B Value of Pixel[J]=B1 Step 11: Set J=J+1; Set C=C+1 Step 12: Go to Step 4 Step 13: R=R value of Pixel[J] Step 14: R1 = (R/10)*10 Step 15: If R1=0 set R1=9 Else set R1=R1-1 Step 16: End

Stenography Logic

Embed Size (px)

DESCRIPTION

logic behind stenography.

Citation preview

Page 1: Stenography Logic

Step1: StartStep2: Read the message MSG and the image IMGStep3: Set C=First character of the MSG and set J=1Step4: If C<END of MSG go to Step 5

Else go to Step 13Step 5: VAL=ASCII value of CStep 6: If VAL<10

Set X=0, Y=0, Z=VALElse If 10<=VAL>100

Set X=0, Y=VAL/10, Z=VAL%10Else If 100<VAL

Set X=VAL/100, Y=(VAL%100)/10, Z=VAL%10Step 7: R=Red Value of Pixel[J] of IMG

G=Green Value of Pixel[J] of IMGB=Blue Value of Pixel[J] of IMG

Step 8: If R>240 Set R=240If G>240 Set G=240If B>240 Set B=240

Step 9: Set R1 = (R/10)*10+XSet G1 = (G/10)*10+YSet B1 = (B/10)*10+Z

Step 10:Set R Value of Pixel[J]=R1Set G Value of Pixel[J]=G1Set B Value of Pixel[J]=B1

Step 11: Set J=J+1; Set C=C+1Step 12: Go to Step 4Step 13: R=R value of Pixel[J]Step 14: R1 = (R/10)*10Step 15: If R1=0 set R1=9

Else set R1=R1-1Step 16: End

Page 2: Stenography Logic

Step1: StartStep2: Read image IMGStep3: Set P=1Step 4: Set R=Red Value of Pixel[P] of IMG

Set G=Green Value of Pixel[P] of IMGSet B=Blue Value of Pixel[P] of IMG

Step 5:If R % 10=9 go to step 11Else go to step 6

Step 6: Set X=R%10Set Y=G%10Set Z=B%10

Step 7: VAL=X*100+Y*10+ZStep 8: C[P-1] = Character of ascii value[VAL]Step 9: Set P = P+1

Step 10: Go to Step 4Step 11: J=0Step 12:Repeat Until J<=P-2

MSG=MSG+C[P]Step 13: Display MSGStep 14: End