Laravel 9
Encrypt .env file.
$ openssl enc -aes-256-cbc -k secret -P -pbkdf2
salt=624CB53000707D6E
key=4437EC17F5A69A300142CFE19B1141E9A8F67FF6567459E931A288142F27383F
iv =AE9AF6682A906489384220A1F6092150
$ ./artisan env:encrypt --key=AE9AF6682A906489384220A1F6092150 --cipher=aes-256-cbc
INFO Environment successfully encrypted.
Key ............................................................................................................. AE9AF6682A906489384220A1F6092150
Cipher ............................................................................................................................... aes-256-cbc
Encrypted file .................................................................................................................... .env.encrypted