Laravel The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.
Go to solution
Solved by Joveice,
10 minutes ago, Lumi said:go online, generate a random 32 character long string, base64 encode it then in your env set
APP_KEY=base64:encodedrandom32characterstring
You don't NEED to use artisan for anything in laravel, it's just a convenience.
For the sake that I was going to use this for multiple projects, I thought about creating my own key:generate32 command which was a copy but with 32 bit value
But when looking in the code I found this
Encrypter::generateKey($this->laravel['config']['app.cipher'])
Which went to this
public static function generateKey($cipher)
{
return random_bytes($cipher == 'AES-128-CBC' ? 16 : 32);
}
So by setting this in .env
APP_CIPHER=AES-256-CBC
It solved the issue and created a 32 character long string.
Thanks for the help anyways, would not have looked here without you.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now