first crakme xor |
The password length in the program is constant and equals 8. After entering the password, the program goes through the password 3 times, using XOR encryption (xorEncryptDecrypt) with the values 75, 76 and 77. It is easy to calculate that 75^76^77 = 74. The calculateChecksum function returns the sum of the ASCII values of the characters in the string. Therefore, to build the password, we need to find values such that when XORed with 74 and subtracted from 300, they will be multiples of 7 (since the original password length is 8, and now we are calculating the index of the first value). Once we find the first value of the password, we can calculate the next character and repeat it 7 times.
To calculate the next character, we keep temporary variables for convenience. Let A be the missing sum for the checksum, then A = 300 - (index ^ 74). Let B be the XOR value of the required character. Since we need to fill 7 characters and A is a multiple of 7, then B = A / 7. So the required character index is B^74. The general formula is:
(300 - (i^74)) / 7) ^ 74 |