Skip to content
This repository has been archived by the owner on Apr 11, 2019. It is now read-only.

Latest commit

 

History

History
30 lines (17 loc) · 701 Bytes

encryption.md

File metadata and controls

30 lines (17 loc) · 701 Bytes

Encryption

Introduction

Laravel provides facilities for strong AES encryption via the Mcrypt PHP extension.

Basic Usage

Encrypting A Value

$encrypted = Crypt::encrypt('secret');

Note: Be sure to set a 16, 24, or 32 character random string in the key option of the config/app.php file. Otherwise, encrypted values will not be secure.

Decrypting A Value

$decrypted = Crypt::decrypt($encryptedValue);

Setting The Cipher & Mode

You may also set the cipher and mode used by the encrypter:

Crypt::setMode('ctr');

Crypt::setCipher($cipher);