I have generated a unique custom key and need to encrypt a value using this key.Its return error
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
public function test(){
$key = $this->generateRandomKey();
$newEncrypter = new \Illuminate\Encryption\Encrypter( $key, Config::get('app.cipher') );
echo $encrypted = $newEncrypter->encrypt( 'hello' );
}
protected function generateRandomKey()
{
return 'base64:'.base64_encode(
Encrypter::generateKey(Config::get('app.cipher'))
);
}
php artisan config:clearcommand - Yavuz Koca