<%@ Language = VBScript%>
<%
Response.Expires = 0
p = "abcdefg"
Set TestPWD = New CPassWord
TestPWD.EnPWD p
TestPWD.UnPWD TestPWD.ShowPWD(True)
k = TestPWD.ShowPWD(True)
l = TestPWD.ShowPWD(False)
Set TestPWD = Nothing
With Response
.Write "原文:" & p & "<br>"
.Write "加密后:" & k & "<br>"
.Write "解密后:" & L & "<br>"
End With
Class CPassWord
Private CEnPWD,CUnPWD
Private Function My_Hex(My_Hex_Source)
My_Hex = Hex(My_Hex_Source)
If Len(My_Hex) = 1 Then
My_Hex = "0" & My_Hex
End If
End Function
Private Function My_UnHex(My_UnHex_Source)
If Len(My_UnHex_Source) = 2 Then
Temp_Value = My_HexReplace(Left(My_UnHex_Source,1))
End If
My_UnHex = Temp_Value * 16 + My_HexReplace(Right(My_UnHex_Source,1))
End Function
Private Function My_HexReplace(My_HexReplace_Source)
If Asc(My_HexReplace_Source) > 64 Then
My_HexReplace = Asc(UCase(My_HexReplace_Source)) - 55
Else
My_HexReplace = Asc(My_HexReplace_Source) - 48
End If
End Function
Public Property Get ShowPWD(EnP)
' 输出.
If EnP Then
ShowPWD = CEnPWD
Else
ShowPWD = CUnPWD
End If
End Property
Sub EnPWD(EnPWD_Source)
if EnPWD_Source = "" then
CEnPWD = 0
Exit Sub
else
Randomize
Key = Rnd * 256
While Key = 0
Key = Rnd * 256
Wend
For i=1 To Len(EnPWD_Source)
Temp_String = Key Xor Asc(Mid(EnPWD_Source,i,1))
Crc = Crc + Temp_String
CEnPWD = CEnPWD + My_Hex(Temp_String)
Next
CEnPWD = My_Hex(Key) + StrReverse(CEnPWD) + My_Hex(Crc Mod 256)
End if
End Sub
Sub UnPWD(UnPWD_Source)
If Len(UnPWD_Source) < 6 Or Len(UnPWD_Source) Mod 2 = 1 then
CUnPWD = 0
Exit Sub
End If
Old_Key = My_UnHex(Left(UnPWD_Source,2))
Old_Crc = My_UnHex(Right(UnPWD_Source,2))
Old_String = StrReverse(Mid(UnPWD_Source,3,Len(UnPWD_Source)-4))
For i=1 To Len(Old_String) - 1 Step 2
Temp_Value = My_UnHex(Mid(Old_String,i,2))
Crc_Temp = Crc_Temp + Temp_Value
Temp_String = Temp_String + Chr(Temp_Value Xor Old_Key)
Next
If Old_Crc <> (Crc_Temp Mod 256) Then
CUnPWD = 403
Exit Sub
End If
CUnPWD = Temp_String
End Sub
End Class
%>
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]