ASPには多くの暗号化方法がないようです。現在、シニアの情報に基づいて、暗号化と復号化関数はASPで整理されています。
rsa.asp
<%
REMはASPの暗号化と復号化を実装します、暗号化方法:RSAによると
REM連絡先:[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
次
それ以外
llngresult = plngmessage
forllngindex = 1toplngkey/2
llngmod =(plngmessage^2)modmodulus
onerrorresumenext
'modmayerroronkeygeneration
llngresult =(llngmod*llngresult)modmodulus
iferrthenexitfunction
次
endif
crypt = llngresult
エンド機能
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)
次
エンド機能
publicFunctionDecode(byValpStrMessage)
dimlbytascii
dimllngindex
dimllngmaxindex
dimllngencrypteddata
decode = ""
llngmaxindex = len(pstrmessage)
forllngindex = 1tollngmaxindexStep4