Skip to main content

Posts

Showing posts from February, 2023

PHP encrypt and decrypt

 <?php $string_to_encrypt="Test"; $password="password"; $encrypted_string=openssl_encrypt($string_to_encrypt,"AES-128-ECB",$password); $decrypted_string=openssl_decrypt($encrypted_string,"AES-128-ECB",$password); echo $encrypted_string; echo "\n.............\n"; echo $decrypted_string; $data = [    ]; echo "<br/>"; $password = "siddhu**7**0"; foreach($data as $d) { echo $d."\n"; echo "<br/>"; echo openssl_decrypt($d,"AES-128-ECB",$password); echo "<br/>"; echo "<br/>"; } ?>