DES DESX Triple DES

147

6.2.1.4 DES

DES, the Data Encryption Standard, uses fixed 64-bit blocks and 64-bit keys. Eight bits are parity bits, giving a maximum of 56 bits of strength. These days, the parity bits are usually completely ignored. DES dates back to the mid-1970s and is certainly the most widely scrutinized symmetric algorithm available. While no significant attacks better than brute force have ever been found, brute force is a very real attack, since a 56-bit keyspace is widely considered too small. Additionally, DES is the slowest of the ciphers OpenSSL supports, except for more secure DES variants. It is a good idea to avoid vanilla DES unless you are supporting legacy systems. See Table 6-4 . Table 6-4. Referencing standard DES Cipher mode EVP call for cipher object String for cipher lookup ECB EVP_des_ecb des-ecb CBC EVP_des_cbc des-cbc CFB EVP_des_cfb des-cfb OFB EVP_des_ofb des-ofb

6.2.1.5 DESX

DESX is a DES variant that is resistant to brute-force attacks. It uses an additional 64 bits of key material to obscure the inputs and outputs of DES. The extra key material is used in a simple and efficient manner, resulting in a cipher that is not much slower than traditional DES, but is far more resistant to brute-force attacks. In fact, a brute-force attack is infeasible with DESX without a large number of known plaintexts. Other attacks against DESX may worry you if you think an attacker might be able to get 2 60 plaintextciphertext pairs. Usually, thats not much of a worry. DESX runs only in CBC mode. When speed is important and cryptographic acceleration is an option, DESX shines, because most such hardware supports DES often exclusively, and DESX can be accelerated using standard DES acceleration. Nonetheless, triple DES offers a greater security margin, so is preferable if its performance can be tolerated. See Table 6-5 for details. Table 6-5. Referencing DESX Cipher mode EVP call for cipher object String for cipher lookup CBC EVP_desx_cbc desx

6.2.1.6 Triple DES

Triple DES , often written as 3DES, is the most popular variant of DES and is probably the most conservative symmetric cipher available, due to the wide scrutiny DES has seen in the past quarter century. It is also the slowest algorithm available, though acceleration hardware can help. With 3DES, encryption is performed by encrypting data using DES, decrypting the ciphertext using a second key, then encrypting the data again, either with the original key two-key 3DES or with a third key three-key 3DES. Three-key 3DES is always a better choice than two-key, as it is more secure and is no slower. The only drawback is that it requires a few extra bits for storing the additional key material. See Table 6-6 . Table 6-6. Referencing 3DES Cipher mode EVP call for cipher object String for cipher lookup ECB 3 key EVP_des_ede3 des-ede3 CBC 3 key EVP_des_ede3_cbc des-ede3-cbc 148 CFB 3 key EVP_des_ede3_cfb des-ede3-cfb OFB 3 key EVP_des_ede3_ofb des-ede3-ofb ECB 2 key EVP_des_ede des-ede CBC 2 key EVP_des_ede_cbc des-ede-cbc CFB 2 key EVP_des_ede_cfb des-ede-cfb OFB 2 key EVP_des_ede_ofb des-ede-ofb

6.2.1.7 IDEA