ASP实现MD5加密的问题
我用的是动网论坛的MD5.ASP
<%
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
.
..
...
....
.....
End Function
%>
--------------------------------
<%
<!--#include file= "md6.asp "-->
dim kaishi,dier
kaishi= "passwd "
dier=MD5(kaishi,16)
response.write "加密后是: "&dier
%>
调用出现的错误提示:
错误类型:
Microsoft VBScript 运行时错误 (0x800A000D)
类型不匹配: 'MD5 '
/a/a.asp, 第 6 行
请问各位如何调用,谢谢。
------解决方案-------------------- <!--#include file= "md6.asp "--> //为何是md6 ????
dim kaishi,dier
kaishi= "passwd "
dier=MD5(kaishi,16)
response.write "加密后是: "&dier
%>
------解决方案-------------------- <%
<!--#include file= "md6.asp "-->
dim kaishi,dier
kaishi= "passwd "
dier=MD5(kaishi,16)
response.write "加密后是: "&dier
%>
---------------------------?????
应该是这样吧
<!--#include file= "md5.asp "-->
<%
dim kaishi,dier
kaishi= "passwd "
dier=MD5(kaishi,16)
response.write "加密后是: "&dier
%>
把 <!--#include file= "md5.asp "--> 放在 <% --%> 的外面
------解决方案--------------------MicrosoftVBscript运行时错误(0x800A000D)--> 错误引用rs变量(rs对像已关闭或未定义)?
到底是什么错误提示啊
这个错误提示是数据库错误问题了
------解决方案--------------------给你这个,可以进行16和32位的加密
<%
Private Const BITS_TO_A_BYTE = 8
Private Const BYTES_TO_A_WORD = 4
Private Const BITS_TO_A_WORD = 32
Private m_lOnBits(30)
Private m_l2Power(30)
Private Function LShift(lValue, iShiftBits)
If iShiftBits = 0 Then
LShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And 1 Then
LShift = &H80000000
Else
LShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
If (lValue And m_l2Power(31 - iShiftBits)) Then
LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000
Else
LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))
End If
End Function
Private Function RShift(lValue, iShiftBits)
If iShiftBits = 0 Then
RShift = lValue
Exit Function
ElseIf iShiftBits = 31 Then
If lValue And &H80000000 Then
RShift = 1
Else
RShift = 0
End If
Exit Function
ElseIf iShiftBits < 0 Or iShiftBits > 31 Then
Err.Raise 6
End If
RShift = (lValue And &H7FFFFFFE) \ m_l2Power(iShiftBits)
If (lValue And &H80000000) Then
RShift = (RShift Or (&H40000000 \ m_l2Power(iShiftBits - 1)))
End If
End Function
Private Function RotateLeft(lValue, iShiftBits)