Encrypting & Decyrpting
"Secret Images"


With SiMPLE it's easy to create your own "Secret Message" programs by merely shifting each letter in the message by a random amount. But this method of encrypting is not limited to only text information. Virtually any kind of data can be encrypted this way.

As an example, consider the scrambled bitmap image that appears at the top of this page (which was encrypted by subtracting Random(256) from each byte of the image data in the SiMPLE "blocks" logo). To decrypt the image (which is named "HIDDEN.BMP"), first copy it to the root directory of your "C:" drive (by right-clicking on the image and selecting "Save Picture As...") Then run the following Pro-SiMPLE program (which adds the Random(256) value back in):

   Pro-SiMPLE
   Int z[]={0,4,2,6,1,5,3,7,8,12,10,14,9,13,11,15}
   Int a, b, xsize, ysize, rgb
   Open a ("read C:\\HIDDEN.BMP")
   skip (18) @
   Read binary a (a, 0)
   Read binary a (b, 0)
   xsize=a+256*b
   skip (2) @
   Read binary a (a, 0)
   Read binary a (b, 0)
   ysize=a+256*b
   skip (94) @
   x=(640-xsize)/2; y=(384-ysize)/2
   Frame (x, y, x+xsize-1, y+ysize-1)
   Do yy=ysize-1,0
      Do xx=0,xsize-1,2
         Read binary a (rgb, 0)
         rgb=Cycle(rgb+Random(256), 256)
         zz=z[rgb/16]; Put pixel (x+xx, y+yy, zz)
         If (xx=xsize-1) Break
         zz=z[rgb%16]; Put pixel (x+xx+1, y+yy, zz)
      Loop
      skip ((16384-(xsize+1)/2)%4) @
   Loop
   Close a

   Task skip (Int n)
   Do k=1,n,1
      Read binary a (0, 0)
   Loop
When you run the program it will display the following (decrypted) image:


Now that you have your image decrypting program successfully working, you might enjoy decrypting the following images as well:


Want to generate your own encrypted images? Just use the MSPAINT program to create any 16-color (4-bits/pixel) image named "PICTURE.BMP". Then copy that "PICTURE.BMP" file to the root directory of your "C:" drive, and run this Pro-SiMPLE program (which will generate the encrypted "HIDDEN.BMP" file).



  [ Webmaster | FAQ's | Home Page | Contact Us ]