ek1 - 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 ek1.php

  1. <?php
  2.         $plaintext = json_encode(array('<foo>',"'bar'",'"baz"','&blong&', "\xc3\xa9"));
  3.         $key = 'testable';
  4.         $vector = 'Provider';
  5.         $encryptedString = openssl_encrypt($plaintext, 'des-cbc', $key, OPENSSL_RAW_DATA, 'Provider');
  6.         echo 'Encrypted: '.$encryptedString."\n";
  7.         echo ''.$plaintext."\n";
  9.         $encryptedStringBase64 = base64_encode($encryptedString);
  10.         echo 'Encrypted + base 64:'.$encryptedStringBase64."\n";
  12.         echo 'Decrypted:'.openssl_decrypt(base64_decode($encryptedStringBase64),'des-cbc',  $key, OPENSSL_RAW_DATA, $vector)."\n";
  14.         echo 'Decrypted:'.openssl_decrypt(base64_decode('YK66cZbAK/0='),'des-cbc', $key, OPENSSL_RAW_DATA, $vector)."\n";
File Description
  • ek1
  • PHP Code
  • 20 Jan-2022
  • 739 Bytes
You can Share it: