密码(one of 寒假作业)

        在开家长会的前一天,上午去学校,下午还要回学校,中午极无聊就买了几本杂志,其中一本就叫《黑客防线》。
        学校的事情办完了之后(其实就是没事,去报个到),我就回家了,当天晚上发现这本杂志光盘里有一个叫qq密码暴力破解器的东东,就试了一下,发现这个东东主要使用一个字典,然后把字典里的东西拉出去放到qq服务器上去试验,如果对了的话就对了,如果不对那就再试下一条。当天晚上就开始试验,当时破解一个我知道密码但不是我的qq号。
        一晚上下来居然没结果。(我当时怀疑是字典出问题了。)
        开完了家长会(其实家长会那天我也去了,最后结果还是和前一天一样。)
        回家之后打开qq上那个号,结果显示密码错了,我问它为什么改密码了,它说“不信任你”
        靠,当时就有上网下载了一个新版本结果一晚上还是没有结果。
        后来我就萌生了自己生成一个字典的想法,然后就打开了visual studio.net2003,还是选vb.net,选vb.net的理由有n个
        1.我会vb,可以说只会vb,虽然懂点皮毛pascal,但是我这边pascal编译器是上个世纪80年代的。
        2.相对来说vb.net的计算性能要比vb6强很多。
        3.vb.net借助.net 类库,可以不用安装程序就 在任何一个安装了.net feramwork (好像拼错了,嘿嘿)的机器上运行。

        
        //晕,前天机器重新装操作系统忘了备份,结果现在找不到代码了。
        //又晕一次,当时把c区划得太小,结果现在visual studio.net装不上了。

        //不过截图还是可以发的,因为最早的几个版本我都传到网上了。
        //那我还是接着讲故事吧。
        

        后来嘛,我就先编了一个能生成2位的从小写a-z的程序,我称之为α版。
        在后来我觉得一行一行编太累了,就又想编一个自动生成中间算法那段代码的程序。
        //可能是因为我们家人都懒,所以什么事情都想让机器干,能让机器干的又为什么非要动手呢?(这个理论同时适用于写作业,嘿嘿。)
        然后我就又转向这个了。(反正我有很多时间)
        后来就发现老用 textbox1.text=***
    

        太麻烦,就自己编了个函数,名字就叫print。和VB里的那个PRINT作用差不多。VB里那个作用是在窗体上输出,我这个是在TEXTBOX上输出。代码在底下:
FUNCTION PRINT (temp as string)as string
  textbox1.text = textbox1.text & vbClrf & temp  'vbclrf  表示换行
  End Function
 


 自己编了这个函数之后,在输出什么的时候就省心了.(关键是因为这个程序要输出的地方太多)

后来在设个程序自己生成的代码里我也加上了这个函数的定义。

再后来,我发现速度太慢,就把函数里的东西换成了:
textbox1.text = string.concat(textbox1.text , VbClrf , temp)

上面那个string.concat方法用于两个字符串之间的快速连接。(嘿嘿)

最后我发现原来和我的算法没关系,是我的机器太慢了。(要是有一个《数字城堡》里的那个密码机就好了。)

这个故事完了.


附录:


A.








+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
===============================================================================
----------------------------------------------------------------------------------------------------------------------

****************************************************************************************


B.代码(我前面说过当时编的那个自动生成代码的程序被我传到yahoo上了。)

 下面这个是可以生成两位字典的


'/-↓↓请不要把以下代码放到button的click事件中↓↓-/
'Function Start
'Function Name:
'PRINT
'LEIMD PROGRAMING ON 2005.1.18
'DEVELOPER:
'LEIMD
Function print(ByVal temp As String) As String
        TextBox1.Text = TextBox1.Text & temp
Function end
'Function END
'/-↑↑请不要把以上代码放到button的click事件中↑↑-/

 

 

 

Dim i as integer
Dim texta,textb as integer
Dim temp as string
Dim temp1(26),temp2(26) as string
'声明数组
'/↓↓↓↓↓↓初始化数组↓↓↓↓↓↓/'
for i = 1 to 26
        temp1(i) = chr(i + 96)
        temp2(i) = chr(i + 96)
next i'/↑↑↑↑↑↑初始化数组↑↑↑↑↑↑/’
'/____________↓main↓______________/'
for texta = 1 to 26
for textb = 1 to 26
        temp = temp1(texta) & temp2(textb)
        print (temp & vbcrlf)
next    textb
next    texta
'/____________↑main↑______________/'











+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
===============================================================================
----------------------------------------------------------------------------------------------------------------------

