Two Way Encryption or Hashing using Key

This is using PHP and openssl_decrypt/openssl_encrypt Encrypting the string $key = “xxxxxxxxxxx”; //11 characters $ivlen = openssl_cipher_iv_length(“aes-256-cbc-hmac-sha256″); $iv = openssl_random_pseudo_bytes($ivlen); $hash = openssl_encrypt(STRING TO HASH,”aes-256-cbc-hmac-sha256”,$key,0,$iv); $iv = bin2hex($iv); // iv generated is in binary – converted to HEX for passing through SESSION or POST or URL Decrypting back the string $key = “xxxxxxxxxxx”; $hash =… Continue reading Two Way Encryption or Hashing using Key