qwerty123 - 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.



Your result can be seen below.

Result of php executing





Full code of qwerty123.php

  1. <?php
  2.  
  3.  
  4. $key = "8b362e210615e66b3bf7f69f6c819056";
  5. $cipher = "aes-256-ctr";
  6. $iv = "ABCDEFGHIJKLMNOP";
  7. $ciphertext = "N/+kToQPGwnGWxrtaiemNBQ1xZ4uns6yUkWRWn86b86RufsKteruCBa2B6PeONx1fa/KTBYDVxmqf617zYK0P9WKNAOsYg==";
  8.  
  9.  
  10. function decrypt($ciphertext, $key, $cipher, $iv) {
  11.     if (in_array($cipher, openssl_get_cipher_methods())) {
  12.         $ivlen = openssl_cipher_iv_length($cipher);
  13.         $plaintext = openssl_decrypt($ciphertext, $cipher, $key, $options = 0, $iv);
  14.         if ($plaintext) {
  15.             return $plaintext;
  16.         } else {
  17.             echo "Decryption error";
  18.         }
  19.     }
  20. }
  21.  
  22.  
  23.  
  24. $decryptedValue = decrypt($ciphertext, $key, $cipher, $iv);
  25. echo "Valor desencriptado: " . $decryptedValue;
File Description
  • qwerty123
  • PHP Code
  • 31 Mar-2024
  • 729 Bytes
You can Share it: