|
原帖由 ldy 于 2009-6-8 12:54 发表
穷举破解属下下策. 但是最准确的方法,用穷举法都不能确定的加密,其他方法一样确定不了
很早之前我有和LDY版主一样的想法,觉得异或加密就很难破解了,但思来想去发现很多不足.因为网上太多的破解程序见附件.
以下是我很早之前写的字附串加密程序.做了双异或加密,安全性会更高一些,不过在高手面前还是和没有加一样.
Function jami2(xx, yy) As String '存在一定错误机率的加密
Dim datx() As Byte, datx1() As Byte
Dim daty() As Byte
Dim x As String, y As String, h As Long
x = xx
y = yy
datx = x
daty = y
j = 0
For i = 0 To UBound(datx) - 1 Step 2
If datx(i) = 255 And datx(i + 1) = 255 Then
datx(i) = 0: datx(i + 1) = 0
End If
Next i
datx1 = datx
For i = 0 To UBound(datx)
If j > UBound(daty) Then j = 0
datx(i) = datx(i) Xor daty(j)
j = j + 1
Next i
For i = UBound(datx) - 1 To 2 Step -2
h = datx(i)
h = Abs(h - datx1(i))
datx(i - 2) = datx(i - 2) Xor h
Next i
For i = 0 To UBound(datx) - 1 Step 2
If datx(i) = 0 And datx(i + 1) = 0 Then
datx(i) = 255: datx(i + 1) = 255
End If
Next i
jami2 = datx
End Function |
|