Is it difficult to reverse an algorithm in php? There is an example of what the encrypted text looks like below it and an example of how it should print out. Or could I get some kind of explanation on what the code is doing? Thanks
The PHP-code which is used for the encryption:
Example of encrypted text:
-176 -199 -123 -173 -94 -204 -165 -162 -159 -143 -155 -174 -134 -215 -139 -206 -104 -232 -203 -200 -141 -119 -146 -183 -210 -180 -192 -178 -169 -151 -138 -152 -206 -146 -160 -155 -206 -210 -179 -215 -190 -153 -172 -247 -173 -180 -142 -157 -115 -167 -155 -178 -176 -161 -179 -167 -205 -185 -186 -257 -192 -119 -166 -193 -187 -208 -178 -166 -184 -189 -170 -177 -89 -148 -154 -188 -197 -189 -144 -240 -153 -170 -179 -171 -171 -148 -108 -193 -173 -171 -166 -198 -128 -122 -166 -200 -227 -151 -186 -247
This is how it should print out:
99Z-KH5-OEM-240-1.1
QGG-V33-OEM-0B1-1.1
Z93-Z29-OEM-BNX-1.1
IQ0-PZI-OEM-PK0-1.1
UM4-VDL-OEM-B9O-1.1
L0S-4R2-OEM-UQL-1.1
JBL-EYQ-OEM-ABB-1.1
NL1-3V3-OEM-L4C-1.1
7CQ-1ZR-OEM-U3I-1.1
XX0-IHL-OEM-5XK-1.1
KJQ-RXG-OEM-TW8-1.1
OZR-LW1-OEM-5EM-1.1
0B8-6K5-OEM-EFN-1.1
OE2-20L-OEM-SSI-1.1
0ME-HAE-OEM-9XB-1.1
The PHP-code which is used for the encryption:
Code:
<?php
//------------------------------------------------------------------------------------
function evalCrossTotal($strMD5)
{
$intTotal = 0;
$arrMD5Chars = str_split($strMD5, 1);
foreach ($arrMD5Chars as $value)
{
$intTotal += '0x0'.$value;
}
return $intTotal;
}//-----------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
function encryptString($strString, $strPassword)
{
// $strString is the content of the entire file with serials
$strPasswordMD5 = md5($strPassword);
$intMD5Total = evalCrossTotal($strPasswordMD5);
$arrEncryptedValues = array();
$intStrlen = strlen($strString);
for ($i=0; $i<$intStrlen; $i++)
{
$arrEncryptedValues[] = ord(substr($strString, $i, 1))
+ ('0x0' . substr($strPasswordMD5, $i%32, 1))
- $intMD5Total;
$intMD5Total = evalCrossTotal(substr(md5(substr($strString,0,$i+1)), 0, 16)
. substr(md5($intMD5Total), 0, 16));
}
return implode(' ' , $arrEncryptedValues);
}//-----------------------------------------------------------------------------------
?>
-176 -199 -123 -173 -94 -204 -165 -162 -159 -143 -155 -174 -134 -215 -139 -206 -104 -232 -203 -200 -141 -119 -146 -183 -210 -180 -192 -178 -169 -151 -138 -152 -206 -146 -160 -155 -206 -210 -179 -215 -190 -153 -172 -247 -173 -180 -142 -157 -115 -167 -155 -178 -176 -161 -179 -167 -205 -185 -186 -257 -192 -119 -166 -193 -187 -208 -178 -166 -184 -189 -170 -177 -89 -148 -154 -188 -197 -189 -144 -240 -153 -170 -179 -171 -171 -148 -108 -193 -173 -171 -166 -198 -128 -122 -166 -200 -227 -151 -186 -247
This is how it should print out:
99Z-KH5-OEM-240-1.1
QGG-V33-OEM-0B1-1.1
Z93-Z29-OEM-BNX-1.1
IQ0-PZI-OEM-PK0-1.1
UM4-VDL-OEM-B9O-1.1
L0S-4R2-OEM-UQL-1.1
JBL-EYQ-OEM-ABB-1.1
NL1-3V3-OEM-L4C-1.1
7CQ-1ZR-OEM-U3I-1.1
XX0-IHL-OEM-5XK-1.1
KJQ-RXG-OEM-TW8-1.1
OZR-LW1-OEM-5EM-1.1
0B8-6K5-OEM-EFN-1.1
OE2-20L-OEM-SSI-1.1
0ME-HAE-OEM-9XB-1.1
Comment