Jun 4 / Cyb3r

Cryptography and Steganography with Python

Basic definitions

Cryptography is the practice and study of hiding information. The word is a combination of the GreekKryptos(hidden) and gráphō  (I write)

Stenography: Shorthand is an abbreviated symbolic writing method that increases speed or brevity of writing as compared to a normal method of writing a language. The process of writing in shorthand is called stenography, from the Greek stenos (narrow) and graphē or graphie (writing)

Setting up libraries

Practically all Linux distributions will have python insdtalled, or available as installable packages.

Now other libraries for the task

  1. stepicInstalling the packages

Stepic

#tar xzf stepic-0.3.tar.gz

#cd stepic-0.3

#python setup.py install

Steganography with stepic

  1. Start the Python interative shell$python
  2. Import PIL’s Image and the stepic module
  3. >>>import Image, stepic
  4. Open the image file in which you want to hide data
  5. >>>im=image.open(“cyber.jpg”);
  6. Encode some text into the source image. This returnd another image instance, which you need to save to a new file:>>>im2=stepic.encode(im, ‘This is the hidden text’)>>>im2.save(‘cyber2.jpg’,'JPEG’)
  7. Display both the images(with and without hidden data) to see if there is any visible changes:>>>im2=Image.open(“cyber2.jpg”)>>>im2.show()

    >>>im.show()

    use the decode() function to extract data from an image:

      >>>im1.Image.open(‘cyber2.jpg’)

      >>>s=stepic.decode(im1)

      >>>data=s.decode()

      >>>print data

      This is hidden text

Download Stepic

Jun 4 / Cyb3r

Dear Friends

Dear friends this is your cyber. You can get awesome contents from here. wait and see…..

View in: Mobile | Standard