Skip to content

Decrypt/Encrypt Function #35777

Answered by veelasky
Kaesewuerfel asked this question in General
Discussion options

You must be logged in to vote

what do you mean by how?

if you refer to the usage (on how to use them), see documentation

use Illuminate\Support\Facades\Crypt;

// encrypt string to hash
Crypt::encryptString($string);

// decrypt encrypted to the original
Crypt::decryptString($encryptedValue);

But if you interested to on how it works, you can always go to the source code here.

TLDR; Laravel use openssl_encrypt() and openssl_decrypt() respectively to generate encrypted string, with the default cipher AES-128-CBC`

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kaesewuerfel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants