EVP_SHA1(3)

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

πŸ’… EVP_SHA1(3) β€” bestie, these are the legacy digest girlies

okay so this page lives in section 3 of the manual, and it's all about the legacy message digest algorithms β€” the ones from the libcrypto library (yes, that libcrypto, the OpenSSL-ish one). these are the OGs, the elders, the ones your crypto professor warns you about. 🫢


✨ NAME ✨

EVP_sha1, EVP_md5, EVP_md5_sha1, EVP_md4 β€” legacy message digest algorithms


🌸 SYNOPSIS 🌸

#include <openssl/evp.h>

const EVP_MD *
EVP_sha1(void);

const EVP_MD *
EVP_md5(void);

const EVP_MD *
EVP_md5_sha1(void);

const EVP_MD *
EVP_md4(void);
lowkey the library β€œlibcrypto” bit is part of how you link it, so don't come for me β€” it's in the synopsis block above, exactly where it belongs. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so real talk first, because this is the important part: the following message digest algorithms are cryptographically broken. Like, all of them. every single one. None of them should be used in new code unless there is no way around it. that's not me being dramatic, that's just the truth β€” no cap.

now let's meet the cast πŸŽ€

  • EVP_sha1() β€” implements the SHA-1 algorithm and produces 160 bits of output from a given input. still hanging around in places where there's literally no escape, and examples of protocols and software that still require it include OCSP, DNS, and the git version control system. (yes, git. she's iconic, she's also built on a broken hash, we don't talk about it πŸ’€)
  • EVP_md5() β€” implements the MD5 algorithm and produces 128 bits of output from a given input. she's still occasionally used when no security is required but a fast hash algorithm is beneficial. so like, checksums. vibes. nothing load-bearing. πŸ™ˆ
  • EVP_md5_sha1() β€” produces concatenated MD5 and SHA-1 message digests. Do not use this except where it is required for the historic SSLv3 protocol. that's it. that's the only excuse. it's giving museum exhibit πŸ”₯
  • EVP_md4() β€” implements the MD4 algorithm and produces 128 bits of output from a given input. it has been marked as β€œhistoric” by the Internet Engineering Task Force since 2011. the IETF put her in a glass case and everything ⭐

πŸ‘‘ RETURN VALUES πŸ‘‘

these functions return pointers to static EVP_MD objects implementing the hash functions. so like, they hand you a shiny little object describing the digest, and you go do your EVP_DigestInit thing with it. 🫢


πŸ”₯ SEE ALSO πŸ”₯


πŸ’œ STANDARDS πŸ’œ

the receipts, in order, bestie πŸ“š:

  • T. Polk, L. Chen, S. Turner, and P. Hoffman, Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms, RFC 6194, March 2011.
  • S. Turner and L. Chen, Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms, RFC 6151, March 2011.
  • S. Turner and L. Chen, MD4 to Historic Status, RFC 6150, March 2011.
  • P. Kocher, P. Karlton, and A. Freier, The Secure Sockets Layer (SSL) Protocol Version 3.0, RFC 6101, August 2011.

🧚 HISTORY 🧚

the lore ✨:

  • EVP_sha1() and EVP_md5() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4.
  • EVP_md4() first appeared in OpenSSL 0.9.6 and has been available since OpenBSD 2.9.
  • EVP_md5_sha1() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.3.

and that's the page, bestie πŸ’– sign-off time: this one's from the Debian build of the manual, dated June 8, 2025 β€” so go use a modern hash, drink some water, and slay πŸŒˆπŸŽ€

πŸ“¦ where this page comes from