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

  1. <?php
  2.         $key = '0A76EDD48C2D239BE4BF77B8E2E2C308';
  3.         $vector = chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0);
  4.         $encryptedString = openssl_encrypt('123-AM0712F-XK-383047820-1547628141', 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $vector);
  5.         echo 'Encrypted: '.$encryptedString."\n";
  6.         $encryptedStringBase64 = base64_encode($encryptedString);
  7.         echo 'Encrypted + base 64:'.$encryptedStringBase64."\n";
  8.  
  9.         echo 'Decrypted:'.openssl_decrypt(base64_decode($encryptedStringBase64),'aes-256-cbc',  $key, OPENSSL_RAW_DATA, $vector)."\n";
File Description
  • Openssl
  • PHP Code
  • 02 Jun-2021
  • 697 Bytes
You can Share it: