遇到一段用字典加密的算法
想根据加密算法推算出解密但是卡在这几行代码了
逆向到这里,发现在pPassTable中find的时候只能匹配高位和低位相等的值, 但是有有很多重复值,没找到办法推算出tByte的值所以怀疑这个算法用加密的字典是不可逆的,求大佬解惑是我方向错了还是这个就是个不可逆的算法
部分代码块如下
sOriginal = [] # 原文
pPassTable = [] # 字典
result = []
rByte = sOriginal[3]
offset2 = 0
for y in range(0, 3):
eByte = sOriginal[2 - y]
tByte = (eByte & 0xF0) + (rByte >> 4)
if tByte > 0x7F:
high = pPassTable[(tByte & 0x7F) + offset2] >> 4
else:
high = pPassTable[tByte + offset2] & 0xF
tByte = ((eByte & 0xF) << 4) + (rByte & 0xF)
if tByte > 0x7F:
low = pPassTable[(tByte & 0x7F) + offset2] >> 4
else:
low = pPassTable[tByte + offset2] & 0xF
rByte = (high << 4) + low
if y == 2:
result[0] = rByte