e01.org

Crypt (C)

crypt is a POSIX C library function. It is typically used to compute the hash of user account passwords. The function outputs a text string which also encodes the salt (usually the first two characters are the salt itself and the rest is the hashed result), and identifies the hash algorithm used (defaulting to the "traditional" one explained below). This output string forms a password record, which is usually stored in a text file. More formally, crypt provides cryptographic key derivation functions for password validation and storage on Unix systems.

crypt is a POSIX C library function. It is typically used to compute the hash of user account passwords. The function outputs a text string which also encodes the salt (usually the first two characters are the salt itself and the rest is the hashed result), and identifies the hash algorithm used (defaulting to the "traditional" one explained below). This output string forms a password record, which is usually stored in a text file. More formally, crypt provides cryptographic key derivation functions for password validation and storage on Unix systems. $ [$ = (, = )*][$ [$ where id : an identifier representing the hashing algorithm (such as 1 for MD5, 5 for SHA-256 etc.) param name and its value : hash complexity parameters, like rounds/iterations count salt : salt following the radix-64 alphabet (DES uses the decoded value) hash : radix-64 encoded result of hashing the password and salt The radix-64 encoding in crypt is called B64 and uses the alphabet ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz which is different than the more common RFC 4648 base64 The PHC subset covers a majority of MCF hashes. A number of extra application-defined methods exist. Source code for crypt(3) from Seventh Edition Unix (implements proposed DES) Sample password hash encoding strings .NET crypt implementation cs:Crypt (Unix)

References

  1. ^ "crypt – password encoding" . UNIX Third Edition Programmers' Manual . 1973-01-15. Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  2. ^ "crypt, setkey, encrypt – DES encryption" . UNIX Seventh Edition Programmers' Manual . 1979. Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  3. ^ "Md5crypt Password scrambler is no longer considered safe by author — PHKs Bikeshed" . Phk.freebsd.dk . Archived from the original on 17 March 2018 . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  4. ^ Provos, Niels; Mazières, David (1999). "A Future-Adaptable Password Scheme" . Proceedings of 1999 USENIX Annual Technical Conference : 81– 92. Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  5. ^ Designer, Solar (2011-06-21). "crypt_blowfish 1.1; Owl glibc security update" . See also CVE - 2011-2483 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  6. ^ "src/lib/libc/crypt/bcrypt.c – view – 1.27" . Cvsweb.openbsd.org . Retrieved 2016-05-14 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1463180400.0
  7. ^ Designer, Solar (2012-01-02). "OpenBSD bcrypt 8-bit key_len wraparound" . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  8. ^ "NT MD4 password hash as new password encryption method for FreeBSD" . Mail-archive.com . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  9. ^ Simson Garfinkel, Alan Schwartz, Gene Spafford. "Practical Unix & Internet Security" . 2003. section "4.3.2.3 crypt16( ), DES Extended, and Modular Crypt Format" . "The Modular Crypt Format (MCF) specifies an extensible scheme for formatting encrypted passwords. MCF is one of the most popular formats for encrypted passwords" Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  10. ^ "The NTLM Authentication Protocol and Security Support Provider" . Davenport.sourceforge.net . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  11. ^ Sun Microsystems. "crypt_sunmd5(5) man page" . Archived from the original on 2008-04-16 . Retrieved 2008-03-05 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1204671600.0
  12. ^ Muffett, Alec (2005-12-05). "OpenSolaris, Pluggable Crypt, and the SunMD5 Password Hash Algorithm" . Retrieved 2012-08-11 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1344639600.0
  13. ^ "FESCo Says "Yes" To Fedora 35 Using Yescrypt For Hashing Shadow Passwords - Phoronix" . www.phoronix.com . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  14. ^ "Changes/yescrypt as default hashing method for shadow - Fedora Project Wiki" . libxcrypt: Is already capable for computing yescrypt hashes since v4.3 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  15. ^ crypt(5) – Linux File Formats Manual from ManKier.com – libxcrypt implementation Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  16. ^ "passlib.hash.bigcrypt - BigCrypt — Passlib v1.7.1 Documentation" . Pythonhosted.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  17. ^ "passlib.hash.crypt16 - Crypt16 — Passlib v1.7.1 Documentation" . Pythonhosted.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  18. ^ libxcrypt - Extended crypt library for descrypt, md5crypt, bcrypt, and others Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  19. ^ "bcrypt support for passwords in /etc/shadow - Red Hat Customer Portal" . Access.redhat.com . 10 July 2018 . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  20. ^ "bcrypt password hashing ("password encryption") for your software and your servers" . www.openwall.com . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  21. ^ "Changes/Replace glibc libcrypt with libxcrypt - Fedora Project Wiki" . fedoraproject.org . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  22. ^ "crypt_r.c\crypt\src - musl - musl - an implementation of the standard library for Linux-based systems" . git.musl-libc.org . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  23. ^ "How Mac OS X Implements Password Authentication" . Dribin.org . 7 April 2006 . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  24. ^ "How to crack Mac OS X Passwords - Online Hash Crack" . Onlinehashcrack.com . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  25. ^ "ademarre/binary-mcf" . GitHub.com . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  26. ^ "crypt - perldoc.perl.org" . Perldoc.perl.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  27. ^ "PHP: crypt - Manual" . Us.php.net . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  28. ^ "crypt()" . Archived from the original on 2012-10-02 . Retrieved 2013-02-09 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1360364400.0
  29. ^ "crypt — Function to check Unix passwords — Python 3.7.1 documentation" . Docs.python.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  30. ^ "Class: String (Ruby 2.5.3)" . Ruby-doc.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  31. ^ a b c d "Modular Crypt Format — Passlib v1.7.1 Documentation" . Pythonhosted.org . Retrieved 2 December 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  32. ^ "Debian manpage crypt" . manpages.debian.org . Retrieved 11 Jan 2022 . – Debian bullseye uses libxcrypt. See https://tracker.debian.org/pkg/libxcrypt . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  33. ^ a b crypt(3) – FreeBSD Library Functions Manual Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  34. ^ a b Morris, Robert; Thompson, Ken (1978-04-03). "Password Security: A Case History" . Bell Laboratories . Retrieved 2013-12-17 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1387234800.0
  35. ^ Password Hash Competition. "PHC string format" . Github . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  36. ^ a b Drepper, Ulrich (19 September 2007). "Unix crypt with SHA-256/512" . Retrieved 21 November 2018 . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
  37. ^ a b Drepper, Ulrich. "Unix crypt using SHA-256 and SHA-512" . Wikipedia revision 1358387232, retrieved 2026-11-18 · 1794956400.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Crypt (C)". 1780908853. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1358387232

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy