谁帮我修改下,我的密码破解方法??
下面是我写的密码(12)位的破解方法,但一运行,内存就吃光了,大家帮我想下办法??
Function R_W_Mifare(ByVal xsing As String, ByVal block As Integer, ByVal xdev As Long, ByVal xdata As String) As String
Dim data_hex As String * 32
maxmode = 0
shanq = 0
snr = 0
Dim aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa, qa, ra, sa, ta, ua, va, wa, xa As Integer
Dim value(62) As String
'value(0) = " "
value(1) = "0 "
value(2) = "1 "
value(3) = "2 "
value(4) = "3 "
value(5) = "4 "
value(6) = "5 "
value(7) = "6 "
value(8) = "7 "
value(9) = "8 "
value(10) = "9 "
value(11) = "a "
value(12) = "b "
value(13) = "c "
value(14) = "d "
value(15) = "e "
value(16) = "f "
value(17) = "g "
value(18) = "h "
value(19) = "i "
value(20) = "j "
value(21) = "k "
value(22) = "l "
value(23) = "m "
value(24) = "n "
value(25) = "o "
value(26) = "p "
value(27) = "q "
value(28) = "r "
value(29) = "s "
value(30) = "t "
value(31) = "u "
value(32) = "v "
value(33) = "w "
value(34) = "x "
value(35) = "y "
value(36) = "z "
value(37) = "A "
value(38) = "B "
value(39) = "C "
value(40) = "D "
value(41) = "E "
value(42) = "F "
value(43) = "G "
value(44) = "H "
value(45) = "I "
value(46) = "J "
value(47) = "K "
value(48) = "L "
value(49) = "M "
value(50) = "N "
value(51) = "O "
value(52) = "P "
value(53) = "Q "
value(54) = "R "
value(55) = "S "
value(56) = "T "
value(57) = "U "
value(58) = "V "
value(59) = "W "
value(60) = "X "
value(61) = "Y "
value(62) = "Z "
Dim vget(1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62, 1 To 62) As String
'Dim vget(1 To 62, 1 To 62, 1 To 62) As String
'Dim password As String
For aa = 1 To 62 '(第1位的可能情况)
For ba = 1 To 62 '(第2位的可能情况)
For ca = 1 To 62 '(第3位的可能情况)
For da = 1 To 62 '(第4位的可能情况)
For ea = 1 To 62 '(第5位的可能情况)
For fa = 1 To 62 '(第6位的可能情况)
For ga = 1 To 62 '(第7位的可能情况)
For ha = 1 To 62 '(第8位的可能情况)
For ia = 1 To 62 '(第9位的可能情况)
For ja = 1 To 62 '(第10位的可能情况)
For ka = 1 To 62 '(第11位的可能情况)
For la = 1 To 62 '(第12位的可能情况)
'vget(aa)(ba)(ca)(da)(ea)(fa)(ga)(ha)(ia)(ja)(ka)(la) = value(aa) + value(ba) + value(ca) + value(da) + value(ea) + value(fa) + value(ga) + value(ha) + value(ia) + value(ja) + value(ka) + value(la) '(载入数据)
vget(aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la) = value(aa) + value(ba) + value(ca) + value(da) + value(ea) + value(fa) + value(ga) + value(ha) + value(ia) + value(ja) + value(ka) + value(la) '(载入数据)
'vget(aa, ba, ca) = value(aa) + value(ba) + value(ca) '(载入数据)
'vget(aa, ba, ca, da, ea) = value(aa) + value(ba) + value(ca) + value(da) + value(ea) '(载入数据)
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
For ma = 1 To 62 '(取第1位)
For na = 1 To 62 '(取第2位)
For oa = 1 To 62 '(取第3位)
For pa = 1 To 62 '(取第4位)
For qa = 1 To 62 '(取第5位)
For ra = 1 To 62 '(取第6位)
For sa = 1 To 62 '(取第7位)
For ta = 1 To 62 '(取第8位)
For ua = 1 To 62 '(取第9位)
For va = 1 To 62 '(取第10位)
For wa = 1 To 62 '(取第11位)
For xa = 1 To 62 '(取第12位)
nkey = vget(ma, na, oa, pa, qa, ra, sa, ta, ua, va, wa, xa) '(读取数据)
'nkey = vget(ma, na, oa) '(读取数据)
st = rf_authentication(xdev, maxmode, shanq)
If st% = 0 Then
MsgBox nkey '(弹出正确的密码)
End If
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Function
[解决办法]
真用功!看的也要功夫啊。
[解决办法]
循环嵌套也倒是个办法
不过十二位枚举的时间很可观...
[解决办法]
前些天好像也回答过你的问题。
本题如果作为练习编程,可取,但可以把位数缩减来做,比如整个3位4位玩玩就行了。
如果要有别的用途,奉劝你放弃。这种方式的破解你必须得用服务器级别的分布式集群联合作战,可能经过几天的时间会把所有运算搞定。
[解决办法]
62的12次方
3,226,266,762,397,899,821,056≈3.226*10^21
暴力破解好像不太可取
[解决办法]
我觉得用二进制的错位运算更好些,这样代码清晰,结构美观,而且运行快,编写不容易出错
[解决办法]
难以想象.
假设你一秒钟测试1亿个密码(目前估计是不可能的),再购置上10000台机子同时不吃不喝地算,需
要多少时间?62^12/10^8/3600/24/365/10000=102(年),几辈子就跟这一个密码干上了.
[解决办法]
第一次看到这种代码,太牛了!