如何在 PHP 上使用 IGE 加密 AES-256 ?在未找到的网络中,任何库都支持IGE模式。
$ivBytes = [157,206,226,204,164,6,205,236,49,244,114,88,33,190,217,143,187,73,20,49,151,195,112,152,23,137,198,50,30,149,42,180];
$encryptedBytes = [218,32,17,116,119,172,151,198,165,41,89,29,140,187,98,223,53,36,164,226,30,76,76,82,13,217,97,14,150,214,147,166,91,240,144,148,111,119,241,75,57,141,28,112,178,36,17,103,92,93,181,202,179,138,204,1,79,67,237,154,183,88,60,225,123,55,194,213,168,60,49,203,212,42,112,194,64,176,230,42,105,205,51,152,123,108,220,168,188,32,150,110,4,251,78,6,73,28,20,175,224,187,74,92,195,66,93,228,60,169,54,135,125,68,58,212,188,123,22,136,121,247,42,220,92,163,166,150,117,163,121,132,197,13,50,66,68,215,147,253,110,208,255,35,40,28,1,49,142,38,154,243,240,25,161,151,116,194,182,121,217,89,84,199,50,88,240,20,95,119,109,246,174,106,82,103,5,204,45,103,213,87,125,245,187,231,49,80,170,116,140,59,180,152,189,48,222,51,139,95,245,163,76,48,141,5,76,42,244,225,199,44,178,187,206,46,180,36,25,24,176,166,26,5,196,117,108,178,71,166,246,117,129,235,181,112,249,39,45,249,142,187,181,86,86,185,210,152,126,26,115,137,14,106,113,51,229,246,47,78,210,240,136,141,79,54,129,129,214,95,126,89,192,190,24,41,88,3,139,18,156,156,92,197,87,80,194,78,61,219,253,93,228,87,231,50,63,7,205,232,197,61,83,160,122,173,166,209,65,163,110,56,23,231,210,248,12,65,58,31,167,178,126,244,129,114,40,36,52,8,27,1,225,216,83,179,61,91,60,76,19,128,67,216,83,2,84,18,105,64,46,53,189,13,221,192,120,78,211,254,19,165,71,138,82,200,128,0,146,66,51,22,222,121,138,174,29,135,156,160,211,167,55,165,32,141,183,136,9,189,224,15,47,73,146,226,192,58,70,163,10,95,83,100,246,159,199,180,241,247,43,179,77,247,230,6,189,4,236,162,193,12,170,46,89,148,12,69,191,155,148,244,164,52,55,92,69,68,142,47,6,6,253,40,36,61,79,244,53,201,109,129,187,248,139,231,167,123,115,19,37,149,36,207,65,19,112,119,68,118,176,61,165,99,205,184,7,50,181,105,124,187,68,124,16,171,195,146,41,26,39,198,12,120,203,25,138,125,147,65,2,14,212,13,209,146,186,219,4,227,161,47,246,71,17,253,228,62,35,67,151,70,19,224,254,97,54,186,25,84,165,252,98,27,179,69,116,233,38,197,226,247,109,172,231,103,169,190,171,108,207,213,150,237,111,86,226,194,56,223,51,18,181,19,118,244,201,168,92,163,98,252,238,0,86,226,193,251,81,90,131,45,237,100,170,68,170,136,75,224,85,92];
$keyBytes = [213,124,189,176,33,190,181,74,117,181,246,167,202,195,82,176,54,253,238,21,168,151,255,219,9,153,73,218,128,236,160,156];
$crypt = bytesToString($encryptedBytes);
$iv = bytesToString($ivBytes);
$key = bytesToString($keyBytes);
$resultOfDecoding. = stringToBytes(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $crypt, MCRYPT_MODE_CBC, $iv));
echo '$resultOfDecoding: '; print_r($resultOfDecoding);
$correctResult. = [81,211,169,224,194,160,145,75,137,149,78,141,125,151,228,182,31,210,94,37,186,13,137,181,155,48,242,156,171,241,212,156,249,127,208,193,39,99,76,173,232,198,3,128,51,114,217,159,179,248,207,170,18,238,40,26,3,0,0,0,254,0,1,0,199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91,254,0,1,0,109,83,244,183,69,92,56,242,181,106,148,3,192,71,20,126,173,79,119,99,106,12,65,238,36,200,105,154,36,116,35,210,246,185,184,98,107,235,105,177,135,151,73,201,196,95,167,235,71,175,110,184,39,230,49,97,9,27,220,86,123,156,64,96,122,145,95,213,164,38,154,197,38,222,104,88,61,42,119,79,50,168,191,22,152,34,32,210,219,192,67,93,184,78,182,190,185,192,30,115,223,87,239,32,87,169,51,232,52,57,99,2,110,169,83,62,244,214,47,62,124,120,175,153,240,83,185,129,70,158,0,23,103,225,72,50,40,56,76,30,248,91,7,89,2,19,164,121,252,125,206,27,66,48,3,223,213,32,19,47,129,216,30,75,229,136,94,252,174,196,221,52,134,35,214,255,14,159,114,209,164,188,85,52,246,96,77,196,22,24,225,200,148,19,77,120,60,119,178,63,91,95,39,247,150,31,221,217,204,23,87,246,235,54,155,97,227,147,197,148,87,22,235,14,38,135,41,75,219,13,32,215,146,105,214,230,145,37,69,230,83,91,72,35,219,219,207,216,80,50,66,48,139,202,49,133,61,201,80,84,159,36,231,126,16,218,48,100];
echo '$correctResult: '; print_r($correctResult);