Encryption
Encryption
Configuration
Before using Laravel's encrypter, you should set the key
option of your config/app.php
configuration file to a 32 character, random string. If this value is not properly set, all values encrypted by Laravel will be insecure.
Basic Usage
Encrypting A Value
You may encrypt a value using the Crypt
facade. All encrypted values are encrypted using OpenSSL and the AES-256-CBC
cipher. Furthermore, all encrypted values are signed with a message authentication code (MAC) to detect any modifications to the encrypted string.
For example, we may use the encrypt
method to encrypt a secret and store it on an 登录查看完整内容