FTP Serv-U密码问题 - 中国WEB开发者网络 (http://www.webasp.net) -- 技术教程 (http://www.webasp.net/article/) --- FTP Serv-U密码问题 (http://www.webasp.net/article/15/14533.htm) |
| -- 作者:未知 -- 发布日期: 2004-11-04 |
| 我们利用Serv-U的obdc功能,可以把FTP用户信息存在数据库中,这样对Web操作方便了很多。ServU密码加密算法为随机码与MD5 32 位加密,例如:
两个随机字母:ab 用户输入密码:123456 生成的密码为:ab + MD5(ab123456) 'MD5代码略 <!--#include file=“md5.asp“--> <% Public function ServU(strpass) Randomize AA = chr(Int((97 - 122 + 1) * Rnd() + 122)) BB= lcase(chr(Int((65 - 90 + 1) * Rnd() + 90))) ServU = md5(AA & BB & strpass) ServU = AA & BB & ServU end function Pass=Request("md5") If Len(Pass)=0 Then Pass="Serv-U密码算法演示" %> <head> <title>Serv-U密码算法器</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style>BODY,TD,INPUT</style> </head> <body bgcolor="#FFFFFF" text="#000000"> <form name="md5pass" method="post" > 明文:<input type="text" name="md5" value="<%=Pass%>"> <input type="submit" name="Submit" value="提交"> </form> 散列:<input type=text size=34 maxlength=16 value='<%=ServU(Pass)%>'> |
| webasp.net |