EVP_DES_CBC(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… EVP_DES_CBC β€” the DES cipher moment (libcrypto, bestie) πŸŽ€

okay so this page lives in the libcrypto library, and it's literally the whole DES cipher family rolled into one gorgeous little cast list. 22 functions. all of them returning const EVP_CIPHER *. no cap, they're all icons. ✨


🌸 SYNOPSIS 🌸

so first things first, you gotta pull in the header:

#include <openssl/evp.h>

and then every single one of these is a const EVP_CIPHER * function that takes no arguments β€” she just exists and hands you a cipher. main character energy fr fr:

const EVP_CIPHER *
EVP_des_cbc(void);

const EVP_CIPHER *
EVP_des_cfb(void);

const EVP_CIPHER *
EVP_des_cfb1(void);

const EVP_CIPHER *
EVP_des_cfb8(void);

const EVP_CIPHER *
EVP_des_cfb64(void);

const EVP_CIPHER *
EVP_des_ecb(void);

const EVP_CIPHER *
EVP_des_ofb(void);

const EVP_CIPHER *
EVP_des_ede(void);

const EVP_CIPHER *
EVP_des_ede_cbc(void);

const EVP_CIPHER *
EVP_des_ede_cfb(void);

const EVP_CIPHER *
EVP_des_ede_cfb64(void);

const EVP_CIPHER *
EVP_des_ede_ecb(void);

const EVP_CIPHER *
EVP_des_ede_ofb(void);

const EVP_CIPHER *
EVP_des_ede3(void);

const EVP_CIPHER *
EVP_des_ede3_cbc(void);

const EVP_CIPHER *
EVP_des_ede3_cfb(void);

const EVP_CIPHER *
EVP_des_ede3_cfb1(void);

const EVP_CIPHER *
EVP_des_ede3_cfb8(void);

const EVP_CIPHER *
EVP_des_ede3_cfb64(void);

const EVP_CIPHER *
EVP_des_ede3_ecb(void);

const EVP_CIPHER *
EVP_des_ede3_ofb(void);

const EVP_CIPHER *
EVP_desx_cbc(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

so these functions give you the DES encryption algorithm inside the evp(3) framework. DES is a block cipher that operates on 64 bit blocks, and the key length you pass to EVP_EncryptInit(3) is 64 bits. πŸ’«

but β€” and this is the spicy bit β€” only 56 of those bits actually get used in the encryption algorithm. the least significant bit in each of the eight bytes is only used for checking parity. so yeah, it's giving "mostly vibes". 🫢

⚠️ using this algorithm is discouraged, bestie. the short key length makes it vulnerable to brute force attacks. it's a legacy icon, not a security icon. periodt. πŸ’€

πŸ’– plain DES, the OG πŸ’–

  • EVP_des_cbc() β€” DES in CBC mode
  • EVP_des_cfb1() β€” DES in CFB mode with a 1-bit shift
  • EVP_des_cfb8() β€” DES in CFB mode with an 8-bit shift
  • EVP_des_cfb64() β€” DES in CFB mode with a 64-bit shift
  • EVP_des_ecb() β€” DES in ECB mode
  • EVP_des_ofb() β€” DES in OFB mode

and then EVP_des_cfb() is an alias for EVP_des_cfb64(), implemented as a macro. so if you see her, she's just EVP_des_cfb64() wearing a different wig. πŸ’…


πŸ’œ two key triple DES (ede) πŸ’œ

  • EVP_des_ede_cbc() β€” two key triple DES in CBC mode
  • EVP_des_ede_cfb64() β€” two key triple DES in CFB mode with a 64-bit shift
  • EVP_des_ede_ecb() β€” two key triple DES in ECB mode
  • EVP_des_ede_ofb() β€” two key triple DES in OFB mode

EVP_des_ede_cfb() is an alias for EVP_des_ede_cfb64(), implemented as a macro. and EVP_des_ede() is an alias for EVP_des_ede_ecb(). cute little nicknames, we love to see it. πŸŽ€


πŸ’… three key triple DES (ede3) πŸ’…

  • EVP_des_ede3_cbc() β€” three key triple DES in CBC mode
  • EVP_des_ede3_cfb1() β€” three key triple DES in CFB mode with a 1-bit shift
  • EVP_des_ede3_cfb8() β€” three key triple DES in CFB mode with an 8-bit shift
  • EVP_des_ede3_cfb64() β€” three key triple DES in CFB mode with a 64-bit shift
  • EVP_des_ede3_ecb() β€” three key triple DES in ECB mode
  • EVP_des_ede3_ofb() β€” three key triple DES in OFB mode

EVP_des_ede3_cfb() is an alias for EVP_des_ede3_cfb64(), implemented as a macro. and EVP_des_ede3() is an alias for EVP_des_ede3_ecb(). the way that this family just keeps aliasing each other 😭 iconic. 🌈


🌟 DES-X, the dramatic one 🌟

  • EVP_desx_cbc() β€” provides the DES-X encryption algorithm in CBC mode. she uses a key length of 128 bits and acts on blocks of 128 bits. yes bestie, both 128. she's built different. πŸ”₯

πŸ‘‘ RETURN VALUES πŸ‘‘

every single one of these functions returns an EVP_CIPHER structure that provides the implementation of the symmetric cipher. that's it. that's the tea. no error codes hiding in the shadows. ⭐


🧚 SEE ALSO 🧚

go read those next, iykyk. πŸ¦‹


🌸 HISTORY 🌸

okay history lesson, gather round:

  • EVP_des_cbc(), EVP_des_cfb(), EVP_des_ecb(), EVP_des_ofb(), EVP_des_ede(), EVP_des_ede_cbc(), EVP_des_ede_cfb(), EVP_des_ede_ofb(), EVP_des_ede3(), EVP_des_ede3_cbc(), EVP_des_ede3_cfb(), and EVP_des_ede3_ofb() first appeared in SSLeay 0.5.1. ⭐
  • EVP_desx_cbc() first appeared in SSLeay 0.6.2.
  • all of those have been available since OpenBSD 2.4.

then later era:

  • EVP_des_ede_ecb() and EVP_des_ede3_ecb() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2. πŸ’œ

and the CFB girlies arrived last:

  • EVP_des_cfb1(), EVP_des_cfb8(), EVP_des_cfb64(), EVP_des_ede_cfb64(), EVP_des_ede3_cfb1(), EVP_des_ede3_cfb8(), and EVP_des_ede3_cfb64() first appeared in OpenSSL 0.9.7e and have been available since OpenBSD 3.8. πŸŽ€

πŸ“ and that's the whole page, bestie! this came from the Debian build of the manual, dated June 8, 2025, and it's the EVP_DES_CBC(3) page in the Library Functions Manual. go encrypt something (responsibly, and probably with something that isn't DES πŸ’€). mwah! πŸ’–βœ¨
πŸ“¦ where this page comes from