This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $msg = 'This is a super secret message!'; | |
| // Generating an encryption key and a nonce | |
| $key = random_bytes(SODIUM_CRYPTO_SECRETBOX_KEYBYTES); // 256 bit | |
| $nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); // 24 bytes | |
| // Encrypt | |
| $ciphertext = sodium_crypto_secretbox($msg, $nonce, $key); | |
| // Decrypt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| w - move cursor to the beginning of the next word | |
| e - move cursor to the end of the next word | |
| ) - move cursor to the beginning of the next sentence | |
| ( - move cursor to the beginning of the previous sentence | |
| } - move cursor to the beginning of the next paragraph | |
| { - move cursor to the beginning of the previous paragraph | |
| /somsething<ENTER> - search for "something", press "n" key to move next |
OlderNewer