method encryptOpenssl documentation in bbn\Util\Enc
Encrypt string using openSSL module
function(string $s, string $key = NULL, string $method = NULL, string $password = '')
{
string $method = null,
string $password = ''
): ?string {
if (!$key) {
$key = self::$salt;
}
if ($length = @openssl_cipher_iv_length($method ?: self::$method)) {
$iv = substr(md5(self::$prefix.$password), 0, $length);
$res = null;
try {
$res = openssl_encrypt($s, $method ?: self::$method, $key, true, $iv);
}
catch (\Exception $e) {
X::log("Impossible to decrypt");
}
return $res;
}
return null;
}
Encrypt string using openSSL module BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions