des_crypt(3) Library Functions Manual des_crypt(3) des_crypt, ecb_crypt, cbc_crypt, des_setparity, DES_FAILED - DES C (libc, -lc) #include [[deprecated]] int ecb_crypt(char *key, char data[.datalen], unsigned int datalen, unsigned int mode); [[deprecated]] int cbc_crypt(char *key, char data[.datalen], unsigned int datalen, unsigned int mode, char *ivec); [[deprecated]] void des_setparity(char *key); [[deprecated]] int DES_FAILED(int status); ecb_crypt() and cbc_crypt() implement the NBS DES (Data Encryption Standard). These routines are faster and more general purpose than crypt(3). They also are able to utilize DES hardware if it is available. ecb_crypt() encrypts in ECB (Electronic Code Book) mode, which encrypts blocks of data independently. cbc_crypt() encrypts in CBC (Cipher Block Chaining) mode, which chains together successive blocks. CBC mode protects against insertions, deletions, and substitutions of blocks. Also, regularities in the clear text will not appear in the cipher text. . , key, 8- . , DES , des_setparity. , data, . , datalen, data , 8. , mode, (OR) . DES_ENCRYPT, DES_DECRYPT. , DES_HW, DES_SW. DES_HW , , DESERR_NOHWDEVICE. cbc_crypt() ivec 8- . . DESERR_NONE . DESERR_NOHWDEVICE , , . DESERR_HWERROR . DESERR_BADPARAM . stat, DES_FAILED(stat) . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |ecb_crypt(), cbc_crypt(), | | MT-Safe | |des_setparity() | | | +----------------------------+----------------------------------------------------------+--------------------------+ None. 4.3BSD. glibc 2.1. Removed in glibc 2.28. Because they employ the DES block cipher, which is no longer considered secure, these functions were removed. Applications should switch to a modern cryptography library, such as libgcrypt. des(1), crypt(3), xcrypt(3) () Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 2 2024 . des_crypt(3)