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