$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
Examples
// decryption with a password
$crypto = new SymmetricCrypto(password: 'super secure');
$plaintext = $crypto->decrypt('a very confidential string');