SodiumCipher

Implements \Joomla\CMS\Crypt\CipherInterface

JCrypt cipher for sodium algorithm encryption, decryption and key generation.

since

3.8.0

Methods

decrypt

Method to decrypt a data string.

decrypt(string $data, \Joomla\CMS\Crypt\Key $key) : string
since

3.8.0

throws

\RuntimeException

Arguments

$data

stringThe encrypted string to decrypt.

$key

\Joomla\CMS\Crypt\KeyThe key object to use for decryption.

Response

stringThe decrypted data string.

encrypt

Method to encrypt a data string.

encrypt(string $data, \Joomla\CMS\Crypt\Key $key) : string
since

3.8.0

throws

\RuntimeException

Arguments

$data

stringThe data string to encrypt.

$key

\Joomla\CMS\Crypt\KeyThe key object to use for encryption.

Response

stringThe encrypted data string.

generateKey

Method to generate a new encryption key object.

generateKey(array $options = array()) : \Joomla\CMS\Crypt\Key
since

3.8.0

throws

\Joomla\CMS\Crypt\Cipher\RuntimeException

Arguments

$options

arrayKey generation options.

Response

\Joomla\CMS\Crypt\Key

setNonce

Set the nonce to use for encrypting/decrypting messages

setNonce(string $nonce) : void
since

3.8.0

Arguments

$nonce

stringThe message nonce

Properties

nonce

The message nonce to be used with encryption/decryption

since

3.8.0

Type(s)

string