Tampaknya tidak ada banyak metode enkripsi di ASP. Sekarang, berdasarkan informasi senior, fungsi enkripsi dan dekripsi disortir dalam ASP.
rsa.asp
<%
REM mengimplementasikan enkripsi dan dekripsi di ASP, metode enkripsi: Menurut RSA
REM Kontak: [email protected]
Classclsrsa
PublicPrivateKey
PublicPublickey
Publicmodulus
PublicFunctionCrypt (plngmessage, plngkey)
OnerrorresumeNext
Dimllngmod
Dimllngresult
Dimllngindex
IfplngkeyMod2 = 0then
llngresult = 1
Forllngindex = 1toplngkey/2
llngmod = (plngmessage^2) modmodulus
'ModMayErroronKeyGeneration
llngresult = (llngmod*llngresult) modmodulus
Iferrthenexitfunction
Berikutnya
Kalau tidak
llngresult = plngmessage
Forllngindex = 1toplngkey/2
llngmod = (plngmessage^2) modmodulus
OnerrorresumeNext
'ModMayErroronKeyGeneration
llngresult = (llngmod*llngresult) modmodulus
Iferrthenexitfunction
Berikutnya
Endif
Crypt = llngresult
Fungsi endfungsi
PublicFunctionEncode (ByValpStrMessage)
Dimllngindex
DimllngmaxIndex
DIMLBYTASCII
Dimllngencrypted
llngmaxIndex = len (pStrMessage)
IfllngmaxIndex = 0ThenexitFunction
Forllngindex = 1tollngmaxIndex
lbytascii = ASC (mid (pstrmessage, llngindex, 1))
llngencrypted = crypt (lbytascii, publickey)
Encode = Encode & NumberToHex (llngencrypted, 4)
Berikutnya
Fungsi endfungsi
PublicFunctionDecode (BYVALPSTRMessage)
DIMLBYTASCII
Dimllngindex
DimllngmaxIndex
DimllngencryptedData
Decode = ""
llngmaxIndex = len (pStrMessage)
Forllngindex = 1tollngmaxIndexstep4