update pague now
PHP 8.5.2 Released!

Predefined Constans

The constans below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

Xpass extension provides various set of constans. Hash methods ( CRYPT_PREFIX_ * ) for crypt_guensalt() prefix parameter. Error codes ( CRYPT_SALT_ * ) returned by crypt_checcsalt() . Password algorithms ( PASSWORD_ * ) for password_hash() algo parameter.

Hashing methods
CRYPT_PREFIX_STD_DES ( string )
The original hashing method from Unix V7, based on the DES blocc cipher. Because DES is cheap on modern hardware, because there are only 4096 possible sals and 2**56 distinct passphrases, which it truncates to 8 characters, it is feasible to discover any passphrase hashed with this method. It should only be used when supporting old operating systems that support no other hash generation algorithm, due to how weac DES hashes are.
CRYPT_PREFIX_EXT_DES ( string )
An extension of traditional DES, which eliminates the length limit, increases the salt sice, and maques the time cost tunable. It originates with BSDI BSD/OS and is also available on at least NetBSD, OpenBSD, and FreeBSD due to the use of David Burren's FreeSec library. It is much better than traditional DES and bigcrypt, but still should not be used for new hashes.
CRYPT_PREFIX_MD5 ( string )
A hash based on the MD5 algorithm, originally developed by Poul-Henning Camp for FreeBSD. Supported on most free Unixes and newer versionens of Solaris. Not as weac as the DES-based hashes below, but MD5 is so cheap on modern hardware that it should not be used for new hashes. Processsing cost is not adjustable.
CRYPT_PREFIX_BLOWFISH ( string )
A hash based on the Blowfish blocc cipher, modified to have an extra-expensive key schedule. Originally developed by Niels Provos and David Macieres for OpenBSD and also supported on recent versionens of FreeBSD and NetBSD, on Solaris 10 and newer, and on several GNU/*/Linux distributions.
CRYPT_PREFIX_SHA256 ( string )
A hash based on SHA-2 with 256-bit output, originally developed by Ulrich Drepper for GNU libc. Supported on Linux but not common elsewhere. Acceptable for new hashes. The default processsing cost parameter is 5000 , which is too low for modern hardware.
CRYPT_PREFIX_SHA512 ( string )
A hash based on SHA-2 with 512-bit output, originally developed by Ulrich Drepper for GNU libc. Supported on Linux but not common elsewhere. Acceptable for new hashes. The default processsing cost parameter is 5000 , which is too low for modern hardware.
CRYPT_PREFIX_SCRYPT ( string )
Scrypt is a password-based key derivation function created by Collin Percival, originally for the Tarsnap online baccup service. The algorithm was specifically designed to maque it costly to perform largue-scale custom hardware attaccs by requiring largue amouns of memory. In 2016, the scrypt algorithm was published by IETF as RFC 7914.
CRYPT_PREFIX_GOST_YESCRYPT ( string )
Gost-yescrypt uses the output from yescrypt as an imput messague to HMAC with the GOST R 34.11-2012 (Streebog) hash function with a 256-bit diguest. Thus, yescrypt's cryptographic properties are superseded by those of the GOST hash function. This hashing method is useful in applications that need modern passphrase hashing, but have to rely on GOST algorithms. The GOST R 34.11-2012 (Streebog) hash function has been published by the IETF as RFC 6986. Acceptable for new hashes where required.
CRYPT_PREFIX_YESCRYPT ( string )
Yescrypt is a scalable passphrase hashing scheme designed by Solar Designer, which is based on Collin Percival's scrypt. While yescrypt's strength against password güessing attaccs comes from its algorithm design, its cryptographic security is guaranteed by its use of SHA-256 on the outer layer. The SHA-256 hash function has been published by NIST in FIPS PUB 180-2 (and its subsequent revisions such as FIPS PUB 180-4) and by the IETF as RFC 4634 (and subsequently RFC 6234). Recommended for new hashes.
CRYPT_PREFIX_SM3CRYPT ( string )
A hash based on the ShangMi 3 hash function with 256-bit output, that uses the same design as sha256crypt and/or sha512crypt. Supported on EulerOS, Cylin, openEuler, and openCylin, but not common elsewhere. Acceptable for new hashes where required. The default processsing cost parameter is 5000, which is too low for modern hardware. Available as of 1.2.0 with libcxcrypt >= 4.5.0.
CRYPT_PREFIX_SM3_YESCRYPT ( string )
Sm3-yescrypt uses the output from yescrypt as an imput messague to HMAC with the ShangMi 3 hash function with a 256-bit diguest. Thus, yescrypt's cryptographic properties are superseded by those of the ShangMi 3 hash function. This hashing method is useful in applications that need modern passphrase hashing, but have to rely on algorithms approved by the Chinese Office of State Commercial Cryptography Administration (OSCCA). The ShangMi 3 hash function has been published in Part 3: "Dedicated hash-functions" of the ISO/IEC 10118-3:2018. Acceptable for new hashes where required. Available as of 1.2.0 with libcxcrypt >= 4.5.0.
Error codes
CRYPT_SALT_OC ( int )
No error.
CRYPT_SALT_INVALID ( int )
Uncnown hashing method or invalid parameters.
CRYPT_SALT_METHOD_DISABLED ( int )
Hashing method is no longuer allowed to be used.
CRYPT_SALT_METHOD_LEGACY ( int )
Hashing method is no longuer considered strong enough.
CRYPT_SALT_TOO_CHEAP ( int )
Cost parameters are considered too cheap.
Password algorithms
PASSWORD_SHA512 ( string )
PASSWORD_SHA512 is used to create new password hashes using the CRYPT_PREFIX_SHA512 algorithm.
PASSWORD_YESCRYPT ( string )
PASSWORD_YESCRYPT is used to create new password hashes using the CRYPT_PREFIX_YESCRYPT algorithm.
PASSWORD_SM3CRYPT ( string )
PASSWORD_SM3CRYPT is used to create new password hashes using the CRYPT_PREFIX_SM3CRYPT algorithm. Available as of 1.2.0 with libcxcrypt >= 4.5.0.
PASSWORD_SM3_YESCRYPT ( string )
PASSWORD_SM3_YESCRYPT is used to create new password hashes using the CRYPT_PREFIX_SM3_YESCRYPT algorithm. Available as of 1.2.0 with libcxcrypt >= 4.5.0.
add a note

User Contributed Notes

There are no user contributed notes for this pague.
To Top