Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Jute Powerful Forum  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Jute是如何生成登陆时校验用的安全码的?
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-11-27 01:22 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
跨平台运行,不需要额外资源,速度快,不占服务器空间。
下面就解释一下算法:

1. 首先用户选择登录的时候,会在session里存一个临时生成的乱数(当然字符也行啊,中文都可以,不过用户还是输入数字最方便。注意到jute的session是不占服务器资源的哦(Jute新发明之一)
2.然后将乱数的加密串传递给另一个程序(专门根据加密串生成图片),将乱数显示成图片给用户看;
用户点击登陆后,服务器会将输入的code和session里的code对比。
3.code过期时间,每个临时生成的乱数只能用90s(可调),这样即方便用户登陆,如果输错密码,可以倒退再来过,有过期时间也不能被机器人来利用。
4.事实上,即使代码被反编译,看了算法也不能破解这个登录安全码。
5.另外,jute的算法并不会生成一大堆图片文件,大家看到xxxxxxxxxxxxxxxxxx.gif事实上只是一个假象啦,如果每个jute都生成一堆图片,即使定时清理,对服务器的消耗也是很大的。Jute可是非常爱惜服务器的。


rainman edited on 2004-01-10 06:05


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
SimonLei



CJSDN高级会员


发贴: 288
积分: 100
于 2002-11-27 08:08 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Jute的session不占用服务器资源这个怎么讲?Thanks.


You may say I am a dreamer, But I am not the only one.
My blog+wiki: http://blogsite.3322.org/
作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:SimonLei]
SimonLei



CJSDN高级会员


发贴: 288
积分: 100
于 2002-11-27 08:10 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
SimonLei wrote:
Jute的session不占用服务器资源这个怎么讲?Thanks.


明白了,你是指放在cookie当中,所以生成的这个乱数不占用服务器资源。呵呵



You may say I am a dreamer, But I am not the only one.
My blog+wiki: http://blogsite.3322.org/
作者 呵呵,差不多哦 [Re:SimonLei]
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-11-27 08:52 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
cookie的值是加密的,修改一个字符都不行。



作者 cool [Re:rainman]
via



发贴: 0
积分: 0
于 2002-11-27 11:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
很好的创意!


作者 我也看看第二条 [Re:rainman]
九佰



版主


发贴: 983
积分: 126
于 2002-11-27 11:06 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
netboy



发贴: 0
积分: 0
于 2002-11-27 17:02 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我也要看看。



作者 不错 [Re:rainman]
s2s



发贴: 0
积分: 0
于 2002-11-27 17:58 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
nice idea。我也做了一个 perl 的。不过是生成临时图片文件的,图片本身也有时效性。login 页面不会被频繁使用,图片文件也很小,用 cronjob 清理过期的图片对服务器的消耗可以忽略不计的。

哈,发贴了才看得隐藏的东东。

perl 跟 java 不一样,实现的方式不一样但意思一样的。


s2s edited on 2002-11-27 18:03

作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
neosun



发贴: 0
积分: 0
于 2002-11-27 18:17 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
q1q


作者 偶也要看 [Re:SimonLei]
snowbug



CJSDN高级会员


发贴: 418
积分: 130
于 2002-11-27 22:26 user profilesend a private message to usersend email to snowbugsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



作者 Re:不错 [Re:s2s]
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-11-27 22:31 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
生成临时图片也不错啊,不过这样生成图片得在login页面出来前哦。偶这种方法是并行的。偶就是不太喜欢一堆文件啊,crond执行的权限有些用户没有,不过可以做在登录程序里,1个小时清理一次。嗯,用Perl,PHP得加装GD模块吧?另外ImageMagick也很好啊,不需要X-windows启动就支持,都支持perl,java。不过偶没有采用,因为我首先要求解决方案必须是pure java的。



作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
javait



CJSDN高级会员


发贴: 84
积分: 60
于 2002-11-28 06:39 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
kan 1 kan


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman] [Re:rainman]
snobi



发贴: 0
积分: 0
于 2002-12-03 10:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看看


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
qqcat



发贴: 0
积分: 0
于 2002-12-04 22:39 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
很好的创意,可惜我看不到。


作者 xxxxxxxxxxx.gif [Re:qqcat]
via



发贴: 0
积分: 0
于 2002-12-05 10:02 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
5.另外,jute的算法并不会生成一大堆图片文件,大家看到xxxxxxxxxxxxxxxxxx.gif事实上只是一个假象啦,如果每个jute都生成一堆图片,即使定时清理,对服务器的消耗也是很大的。Jute可是非常爱惜服务器的。

--xxxxxxxxxxx.gif是怎么实现的?
能说一下思路吗



作者 Re:xxxxxxxxxxx.gif [Re:via]
rainman

阿熊

元老


发贴: 5644
积分: 454
于 2002-12-05 10:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
用pathinfo读点号前的数啊,那些数是有含义的。



作者 lll [Re:rainman]
sarkara





发贴: 3
积分: 0
于 2002-12-05 10:20 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
ll


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
enoch





发贴: 35
积分: 20
于 2002-12-05 12:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
学习



作者 see [Re:rainman]
mx0122



发贴: 0
积分: 0
于 2002-12-05 13:35 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



作者 kk? [Re:rainman]
shyguy



发贴: 0
积分: 0
于 2002-12-09 16:55 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
kankan


作者 kk [Re:rainman]
floater

Java Jedi

总版主


发贴: 3233
积分: 421
于 2002-12-09 23:38 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



作者 look [Re:rainman]
libinbin





发贴: 177
积分: 77
于 2002-12-10 15:19 user profilesend a private message to usersend email to libinbinsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
look


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
morchory

Neo

Jute Pro User


发贴: 150
积分: 60
于 2002-12-11 02:18 user profilesend a private message to usersend email to morchorysearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
kan e kan


作者 look [Re:rainman]
ryanzhou



发贴: 0
积分: 0
于 2002-12-11 08:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
look


作者 let me see [Re:rainman]
mleeee





发贴: 58
积分: 30
于 2002-12-11 10:06 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



allTheBest

mleeee

--------------------------------------------------
javaTheBestSoFar

作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
skyknight



发贴: 0
积分: 0
于 2002-12-16 11:01 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
see


作者 see [Re:rainman]
menzy



版主


发贴: 754
积分: 113
于 2002-12-16 13:29 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
good


作者 Re:rainman [Re:rainman]
mild7



发贴: 0
积分: 0
于 2002-12-18 19:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
看看。


作者 Re:Jute是如何生成登陆时校验用的安全码的? [Re:rainman]
xyeon



发贴: 0
积分: 0
于 2002-12-19 12:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
hide?


作者 偶要看 [Re:rainman]
绿颖



发贴: 0
积分: 0
于 2002-12-20 09:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
偶要看


go to first page go to previous page  1   2  go to next page go to last page

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923