當前位置:開發者網絡 >> 技術教程 >> ASP教程 >> 安全加密 >> 內容
精彩推薦
分類最新教程
分類熱點教程
    
Serv-U軟件密碼加密函數
作者:未知
日期:2004-07-01
人氣:
投稿:xiaxia(轉貼)
來源:未知
字體:
收藏:加入瀏覽器收藏
以下正文:
<!--#include file="Md5.asp"-->
<%
'==================================================
'函數名:ServUPassEnCode
'作 用:Serv-U軟件密碼加密函數
'參 數:strPass ------ 字符串
'作 者:netyum(楊嵩)
'時 間:2004年6月28日
'==================================================
Function SerUPassEnCode(strPass)
Dim Char1,Char2,Seed,prePass,EncodePass,FinalPass
If IsNull(strPass) Or strPass="" Then Exit Function
Char1 = Chr(Rand(97,122))
Char2 = Chr(Rand(97,122))
Seed = Char1 & Char2
prePass = Seed & strPass
EnCodePass = Ucase(md5(prePass)) '32位md5
FinalPass = Seed & EnCodePass
SerUPassEnCode = FinalPass
End Function

'==================================================
'函數名:Rand
'作 用:取兩個整數之間的隨機數
'參 數:n,m ------ 整數
'作 者:netyum(楊嵩)
'時 間:2004年6月28日
'==================================================
Function Rand(n,m)
Dim a,b,t
a = n : b = m
If b < a Then t = b : b = a : a = t
Randomize
Rand = Int(rnd*(b-a+1)+a)
End Function
%>

相關文章: