Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 808 Bytes

encryption.md

File metadata and controls

30 lines (18 loc) · 808 Bytes

Encryption

Contents

The Basics

Need to do secure, two-way encryption? Laravel has you covered with the Crypter class. By default, the Crypter class provides strong AES-256 encryption and decryption out of the box via the Mcrypt PHP extension.

Note: Don't forget to install the Mcrypt PHP extension on your server.

Encrypting A String

Encrypting a given string:

$encrypted = Crypter::encrypt($value);

Decrypting A String

Decrypting a string:

$decrypted = Crypter::decrypt($encrypted);

Note: The decrypt method will only decrypt strings that were encrypted using your application key.