ASP imitation MD5 encryption algorithm

Source: Internet
Author: User
Tags chr decrypt md5 md5 encryption trim


Function Encrypt (ecode)
Dim Texts
Dim I
for I=1 to Len (ecode)
Texts=texts & CHR [ASC (MI   D (ecode,i,1)) +i)
Next
Encrypt = texts
End Function
Function decrypt (dcode)
Dim texts
  Dim i
for I=1 to Len (dcode)
Texts=texts & Chr (ASC (Mid dcode,i,1)-i)
Next
Decrypt=texts
End Function
Function Mistake (prestring)
Dim texts
Dim Seed
Dim I,length
Prestring = Trim (prestring)
length = Len (prestring)
seed = length
Randomize (length)
texts = ""
for i = 1 to length
seed = Int (94*rnd (-ASC (mid prestring,i,1)-seed*asc (right (prestring,1)) +32)
Texts = texts & Amp Chr (Seed) & Chr (int (94*rnd (-seed) +32))
Next
Dim dist
Dist= ""
For i = 1 to len (texts)
I F Mid (texts,i,1) <> "'" Then
Dist=dist+mid (texts,i,1)
End If
Next
mistake = Dist
en D function

Function Mistake (prestring)
Dim texts
Dim seed
Dim I,length
prestring = Trim (prestring)
length = Len (prestring)
Seed = length
Randomize (length)
Texts = ""
For i = 1 to length
seed = Int (94*rnd (-ASC (mid prestring,i,1)-seed*asc (right (prestring,1))) +32)
Texts = texts & Chr (SEED) & Chr (int (94*rnd (-seed) +32))
Next
Response. Write (texts)
Response. End ()
Dim dist
Dist= ""
For i = 1 to len (texts)
If Mid (texts,i,1) <> "'" Then
Dist=dist+mid (texts,i,1)
End If
Next
Mistake = Dist
End Function

Function Enpas (CODESTR)

Dim Codelen
Dim Codespace
Dim NEWCODE,CECR,CECB,CEC

Codelen = 30
Codespace = Codelen-len (CODESTR)

If not Codespace < 1 Then
For CECR = 1 to Codespace
Codestr = codestr & Chr (21)
Next
End If

Newcode = 1

Dim Been
For CECB = 1 to Codelen
Been = Codelen + ASC (Mid (codestr,cecb,1)) * CECB
Newcode = Newcode * Been
Next

Codestr = Newcode
Newcode = Empty

For CEC = 1 to Len (CODESTR)
Newcode = Newcode & Cfscode (Mid (codestr,cec,3))
Next

For CEC = to Len (newcode)-2
Enpas = Enpas & Mid (newcode,cec,1)
Next

End Function

Function Cfscode (word)
 dim cc
 for cc = 1 to Len (Word)
 cfscode = Cfscode & Asc (Mid Wor d,cc,1))
 next
 cfscode = Hex (cfscode)
End Function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.