Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:“您必须遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他有关法律法规。”;N天后做点什么”;_Php - Fatal编程技术网

PHP:“您必须遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他有关法律法规。”;N天后做点什么”;

PHP:“您必须遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他有关法律法规。”;N天后做点什么”;,php,Php,基本上,我的想法是在PHP中引入一个计时结构,比如说每N天改变一次系统的主要加密算法 $key32 = pack('H*', "bcb04b7e103a0cd8b54763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3"); # 32 byte $key24 = pack('H*', "dd0255b51151b71427984aa74ae4f1993b7400c3d184ad02"); # 24 byte $key16 =

基本上,我的想法是在PHP中引入一个计时结构,比如说每N天改变一次系统的主要加密算法

$key32 = pack('H*', "bcb04b7e103a0cd8b54763051cef08bc55abe029fdebae5e1d417e2ffb2a00a3"); # 32 byte
$key24 = pack('H*', "dd0255b51151b71427984aa74ae4f1993b7400c3d184ad02");                 # 24 byte
$key16 = pack('H*', "13196c5ecdac5413148ba11469448474");                                 # 16 byte

# show key size use either 16, 24 or 32 byte keys for AES-128, 192
# and 256 respectively
$key_size =  strlen($key24);
echo "Key size: " . $key_size . "\n";

$plaintext = "Ruffles";

# create a random IV to use with CBC encoding
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_CBC);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);

# creates a cipher text compatible with AES (Rijndael block size = 128)
# to keep the text confidential 
# only suitable for encoded input that never ends with value 00h
# (because of default zero padding)
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_192, $key24,
                             $plaintext, MCRYPT_MODE_CBC, $iv);

# prepend the IV for it to be available for decryption
$ciphertext = $iv . $ciphertext;

# encode the resulting cipher text so it can be represented by a string
$ciphertext_base64 = base64_encode($ciphertext);
尽管这样做:

   if (date('d.m.y')=='08.11.14') {
        $encryption = 'MCRYPT_RIJNDAEL_192';
        $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key24,
                                 $plaintext, MCRYPT_MODE_CBC, $iv);
   }

无法解决此问题,因为文件必须在该日期加载,而且,该文件应该只加密用户密码,以便在以后直接插入数据库。我应该做一个cron作业吗?

当然,cron作业是一个解决方案。看这里,想法是一样的-