Decrypts given string

Uses openssl_decrypt() to decrypt given string. Read more.

php
fork add to bundle source
function decrypt_string($string, $secret = 'secret', $iv = 'iv') { $encrypt_method = "AES-256-CBC"; $key = hash('sha256', $secret); $iv = substr(hash('sha256', $iv), 0, 16); return openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv); }

usage

load_function('decrypt_string'); echo decrypt_string('cXhaYXkrRGJnRlVMSGR1bUYrbzJxdz09'); // hello
← how to use this in app?
create log ...inout