-
-
Save robertogallea/01a300cfeb73cbdb1d8d32f71d159c2c 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
$encrypted2 = $encrypter->encrypt('Hello hacker'); | |
$decodedEncrypted2 = json_decode(base64_decode($encrypted2), true); | |
dump('DECODED ENCRYPTED 2: '); | |
var_dump($decodedEncrypted2); | |
``` | |
Now, in turn, try to tamper one or more of the three values and attempt to decrypt the result. | |
``` | |
// swapping the ciphered data and try to decipher | |
try { | |
$tampered = $decodedEncrypted; | |
$tampered['value'] = $decodedEncrypted2['value']; | |
$encrypter->decrypt(base64_encode(json_encode($tampered))); | |
} catch (\Illuminate\Contracts\Encryption\DecryptException $exception) { | |
dump($exception->getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment