- Python Libraries
- Python Services
- The String Group
- Generic Operational System
- Optional Operational System
- Internet Protocol and Support
- Internet Data Handling
- Restricted Execution
- UNIX Specific
- SGI IRIX Specific
- Sun OS Specific
- MS Windows Specific
- Macintosh Specific
- Undocumented Modules
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)