__call()
__callstatic()
__construct()
_init()
forge()
instance()
calculate_mac()
decode()
encode()
hkdfBlake2b()
legacy_decode()
memzero()
raw_keyed_hash()
safe_b64decode()
safe_b64encode()
secure_compare()
split_keys()
split_message()
validate_hmac()
verify_mac()
$_instances
$config
$crypter
$defaults
$hasher
Sodium encryption/decryption code based on HaLite from ParagonIE
Copyright (c) 2016 - 2018 Paragon Initiative Enterprises. Copyright (c) 2014 Steve "Sc00bz" Thomas (steve at tobtu dot com)
__call(mixed $method, array $args) : mixed
mixed
array
The arguments will passed to $method.
\ErrorException |
---|
mixed
return value of $method.__callstatic(mixed $method, array $args) : mixed
mixed
array
The arguments will passed to $method.
mixed
return value of $method.__construct(array $config)
array
_init()
forge(string $name, array $config) : \Crypt
create a new named instance
string
instance name
array
optional runtime configuration
\Crypt
instance(string $name) : mixed
string
instance name
mixed
Crypt if the instance exists, false if notcalculate_mac(string $message, $auth_key) : string
This is used internally.
string
string
decode(string $value, string | bool $key, void $keylength) : string
access | public |
---|
string
value to decrypt
string
bool
optional custom key to be used for this encryption
void
no longer used
string
encrypted valueencode(string $value, string | bool $key, void $keylength) : string
string
value to encrypt
string
bool
optional custom key to be used for this encryption
void
no longer used
string
encrypted valuehkdfBlake2b(string $ikm, int $length, string $info, string $salt) : string
http://tools.ietf.org/html/rfc5869
This is a variant from hash_hkdf() and instead uses BLAKE2b provided by libsodium.
Important: instead of a true HKDF (from HMAC) construct, this uses the crypto_generichash() key parameter. This is probably okay.
string
Initial Keying Material
int
How many bytes?
string
What sort of key are we deriving?
string
string
legacy_decode(string $value, string | bool $key, int | bool $keylength) : string
access | public |
---|
string
value to decrypt
string
bool
optional custom key to be used for this encryption
int
bool
optional key length
string
encrypted valuememzero(string | null $var) : void
You need the native library for that.
string
null
raw_keyed_hash(string $input, string $key, int $length) : string
Expects a key (binary string). Returns raw binary.
string
string
int
string
safe_b64decode(string $value) : string
string
string
safe_b64encode(string $value) : string
string
string
secure_compare(string $a, string $b) : bool
string
string
bool
split_keys(string $key, string $salt) : string[]
string
string
string[]
validate_hmac($value)
verify_mac(string $mac, string $message, $auth_key) : bool
string
Message Authentication Code
string
The message to verify
bool
$_instances : array
$config : array
$crypter : object
$defaults : array
$hasher : object