Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
php-7.4.33 /
ext /
sodium /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
bug78114.phpt
355
B
-rw-rw-r--
2022-10-31 11:36
bug78516.phpt
725
B
-rw-rw-r--
2022-10-31 11:36
crypto_aead.phpt
4.23
KB
-rw-rw-r--
2022-10-31 11:36
crypto_auth.phpt
1.09
KB
-rw-rw-r--
2022-10-31 11:36
crypto_box.phpt
5.09
KB
-rw-rw-r--
2022-10-31 11:36
crypto_generichash.phpt
2.7
KB
-rw-rw-r--
2022-10-31 11:36
crypto_hex.phpt
426
B
-rw-rw-r--
2022-10-31 11:36
crypto_kdf.phpt
1.48
KB
-rw-rw-r--
2022-10-31 11:36
crypto_kx.phpt
1.58
KB
-rw-rw-r--
2022-10-31 11:36
crypto_scalarmult.phpt
582
B
-rw-rw-r--
2022-10-31 11:36
crypto_secretbox.phpt
606
B
-rw-rw-r--
2022-10-31 11:36
crypto_secretstream.phpt
1.98
KB
-rw-rw-r--
2022-10-31 11:36
crypto_shorthash.phpt
586
B
-rw-rw-r--
2022-10-31 11:36
crypto_sign.phpt
2.88
KB
-rw-rw-r--
2022-10-31 11:36
crypto_stream.phpt
1.16
KB
-rw-rw-r--
2022-10-31 11:36
exception_trace_without_args.phpt
421
B
-rw-rw-r--
2022-10-31 11:36
inc_add.phpt
909
B
-rw-rw-r--
2022-10-31 11:36
installed.phpt
467
B
-rw-rw-r--
2022-10-31 11:36
php_password_hash_argon2i.phpt
2.08
KB
-rw-rw-r--
2022-10-31 11:36
php_password_hash_argon2id.phpt
2.09
KB
-rw-rw-r--
2022-10-31 11:36
php_password_verify.phpt
2.36
KB
-rw-rw-r--
2022-10-31 11:36
pwhash_argon2i.phpt
1.52
KB
-rw-rw-r--
2022-10-31 11:36
pwhash_scrypt.phpt
1.09
KB
-rw-rw-r--
2022-10-31 11:36
sodium_error_001.phpt
639
B
-rw-rw-r--
2022-10-31 11:36
utils.phpt
3.45
KB
-rw-rw-r--
2022-10-31 11:36
version.phpt
283
B
-rw-rw-r--
2022-10-31 11:36
Save
Rename
--TEST-- Check for libsodium box --SKIPIF-- <?php if (!extension_loaded("sodium")) print "skip"; ?> --FILE-- <?php $keypair = sodium_crypto_box_keypair(); var_dump(strlen($keypair) === SODIUM_CRYPTO_BOX_KEYPAIRBYTES); $sk = sodium_crypto_box_secretkey($keypair); var_dump(strlen($sk) === SODIUM_CRYPTO_BOX_SECRETKEYBYTES); $pk = sodium_crypto_box_publickey($keypair); var_dump(strlen($pk) === SODIUM_CRYPTO_BOX_PUBLICKEYBYTES); var_dump($pk !== $sk); $pk2 = sodium_crypto_box_publickey_from_secretkey($sk); var_dump($pk === $pk2); $pk2 = sodium_crypto_scalarmult_base($sk); var_dump($pk === $pk2); $keypair2 = sodium_crypto_box_keypair_from_secretkey_and_publickey($sk, $pk); var_dump($keypair === $keypair2); $seed_x = str_repeat('x', SODIUM_CRYPTO_BOX_SEEDBYTES); $seed_y = str_repeat('y', SODIUM_CRYPTO_BOX_SEEDBYTES); $alice_box_kp = sodium_crypto_box_seed_keypair($seed_x); $bob_box_kp = sodium_crypto_box_seed_keypair($seed_y); $message_nonce = random_bytes(SODIUM_CRYPTO_BOX_NONCEBYTES); $alice_box_secretkey = sodium_crypto_box_secretkey($alice_box_kp); $bob_box_publickey = sodium_crypto_box_publickey($bob_box_kp); $alice_to_bob_kp = sodium_crypto_box_keypair_from_secretkey_and_publickey( $alice_box_secretkey, $bob_box_publickey ); $msg = "Here is another message, to be signed using Alice's secret key, and " . "to be encrypted using Bob's public key. The keys will always be the same " . "since they are derived from a fixed seeds"; $ciphertext = sodium_crypto_box( $msg, $message_nonce, $alice_to_bob_kp ); try { $ciphertext = sodium_crypto_box( $msg, $message_nonce, substr($alice_to_bob_kp, 1) ); } catch (SodiumException $ex) { echo $ex->getMessage(), PHP_EOL; } sodium_memzero($alice_box_kp); sodium_memzero($bob_box_kp); $alice_box_kp = sodium_crypto_box_seed_keypair($seed_x); $bob_box_kp = sodium_crypto_box_seed_keypair($seed_y); $alice_box_publickey = sodium_crypto_box_publickey($alice_box_kp); $bob_box_secretkey = sodium_crypto_box_secretkey($bob_box_kp); $bob_to_alice_kp = sodium_crypto_box_keypair_from_secretkey_and_publickey( $bob_box_secretkey, $alice_box_publickey ); $plaintext = sodium_crypto_box_open( $ciphertext, $message_nonce, $bob_to_alice_kp ); var_dump($msg === $plaintext); $alice_kp = sodium_crypto_box_keypair(); $alice_secretkey = sodium_crypto_box_secretkey($alice_kp); $alice_publickey = sodium_crypto_box_publickey($alice_kp); $bob_kp = sodium_crypto_box_keypair(); $bob_secretkey = sodium_crypto_box_secretkey($bob_kp); $bob_publickey = sodium_crypto_box_publickey($bob_kp); $alice_to_bob_kp = sodium_crypto_box_keypair_from_secretkey_and_publickey ($alice_secretkey, $bob_publickey); $bob_to_alice_kp = sodium_crypto_box_keypair_from_secretkey_and_publickey ($bob_secretkey, $alice_publickey); $alice_to_bob_message_nonce = random_bytes(SODIUM_CRYPTO_BOX_NONCEBYTES); $alice_to_bob_ciphertext = sodium_crypto_box('Hi, this is Alice', $alice_to_bob_message_nonce, $alice_to_bob_kp); $alice_message_decrypted_by_bob = sodium_crypto_box_open($alice_to_bob_ciphertext, $alice_to_bob_message_nonce, $bob_to_alice_kp); $bob_to_alice_message_nonce = random_bytes(SODIUM_CRYPTO_BOX_NONCEBYTES); $bob_to_alice_ciphertext = sodium_crypto_box('Hi Alice! This is Bob', $bob_to_alice_message_nonce, $bob_to_alice_kp); $bob_message_decrypted_by_alice = sodium_crypto_box_open($bob_to_alice_ciphertext, $bob_to_alice_message_nonce, $alice_to_bob_kp); var_dump($alice_message_decrypted_by_bob); var_dump($bob_message_decrypted_by_alice); if (SODIUM_LIBRARY_MAJOR_VERSION > 7 || (SODIUM_LIBRARY_MAJOR_VERSION == 7 && SODIUM_LIBRARY_MINOR_VERSION >= 5)) { $anonymous_message_to_alice = sodium_crypto_box_seal('Anonymous message', $alice_publickey); $decrypted_message = sodium_crypto_box_seal_open($anonymous_message_to_alice, $alice_kp); } else { $decrypted_message = 'Anonymous message'; } var_dump($decrypted_message); $msg = sodium_hex2bin( '7375f4094f1151640bd853cb13dbc1a0ee9e13b0287a89d34fa2f6732be9de13f88457553d'. '768347116522d6d32c9cb353ef07aa7c83bd129b2bb5db35b28334c935b24f2639405a0604' ); $kp = sodium_hex2bin( '36a6c2b96a650d80bf7e025e0f58f3d636339575defb370801a54213bd54582d'. '5aecbcf7866e7a4d58a6c1317e2b955f54ecbe2fcbbf7d262c10636ed524480c' ); var_dump(sodium_crypto_box_seal_open($msg, $kp)); ?> --EXPECT-- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) keypair size should be SODIUM_CRYPTO_BOX_KEYPAIRBYTES bytes bool(true) string(17) "Hi, this is Alice" string(21) "Hi Alice! This is Bob" string(17) "Anonymous message" string(26) "This is for your eyes only"