11.4 Other Conventional Encryption Algorithms
11.4 Other Conventional Encryption Algorithms
Perl provides implementation of several conventional encryption algorithms in addition to DES. Among them are the International Data Encryption Algorithm (IDEA), Blowfish and Rijndael or the Advanced Encryption Algorithm (AES). The implementations are available in the modules
Crypt::IDEA, Crypt::IDEA,
Crypt::Blowfish and Crypt::Rijndael, respectively.
IDEA is an algorithm that was proposed to replace DES. Its block size is 64 bits like DES. The IDEA key is 128 bits making brute-force breaking or cryptanalysis practically impossible for a long time to come. IDEA uses the XOR operation like DES. It also uses two additional bit based operations: addition of integers modulo (modulo 655536), and multiplication of integers modulo (modulo 65537). IDEA goes through 8 rounds of repeated operations or rounds, and a ninth output transformation round. IDEA can be used with Crypt::ECB and Crypt::CBC modes of operation.
Blowfish converts 64 bits of plaintext to 64-bit blocks of ciphertext. It is used widely as well. It uses two primitive operations: XOR, and addition modulo . It was designed as a replacement for DES as well. It uses table-based transformation as well, but the tables are considered much more difficult to break than the DES tables. The key lengths can be variable, up to 448 bits. It uses 18 rounds of repeated computation, but is very fast to execute. Blowfish can be used with Crypt::ECB and Crypt::CBC modes of cipher operation.
The Rijndael cipher is designed for use with keys of length 128, 192 and 256 bits [TW01]. The algorithm has 10 rounds of repeated computation. Each round consists of four basic steps. The block size is 128 bits.
ByteSub Transformation: This is table or box-based transformation.
ShiftRow Transformation: This mixes up bits over many rounds. It mixes up elements within a single row.
MixColumn Transformation: Here the mixing of the elements is performed within a column.
AddRoundKey: This consists of XOR operations with the key and result of a previous step.
The output is a 128-bit ciphertext block. Decryption consists of performing the inverse encryption steps in reverse.
The Rijndael algorithm is different from DES, IDEA and Blowfish in that in Rijndael all bits are moved and changed in each round. In DES, IDEA and Blowfish, in each round, only one half of the bits are changed; the other half of the bits are not changed, but moved to the other side. The design of the tables is explicit and algebraic in contrast to DES where the tables were mysterious. Rijndael has been shown to resist various breaking or cryptanalysis attempts such as differential and linear cryptanalysis that spelled the end of the long reign of DES. The Perl module for Rijndael is Crypt::Rijndael. It works with the Crypt::CBC module defining the CBC mode of cipher operation. The key size used by Crypt::Rijndael can be 16, 24, or 32 bytes although to
work with Crypt::CBC, only 32 bytes can be used at the time of writing this book. Crypt::ECB also works with Crypt::Rijndael. The block size is 16 bytes.
