for ani - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of for ani.php
- <?php
- //$key should have been previously generated in a cryptographically safe way, like openssl_random_pseudo_bytes
- $plaintext = "message to be encrypted message to be encrypted message to be encrypted message to be encrypted message to be encrypted message to be encrypted";
- $cipher = "aes-128-gcm";
- if (in_array($cipher, openssl_get_cipher_methods()))
- {
- $ivlen = openssl_cipher_iv_length($cipher);
- $iv = openssl_random_pseudo_bytes($ivlen);
- $ciphertext = openssl_encrypt($plaintext, $cipher, 'abcdefg', $options=0, $iv, $tag);
- //store $cipher, $iv, and $tag for decryption later
- $original_plaintext = openssl_decrypt($ciphertext, $cipher, 'abcdefg', $options=0, $iv, $tag);
- echo $original_plaintext."\n";
- echo $ciphertext."\n";
- }
File Description
- for ani
- PHP Code
- 16 Jul-2021
- 757 Bytes
You can Share it:
Latest PHP Pastes