Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pay_encrypt($json_data, $key, $iv)
- {
- $encryption_key = base64_decode($key);
- $iv_orig = base64_decode($iv);
- $sdata = serialize($json_data);
- $encrypted = openssl_encrypt($sdata, 'aes-256-cbc', $encryption_key, 0, $iv_orig);
- return strtr($encrypted, '+/=', '._-');
- }
- function pay_decrypt($data, $key, $iv)
- {
- $encryption_key = base64_decode($key);
- $iv_orig = base64_decode($iv);
- $data_unsanitized = strtr($data, '._-', '+/=');
- return unserialize(openssl_decrypt($data_unsanitized, 'aes-256-cbc', $encryption_key, 0, $iv_orig));
- }
Add Comment
Please, Sign In to add comment