See All Titles |
![]() ![]() CryptographicThe following modules implement various algorithms of cryptographic nature. For more information about this topic, you can also check out the following Web site: http://starship.python.net/crew/amk/python/crypto.html It contains cryptographic modules written by Andrew Kuchling for reading and decrypting PGP files. md5The 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. shaThe 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. mpzThe mpz module implements the interface to part of the GNU multiple precision integer libraries. rotorThe 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)
|
Index terms contained in this sectiondevicesEnigma Enigma device |
© 2002, O'Reilly & Associates, Inc. |