AES Blowfish CAST5 Available Ciphers

146 In addition to the actual cipher algorithms that OpenSSL provides, the null cipher is also supported, which passes data through untouched. You can access this cipher using EVP_enc_null . It is primarily useful for testing the EVP interface, so you should generally avoid using it in production systems.

6.2.1.1 AES

AES is the new Advanced Encryption Standard, also occasionally called Rijndael. It is available only in OpenSSL Versions 0.9.7 or later. AES is a block cipher that supports key and block sizes of 128, 192, and 256 bits. Unfortunately, as of this writing, OpenSSL does not provide support for using AES in CFB or OFB modes. See Table 6-1 . Table 6-1. Referencing the AES cipher OpenSSL 0.9.7 only Cipher mode Keyblock size EVP call for cipher object String for cipher lookup ECB 128 bits EVP_aes_128_ecb aes-128-ecb CBC 128 bits EVP_aes_128_cbc aes-128-cbc ECB 192 bits EVP_aes_192_ecb aes-192-ecb CBC 192 bits EVP_aes_192_cbc aes-192-cbc ECB 256 bits EVP_aes_256_ecb aes-256-ecb CBC 256 bits EVP_aes_256_cbc aes-256-cbc

6.2.1.2 Blowfish

Blowfish is a block cipher designed by Bruce Schneier of Applied Cryptography fame. This algorithm has a good security margin and is the fastest block cipher OpenSSL provides. The key length of Blowfish is variable up to 448 bits, but generally, 128-bit keys are used. The block-size for this cipher is fixed at 64-bits. Its biggest drawback is that key setup time is slow. As a result, Blowfish isnt a good choice when many different keys are used to encrypt short data items. Table 6-2 gives details. Table 6-2. Referencing the Blowfish cipher Cipher mode EVP call for cipher object String for cipher lookup ECB EVP_bf_ecb bf-ecb CBC EVP_bf_cbc bf-cbc CFB EVP_bf_cfb bf-cfb OFB EVP_bf_ofb bf-ofb

6.2.1.3 CAST5

The CAST5 algorithm, authored by Carlisle Adams and Stafford Tavares, is another cipher with variable-length keys and 64-bit blocks. The CAST5 specification allows for key lengths between 5 and 16 bytes 40 and 128 bits; keys must be a multiple of 8 bits in length. OpenSSL defaults to using 128-bit keys. CAST is a fast cipher with no known weaknesses. See Table 6-3 . Table 6-3. Referencing the CAST5 cipher Cipher mode EVP call for cipher object String for cipher lookup ECB EVP_cast_ecb cast-ecb CBC EVP_cast_cbc cast-cbc CFB EVP_cast_cfb cast-cfb OFB EVP_cast_ofb cast-ofb 147

6.2.1.4 DES