Skip to content

Kirby 5.0.4

$symmetricCrypto->decrypt()

Decrypts JSON data encrypted by SymmetricCrypto::encrypt() using the secret key or password

$symmetricCrypto->decrypt(string $json): string

Parameters

Name Type Default
$jsonrequired string no default value

Return type

string

This method modifies the existing $symmetriccrypto object it is applied to and returns it again.

Parent class

Kirby\Toolkit\SymmetricCrypto

Examples

// decryption with a password
$crypto    = new SymmetricCrypto(password: 'super secure');
$plaintext = $crypto->decrypt('a very confidential string');