page_des(3)

πŸ“¦
version 7.8.0 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, epel 10, epel 9, fedora 43, fedora 44

✨ page_des β€” DES, the Data Encryption Standard crypto interface ✨

okay bestie, buckle up, we're talking about DES πŸ’– this is the Heimdal crypto library page for it, and yes it's giving "vintage but problematic." The library functions live over here: DES crypto functions.

DES was created by IBM, then modififed by the NSA (yeah, them πŸ™ˆ), and then adopted by NBS (which is now NIST) and published as FIPS PUB 46 β€” later updated by FIPS 46-1.

🚨 MAJOR PSA: since 19th May 2005, DES was withdrawn by NIST and should no longer be used. Like, at all. Periodt. πŸ’€ For replacement encryption algorithms and interfaces, go look at EVP - generic crypto interface instead, fr fr.

Wanna read the whole interesting history of DES? It's honestly iconic drama. Wikipedia's got you: http://www.wikipedia.org/wiki/Data_Encryption_Standard πŸ¦‹


πŸ”‘ DES key generation πŸ”‘

so to generate a DES key safely, you literally have to use the code-snippet below. why?? because DES_random_key() can fail with an abort() in case of a failure to start the random generator 😭 not the vibe.

There's a replacement function, DES_new_random_key(), BUT β€” plot twist β€” that function does not exist in OpenSSL. 🫠

DES_cblock key;
do {
    if (RAND_rand(&key, sizeof(key)) != 1)
         goto failure;
    DES_set_odd_parity(key);
} while (DES_is_weak_key(&key));

πŸ“œ DES implementation history πŸ“œ

okay story time πŸŽ€ There was no complete BSD licensed, fast, GPL compatible implementation of DES out there, so Love wrote the part that was missing β€” fast key schedule setup β€” and adapted the interface to the orignal libdes. slay πŸ’…

The document that got the whole thing started for real was 'Efficient Implementation of the Data Encryption Standard' by Dag Arne Osvik. The PC1 transformation never got to working πŸ™ˆ β€” instead, table-lookup was used for all key schedule setup. That document was super useful because it de-mystified other implementations for me. king behavior honestly πŸ‘‘

The core DES function (SBOX + P transformation) is from Richard Outerbridge's public domain DES implementation. My sanity is saved thanks to his work. Thank you Richard 🫢


Version 7.8.0 Β· Tue Nov 15 2022 Β· Heimdal crypto library Β· page_des(3) β€” and that's the whole page bestie, ty for coming to my TED talk, stay encrypted and stay away from DES πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from