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

  1.  
  2. <?php
  3.  
  4.  
  5. # I am by no means a cryptographer. So this might be reversible, but I would be really  impressed if you can email me back the password I used.
  6.  
  7. # Some Variables
  8.  
  9. $key = 'Warzone1'; #Input::get('asdasda'); <- this is stateless as it’s just one request. So not stored anywhere. Can decrypt all passwords on the page we are on. Can use same statelessness when updating all passwords. 
  10. $databasePassword = "VPbnJtMg/70xZRdf/0bpHg=="; # <- This is what you would get from our database could do more but this is just an example.
  11.  
  12. #Set up
  13.  
  14. $bytes = "";
  15. $last = "";
  16. while(strlen($bytes) < 48) {
  17.     $last = md5($last . $key, true);
  18.     $bytes.= $last;
  19. }
  20.  
  21. $iv = substr($bytes, 32, 16);
  22.  
  23.  
  24. $encryptionMethod = 'AES-128-CBC';
  25.  
  26. # Just for lulz how i generated it.
  27. #$databasePassword = openssl_encrypt('Hi Adam!', $encryptionMethod, $key, 0, $iv);
  28. #echo $databasePassword . '<br/>';
  29.  
  30.  
  31. var_dump(openssl_decrypt($databasePassword, $encryptionMethod, $key, 0, $iv));
File Description
  • ExampleEncry
  • PHP Code
  • 25 Mar-2021
  • 961 Bytes
You can Share it: