crypt

string crypt(string string, [string salt]) 

Encrypts a string.

Returns:

Encrypted string; FALSE on error

Description:

crypt() encrypts a string using the crypt function from the operating system’s C library.

The function accepts two arguments: the string to encrypt, and the salt to use during encryption. A salt is a string of characters used to increase the number of encrypted strings that can be generated for a given string with a given encryption method. Salts help increase the effort needed to “crack” encrypted data.

The function can encrypt strings using DES, Blowfish, and MD5 algorithms. Not all operating systems support some (or even any) of these algorithms. The exact algorithm depends on the format and length of salt passed to ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.