Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 682 Bytes

encryption.md

File metadata and controls

30 lines (17 loc) · 682 Bytes

Encryption

Introduction

Lumen 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 32 character random string in the APP_KEY option of the .env 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);