Encriptação
Introdução
Laravel fornece facildade para uma forte encriptação AES por meio da extenção PHP Mcrypt
Uso Básico
Encriptando um Valor
$encrypted = Crypt::encrypt('secret');
Nota: Certifique-se de setar uma string radomica de 16, 24 , ou 32 caractéres na opção
keydo arquivo,config/app.php. Caso contrário, os valores encriptados não estarão seguros.
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.
Nota: Be sure to set a 16, 24, or 32 character random string in the
keyoption of theconfig/app.phpfile. Otherwise, encrypted values will not be secure.
Decriptando Valores
$decrypted = Crypt::decrypt($encryptedValue);
Setando O Modo e o Cipher
Você pode também setar o cipher e o modo usado pelo ecrypter:
Crypt::setMode('ctr');
Crypt::setCipher($cipher);