function EncryptString($key,$plainText){
$bytes = random_bytes(8);
$iv=bin2hex($bytes);
$encryptedData = openssl_encrypt($plainText, 'AES-256-CBC', $key, $options=0, $iv);
return $iv.$encryptedData;
}
function DecryptString($key,$encText){
$iv=substr($encText,0,16);
$decryptedData = openssl_decrypt(substr($encText,16), 'AES-256-CBC', $key, $options=0, $iv);
return $decryptedData;
}