Md5加密源文件

将以下代码另存为md5.asp
<%
电极铜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 vr漫游
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)
rotateleft = lshift(lvalue, ishiftbits) or rshift(lvalue, (32 - ishiftbits))
end function
private function addunsigned(lx, ly)
dim lx4
dim ly4
dim lx8
dim ly8
dim lresult
lx8 = lx and &h80000000
ly8 = ly and &h80000000
lx4 = lx and &h40000000
ly4 = ly and &h40000000
lresult = (lx and &h3fffffff) + (ly and &h3fffffff)
if lx4 and ly4 then
lresult = lresult xor &h80000000 xor lx8 xor ly8
elseif lx4 or ly4 then
if lresult and &h40000000 then
lresult = lresult xor &hc0000000 xor lx8 xor ly8
else
lresult = lresult xor &h40000000 xor lx8 xor ly8
end if
else
lresult = lresult xor lx8 xor ly8
end if
addunsigned = lresult
end function
private function md5_f(x, y, z)
md5_f = (x and y) or ((not x) and z)
end function
private function md5_g(x, y, z)
md5_g = (x and z) or (y and (not z))
end function
private function md5_h(x, y, z)
md5_h = (x xor y xor z)
end function
private function md5_i(x, y, z)
md5_i = (y xor (x or (not z)))
end function
private sub md5_ff(a, b, c, d, x, s, ac)
a = addunsigned(a, addunsigned(addunsigned(md5_f(b, c, d), x), ac))
a = rotateleft(a, s)
a = addunsigned(a, b)
end sub
private sub md5_gg(a, b, c, d, x, s, ac)
a = addunsigned(a, addunsigned(addunsigned(md5_g(b, c, d), x), ac))
a = rotateleft(a, s)
a = addunsigned(a, b)
end sub
private sub md5_hh(a, b, c, d, x, s, ac)
a = addunsigned(a, addunsigned(addunsigned(md5_h(b, c, d), x), ac))
a = rotateleft(a, s)
a = addunsigned(a, b)
end sub
private sub md5_ii(a, b, c, d, x, s, ac)
a = addunsigned(a, addunsigned(addunsigned(md5_i(b, c, d), x), ac))
a = rotateleft(a, s)
a = addunsigned(a, b)
end sub
private function converttowordarray(smessage)
dim lmessagelength
dim lnumberofwords
dim lwordarray()
dim lbyteposition
dim lbytecount
dim lwordcount
const modulus_bits = 512
const congruent_bits = 448
lmessagelength = len(smessage)
lnumberofwords = (((lmessagelength + ((modulus_bits - congruent_bits) \ bits_to_a_byte)) \ (modulus_bits \ bits_to_a_byte)) + 1) * (modulus_bits \ bits_to_a_word)
redim lwordarray(lnumberofwords - 1)
lbyteposition = 0
lbytecount = 0
do until lbytecount >= lmessagelength
lwordcount = lbytecount \ bytes_to_a_word
lbyteposition = (lbytecount mod bytes_to_a_word) * bits_to_a_byte
lwordarray(lwordcount) = lwordarray(lwordcount) or lshift(asc(mid(smessage, lbytecount + 1, 1)), lbyteposition)
lbytecount = lbytecount + 1
loop
lwordcount = lbytecount \ bytes_to_a_word
微区扫描电化学工作站
lbyteposition = (lbytecount mod bytes_to_a_word) * bits_to_a_byte
lwordarray(lwordcount) = lwordarray(lwordcount) or lshift(&h80, lbyteposition)
lwordarray(lnumberofwords - 2) = lshift(lmessagelength, 3)
lwordarray(lnumberofwords - 1) = rshift(lmessagelength, 29)
converttowordarray = lwordarray
end function
private function wordtohex(lvalue)
dim lbyte
dim lcount
for lcount = 0 to 3
lbyte = rshift(lvalue, lcount * bits_to_a_byte) and m_lonbits(bits_to_a_byte - 1)
wordtohex = wordtohex & right("0" & hex(lbyte), 2)
next
end function
public function md5(smessage)
m_lonbits(0) = clng(1)
m_lonbits(1) = clng(3)
m_lonbits(2) = clng(7)
m_lonbits(3) = clng(15)
m_lonbits(4) = clng(31)
m_lonbits(5) = clng(63)
m_lonbits(6) = clng(127)
m_lonbits(7) = clng(255)
m_lonbits(8) = clng(511)
m_lonbits(9) = clng(1023)
m_lonbits(10) = clng(2047)
m_lonbits(11) = clng(4095)
m_lonbits(12) = clng(8191)
m_lonbits(13) = clng(16383)
m_lonbits(14) = clng(32767)
m_lonbits(15) = clng(65535)
m_lonbits(16) = clng(131071)
m_lonbits(17) = clng(262143)
m_lonbits(18) = clng(524287)
m_lonbits(19) = clng(1048575)
m_lonbits(20) = clng(2097151)
m_lonbits(21) = clng(4194303)
m_lonbits(22) = clng(8388607)
m_lonbits(23) = clng(16777215)
m_lonbits(24) = clng(33554431)
m_lonbits(25) = clng(67108863)
m_lonbits(26) = clng(134217727)
m_lonbits(27) = clng(268435455)
m_lonbits(28) = clng(536870911)
m_lonbits(29) = clng(1073741823)
m_lonbits(30) = clng(2147483647)

本文发布于:2024-09-22 13:43:58,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/1/322801.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:神仙   电化学   连接   药剂   树学   扫描
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议