Teste PB Encrypt and decrypt - 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 Teste PB Encrypt and decrypt.php
- <?php
- $key = 'chbauto#testeenviron992828288921';
- // $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);
- // $encryptedString = openssl_encrypt('teste', 'aes-128-cbc', $key);
- // echo 'Encrypted: '.$encryptedString."\n";
- // $encryptedStringBase64 = base64_encode($encryptedString);
- // echo 'Encrypted + base 64:'.$encryptedStringBase64."\n";
- $encryptedStringBase64 = "cUJabFMyWlgzdTNydjRvLzgydTBUd09xb0txYkdaR093eHQrWGNzZnRjL1hrQmZyNUM4bzVOT04rdS91UmpwTXlaTkx6MjUvL0Z2d2hiUUxiYWFqL05sZVNORW0zNlJLeFFqcTZ6dUhlb0dRUDhiZDY4ZllCczNSa2xFa3A1UXFWVXZseXdZMTQ3WEFUQ1hLajNZMUI3UTB1R2tJeUR4bXIwbHJaNkZiWkEvdWNtRTVCSXJYczNWandOTUNnbGtY";
- echo 'Decrypted:'.openssl_decrypt(base64_decode($encryptedStringBase64),'AES-128-ECB', $key)."\n";
File Description
- Teste PB Encrypt and decrypt
- PHP Code
- 17 Mar-2021
- 916 Bytes
You can Share it:
Latest PHP Pastes