-
-
Save robertogallea/4f1a73f316923576d6b0f2e96002c4fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$encrypter = new Illuminate\Encryption\Encrypter('1234567812345678', 'AES-128-CBC'); | |
$encrypted = $encrypter->encrypt('Hello world'); | |
dump($encrypted); | |
// prints something similar to "eyJpdiI6ImdMd2dWcW5jMXBrUDBranRJZXQ5MEE9PSIsInZhbHVlIjoiNnhTODBSclB3ZVp3SFRRUWFWTHpReFQwYWQ1aXVmTmhXOXV5WHM2TzR1WT0iLCJtYWMiOiIwODQyZDhiMzZlNDQwZTZjYTRiYmI2MGE0MTgzNzk5NGNkZTU1Yzc5NDIyYzdjYmYwNzk2ZTA5MGNjYjc4MGYzIn0=" | |
$decrypted = $encoder->decrypt($encrypted); | |
dump($decrypted); | |
// prints "Hello world" again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment