CryptoSecret
class CryptoSecret
libsodium wrapper class for secret-key authenticated crypto
Methods
Returns the length of a key for use with this class
Returns the length of a nonce for use with this class
Returns the size overhead of an encrypted string over a plaintext one
Generates a crypto key for use with this class
Generates a crypto nonce for use with this class
Encrypts the given data
Decrypts the given data
Details
at line 43
static int
KeyLength()
Returns the length of a key for use with this class
at line 46
static int
NonceLength()
Returns the length of a nonce for use with this class
at line 53
static int
OutputOverhead()
Returns the size overhead of an encrypted string over a plaintext one
The size overhead exists because the crypto is authenticated
at line 56
static string
GenerateKey()
Generates a crypto key for use with this class
at line 59
static string
GenerateNonce()
Generates a crypto nonce for use with this class
at line 70
static string
Encrypt(string $data, string $nonce, string $key, string $extra = null)
Encrypts the given data
at line 87
static string
Decrypt(string $data, string $nonce, string $key, string $extra = null)
Decrypts the given data