mirror of
https://github.com/the1024club/the1024.club.git
synced 2026-01-24 04:20:17 +00:00
First code commit.
This commit is contained in:
14
utils/generate_keys.php
Normal file
14
utils/generate_keys.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
// Generate a keypair
|
||||
$keypair = sodium_crypto_sign_keypair();
|
||||
|
||||
// Extract the public and private keys
|
||||
$publicKey = sodium_crypto_sign_publickey($keypair);
|
||||
$privateKey = sodium_crypto_sign_secretkey($keypair);
|
||||
|
||||
// Encode keys to base64 for easy use
|
||||
echo "Public Key: " . base64_encode($publicKey) . PHP_EOL;
|
||||
echo "Private Key: " . base64_encode($privateKey) . PHP_EOL;
|
||||
?>
|
||||
Reference in New Issue
Block a user