extends |
Hm_Crypt_Base |
|---|
Encryption with the libsodium extension
This extends our standard encryption and will override it if libsodium is present. Checking a password and converting cipher text to clear text fall back to the standard Hm_Crypt library if they fail. This is to ensure backwards compatibility.
| Methods | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
public
static
|
plaintext(string $string, string $key): string|false
Convert ciphertext to plaintext
Convert ciphertext to plaintext Parameters
Returnsdecrypted text Overrides |
# | ||||||||||
public
static
|
ciphertext(string $string, string $key): string
Convert plaintext into ciphertext
Convert plaintext into ciphertext Parameters
Returnsencrypted text Overrides |
# | ||||||||||
public
static
|
hash_password(string $password, $salt = false, $count = false, $algo = 'sha512', $type = 'php'): string
Hash a password using libsodium. Args not defined here are for backwards
compat usage with our built in crypto
Hash a password using libsodium. Args not defined here are for backwards compat usage with our built in crypto Parameters
Overrides |
# | ||||||||||
public
static
|
check_password(string $password, string $hash): bool
Check a password against it's stored hash using libsodium. If that
fails, try our built in crypto otherwise updating to…
Check a password against it's stored hash using libsodium. If that fails, try our built in crypto otherwise updating to libsodium breaks everything Parameters
Overrides |
# | ||||||||||
protected
static
|
keygen(string $key, string $salt = false): string[]
stretch (or shrink) a key for libsodium
stretch (or shrink) a key for libsodium Parameters
Overrides |
# | ||||||||||
| Methods inherited from Hm_Crypt_Base |
|---|
check_hmac(), generate_salt(), hash_compare(), pbkdf2(), unique_id(), random() |
| Properties inherited from Hm_Crypt_Base |
|---|
$method, $hmac, $password_rounds, $encryption_rounds, $hmac_rounds |