Created
October 5, 2017 06:06
-
-
Save soatok/282f0fcea5c3e5940349b5ededb9e702 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
<?php | |
declare(strict_types=1); | |
$password = 'OwO what\'s this?'; | |
$alg = SODIUM_CRYPTO_PWHASH_ALG_DEFAULT; | |
$opslimit = SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE; | |
$memlimit = SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE; | |
$salt = 'YIFFYIFFYIFFYIFF'; | |
$secret_key = sodium_crypto_pwhash(32, $password, $salt, $opslimit, $memlimit, $alg); | |
$ciphertext = base64_decode("azSM4RHZt2mUQK/7erNxIrUsBLn5em6cK1gelBV9W9TKRqwZdETlNFiuDhzK6cI00S05LmhpCQyoqIZF9EErIHVnsP5na/Fr"); | |
$nonce = 'YIFFYIFFYIFFYIFFYIFFYIFF'; | |
$plaintext = sodium_crypto_secretbox_open($ciphertext, $nonce, $secret_key); | |
echo $plaintext, PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment