Home > Articles > Open Source > Python

Python Libraries

  • Print
  • + Share This


The following modules implement various algorithms of cryptographic nature.

For more information about this topic, you can also check out the following Web site:


It contains cryptographic modules written by Andrew Kuchling for reading and decrypting PGP files.


The md5 module is a cryptographically secure hashing algorithm that implements an interface to RSA's MD5 message digest algorithm. Based on a given string, it calculates a 128-bit message signature.


The sha module is a message digest algorithm that implements an interface to NIST's secure hash algorithm, known as sha. This module takes a sequence of input text and generates a 160-bit hash value.


The mpz module implements the interface to part of the GNU multiple precision integer libraries.


The rotor module implements a permutation-based encryption and decryption engine. (The design is derived from the Enigma device, a machine used by the Germans to encrypt messages during WWII.)

>>> import rotor
>>> message = raw_input("Enter the message")
>>> key = raw_input("Enter the key")
>>> newr = rotor.newrotor(key)
>>> enc = newr.encrypt(message)
>>> print "The encoded message is: ", repr(enc)
>>> dec = newr.decrypt(enc)
>>> print "The decoded message is: ", repr(dec)
  • + Share This
  • 🔖 Save To Your Account

Related Resources

There are currently no related titles. Please check back later.