3v4l.org

run code in 300+ PHP versions simultaneously
<?php $keypair = sodium_crypto_box_keypair(); $sk = sodium_crypto_box_secretkey($keypair); $pk = sodium_crypto_box_publickey($keypair); var_dump([ 'secret key' => bin2hex($sk), 'public key' => bin2hex($pk) ]); $pk_from_sk = sodium_crypto_scalarmult_base($sk); var_dump([ 'public key from secret key' => bin2hex($pk_from_sk) ]);

preferences:
83.82 ms | 405 KiB | 5 Q