****************************************************************************************
下面的是可以生成26位字典的(有一点疯狂,希望机器速度慢的人不要尝试,主要是用来和上面的对比)
 











'/-↓↓请不要把以下代码放到button的click事件中↓↓-/
'Function Start
'Function Name:
'PRINT
'LEIMD PROGRAMING ON 2005.1.18
'DEVELOPER:
'LEIMD
Function print(ByVal temp As String) As String
        TextBox1.Text = TextBox1.Text & temp
Function end
'Function END
'/-↑↑请不要把以上代码放到button的click事件中↑↑-/

 

 

 

Dim i as integer
Dim texta,textb,textc,textd,texte,textf,textg,texth,texti,textj,textk,textl,textm,textn,texto,textp,textq,textr,texts,textt,textu,textv,textw,textx,texty,textz as integer
Dim temp as string
Dim temp1(26),temp2(26),temp3(26),temp4(26),temp5(26),temp6(26),temp7(26),temp8(26),temp9(26),temp10(26),temp11(26),temp12(26),temp13(26),temp14(26),temp15(26),temp16(26),temp17(26),temp18(26),temp19(26),temp20(26),temp21(26),temp22(26),temp23(26),temp24(26),temp25(26),temp26(26) as string
'声明数组
'/↓↓↓↓↓↓初始化数组↓↓↓↓↓↓/'
for i = 1 to 26
        temp1(i) = chr(i + 96)
        temp2(i) = chr(i + 96)
        temp3(i) = chr(i + 96)
        temp4(i) = chr(i + 96)
        temp5(i) = chr(i + 96)
        temp6(i) = chr(i + 96)
        temp7(i) = chr(i + 96)
        temp8(i) = chr(i + 96)
        temp9(i) = chr(i + 96)
        temp10(i) = chr(i + 96)
        temp11(i) = chr(i + 96)
        temp12(i) = chr(i + 96)
        temp13(i) = chr(i + 96)
        temp14(i) = chr(i + 96)
        temp15(i) = chr(i + 96)
        temp16(i) = chr(i + 96)
        temp17(i) = chr(i + 96)
        temp18(i) = chr(i + 96)
        temp19(i) = chr(i + 96)
        temp20(i) = chr(i + 96)
        temp21(i) = chr(i + 96)
        temp22(i) = chr(i + 96)
        temp23(i) = chr(i + 96)
        temp24(i) = chr(i + 96)
        temp25(i) = chr(i + 96)
        temp26(i) = chr(i + 96)
next i'/↑↑↑↑↑↑初始化数组↑↑↑↑↑↑/’
'/____________↓main↓______________/'
for texta = 1 to 26
for textb = 1 to 26
for textc = 1 to 26
for textd = 1 to 26
for texte = 1 to 26
for textf = 1 to 26
for textg = 1 to 26
for texth = 1 to 26
for texti = 1 to 26
for textj = 1 to 26
for textk = 1 to 26
for textl = 1 to 26
for textm = 1 to 26
for textn = 1 to 26
for texto = 1 to 26
for textp = 1 to 26
for textq = 1 to 26
for textr = 1 to 26
for texts = 1 to 26
for textt = 1 to 26
for textu = 1 to 26
for textv = 1 to 26
for textw = 1 to 26
for textx = 1 to 26
for texty = 1 to 26
for textz = 1 to 26
        temp = temp1(texta) & temp2(textb) & temp3(textc) & temp4(textd) & temp5(texte) & temp6(textf) & temp7(textg) & temp8(texth) & temp9(texti) & temp10(textj) & temp11(textk) & temp12(textl) & temp13(textm) & temp14(textn) & temp15(texto) & temp16(textp) & temp17(textq) & temp18(textr) & temp19(texts) & temp20(textt) & temp21(textu) & temp22(textv) & temp23(textw) & temp24(textx) & temp25(texty) & temp26(textz)
        print (temp & vbcrlf)
next    textz
next    texty
next    textx
next    textw
next    textv
next    textu
next    textt
next    texts
next    textr
next    textq
next    textp
next    texto
next    textn
next    textm
next    textl
next    textk
next    textj
next    texti
next    texth
next    textg
next    textf
next    texte
next    textd
next    textc
next    textb
next    texta
'/____________↑main↑______________/'



PS:yahoo的下载地址:
http://cn.f1.pg.briefcase.yahoo.com/bc/lmd0209/lst?.dir=/Dictionary-net&.view=l


本文的地址:
http://blog.csdn.net/leimd/archive/2005/02/20/295086.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值