mirror of
https://github.com/the1024club/the1024.club.git
synced 2026-11-07 22:45:39 +00:00
fixed issues with base64 length limit.
This commit is contained in:
1 parent
f8f07abc2c
commit
32fd5afc65
6 files changed
+312
-243
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
// Load Sodium extension
|
||||
require __DIR__ . '/../vendor/autoload.php'; // Adjust the path to the autoload file
|
||||
|
||||
// Base64 decode the public and private keys
|
||||
$publicKey = base64_decode('0HCO9Tm3JvvbK+J93PStb4/23HSxEZS9WUrWSjmLIz4=');
|
||||
$privateKey = base64_decode('s1cAUQfbxa6Q8lJxn90N6aKER17Ng9tD/gHpX+8x6drQcI71Obcm+9sr4n3c9K1vj/bcdLERlL1ZStZKOYsjPg==');
|
||||
|
||||
// Derive the public key from the private key to check if they match
|
||||
$derivedPublicKey = sodium_crypto_sign_publickey_from_secretkey($privateKey);
|
||||
|
||||
// Compare the derived public key with the provided public key
|
||||
if (hash_equals($publicKey, $derivedPublicKey)) {
|
||||
echo "The public and private key pair match!" . PHP_EOL;
|
||||
} else {
|
||||
echo "The public and private key pair do NOT match!" . PHP_EOL;
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user