mirror of
https://github.com/the1024club/the1024.club.git
synced 2026-01-24 12:20:19 +00:00
fixed issues with base64 length limit.
This commit is contained in:
@@ -141,4 +141,4 @@ elseif ($operation === 'retrieve') {
|
||||
else {
|
||||
showUsage();
|
||||
}
|
||||
?>
|
||||
?>
|
||||
18
utils/verify_keys.php
Normal file
18
utils/verify_keys.php
Normal file
@@ -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