06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Encryption<br />

• Configuration<br />

• Basic Usage<br />

Configuration<br />

Before using Laravel’s encrypter, you should set the key option of your config/app.php configuration<br />

file to a 32 character, random string. If this value is not properly set, all values encrypted by<br />

Laravel will be insecure.<br />

Basic Usage<br />

Encrypting A Value<br />

You may encrypt a value using the Crypt facade. All encrypted values are encrypted using<br />

OpenSSL and the AES-256-CBC cipher. Furthermore, all encrypted values are signed with a message<br />

authentication code (MAC) to detect any modifications to the encrypted string.<br />

For example, we may use the encrypt method to encrypt a secret and store it on an Eloquent model:<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!