You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function encrypt_decrypt($action, $string, $secret_key) {
$output = false;
$encrypt_method = "AES-256-CBC";
//
$secret_iv = 'This is a secret iv';
// hash
$key = hash('sha256', $secret_key); //sha256 is a hashing algorithm
$iv = substr(hash('sha256', $secret_iv), 0, 16); // iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning (iv = A non-NULL Initialization Vector.)