· 7 years ago · Mar 04, 2018, 01:28 PM
1$secret_key = sodium_crypto_secretbox_keygen();
2$message = 'Sensitive information';
3
4$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
5$encrypted_message = sodium_crypto_secretbox($message, $nonce, $secret_key);
6
7Decryption:
8
9$decrypted_message = sodium_crypto_secretbox_open($encrypted_message, $nonce, $secret_key);
10
11order deny,allow
12deny from all
13allow from 127.0.0.1