我有一個加密方法,歡迎大家指正
發(fā)表時間:2024-05-29 來源:明輝站整理相關軟件相關文章人氣:
[摘要]<%IF Request("Action")=1 thenDim String,StringLen,i,StringNumTmp,StringRndNum,ResultString,jString = Request("Pass") ...
<%
IF Request("Action")=1 then
Dim String,StringLen,i,StringNumTmp,StringRndNum,ResultString,j
String = Request("Pass") '密碼字符串
'開始計算字符數(shù)據(jù)
StringLen = Len(String)
For i = 1 to StringLen
StringNumTmp = Asc(Mid(String,i,1))
Randomize
StringRndNum=Int((18-1)*Rnd+1)
if Len(StringNumTmp + StringRndNum) < 3 then
For j = 1 to 3 - Int(Len(StringNumTmp + StringRndNum))
StringNumber = "0" & (StringNumTmp + StringRndNum)
Next
Else
StringNumber = StringNumTmp + StringRndNum
End if
ResultString = ResultString & Chr(StringNumTmp - StringRndNum) & StringNumber
Next
Response.write "加密后結(jié)果:" & ResultString '輸出結(jié)果
%>
<BR>
<%
'開始破解
For i = 1 to Len(ResultString) Step 4
PString = Left(Mid(ResultString,i,4),1)
PStringNum1 = Asc(PString)
PStringNum2 = Int(Right(Mid(ResultString,i,4),3))
PStringNum = (PStringNum1 + PStringNum2) / 2
PString1 = PString1 & Chr(PStringNum)
Next
Response.write "破解后結(jié)果:" & PString1
End if
%>
<Form method="post" action="ttt.asp?action=1">
<input type=password name="pass" size=15><input type=submit>
</form>