|
XOR Key finder, If you forget
the XOR Key, this rank based program can find the XOR Key.
This
utility program written in Visual Basic.
Click here to
Download the source code.
Introduction
Find XOR Secret Key, If you forget the code and want to find
it, copy some cipher text and click the start button it will
show you the code. More details use read me file in
source code folder after download.
This XOR Key Finder program source code written
in Visual Basic .NET programming language, capable of find
XOR Secret key.
|
1.
Encryption / Decryption
|
|
|
Screen shot

Logics
This is a rank based algorithm, we XOR each and every
character to the ASCII value from 1 to 255 and give a rank
of each find. While giving rank we compare each XORed value
with predefined string. If the value found in the string we
give a value 1, if not found then we give 0. Lastly we sum
of all value to get a rank. the compare string something
look like "ABCDE....XYZ" it is a readable text. You can change the string as per requirement, if
you want to find XOR key for a numeric field, then string may
contains only digits range from 0-9.
Dim
StrPT As
String
StrPT =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.abcdefghijklmnopqrstuvwxyz
"
We take a multidimensional
array to hold our result, we take a 255 X 3 array, first
pocket we put our decrypted text, second pocket we put XOR
Code and last pocket we put the calculated rank.
For i = 1
To 255
Dim TempDE
As
String
TempDE = XORCipher(StrET, i)
'>>> compare to
Readable Text
r = 0
For j = 1
To TempDE.Length
If
InStr(StrPT, Mid(TempDE, j, 1)) > 0
Then
r = r + 1
End
If
Next
'>>> decrypted
text
DecrArray(i - 1, 0) = TempDE
'>>> XOR/ Secret Key
DecrArray(i - 1, 1) = i
'>>> rank
DecrArray(i - 1, 2) = r
Next
Lastly we need to arrange the
array by highest rank, .NET Framework support sorting array
but its support only single dimensional array, as it is a
multidimensional array we need to write few line of code to
sort the array by highest rank.
'>>> sort the array by
highest rank first
For i = 0
To 255
For j = 0
To 254
Dim TempRank
As
String
If
Val(DecrArray(j, 2)) < Val(DecrArray(j + 1, 2))
Then
'>>>
swap rank
TempRank = DecrArray(j, 2)
DecrArray(j, 2) = DecrArray(j + 1,
2)
DecrArray(j + 1, 2) = TempRank
'>>> xor key
TempRank = DecrArray(j, 1)
DecrArray(j, 1) = DecrArray(j + 1,
1)
DecrArray(j + 1, 1) = TempRank
'>>> decrypt
text
TempRank = DecrArray(j, 0)
DecrArray(j, 0) = DecrArray(j
+ 1, 0)
DecrArray(j + 1, 0) = TempRank
End
If
Next
Next
Download the source code and project files |