برای رمزنگاری از تابع زیر استفاده کنید :
function EncryptString($string)
{
try {
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$iv = "1234567890123456";
$key = "1234567890123456";
$result = openssl_encrypt($string,$ciphering,$key,$options,$iv);
return $result;
} catch (\Throwable $th) {
// return $th->getMessage();
return false;
}
}
برای رمزگشایی هم از تابع زیر استفاده کنید :
function DecryptString($string)
{
try {
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$iv = "1234567890123456";
$key = "1234567890123456";
$result = openssl_decrypt($string,$ciphering,$key,$options,$iv);
return $result;
} catch (\Throwable $th) {
return false;
}
}
ایجاد سیستم فالوو و روابط بین جدول کاربران و فالوورها در یک نرم افزار شبکه اجتماعی با لاراول
تابع رمزنگاری با الگوریتم AES-128-CTR در زبان برنامه نویسی php
, ,iv ,string , openssl ,ciphering , ,1234567890123456 , 1234567890123456 ,128 ctr ,aes 128 ,1234567890123456 result , result openssl ,ciphering options ,length ciphering
درباره این سایت