PHP string crypt() FunctionLast Updated : 17 Mar 2025 The crypt() is predefined PHP string function. It is used to returns a hashed string by using DES, Blowfish, or MD5 algorithms. Following are some constants of crypt() function
Syntax:
Note: This crypt() function works with different operating System.Example 1Output: Standard DES: jtigeEQ4GnSRg \ Example 2Output: Extended DES: _S4..javac7kJCJPxtp6 Example 3Output: MD5: $1$javatpoi$/QyBQ/V7dJjcGaOq83EhL0 Note: 16 character salt starting with $5$ and the default number of rounds is 5000.Example 4Output: Blowfish: $2a$09$anexamplestringforsale8idRk7z/D1GAsmHMUTi1L/e7Cjcngiy Example 5Output: SHA-256: $5$rounds=5000$anexamplestringf$cdf4KmhoNRhj0riAq6kpiYdPHGWOBEnPxtPxje3Fjm2 Example 6Output: SHA-512: $6$rounds=5000$anexamplestringf$Oo0skOAdUFXkQxJpwzO05wgRHG0dhuaPBaOU/oNbGpCEKlf/7oVM5wn6AN0w2vwUgA0O24oLzGQpp1XKI6LLQ0 Example 7Output: SHA-512: $6$rounds=5000$anexamplestringf$Oo0skOAdUFXkQxJpwzO05wgRHG0dhuaPBaOU/oNbGpCEKlf/7oVM5wn6AN0w2vwUgA0O24oLzGQpp1XKI6LLQ0 Next TopicPHP String |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India