Skip to content

Kirby 5.0.4

$symmetricCrypto->encrypt()

Encrypts a string using the secret key or password

$symmetricCrypto->encrypt(string $string): string

Parameters

Name Type Default
$stringrequired 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

// encryption with a password
$crypto     = new SymmetricCrypto(password: 'super secure');
$ciphertext = $crypto->encrypt('a very confidential string');