ASP에는 암호화 방법이 많지 않은 것 같습니다. 이제 선배의 정보를 기반으로 암호화 및 암호 해독 기능은 ASP에서 정렬됩니다.
rsa.asp
<%
REM은 ASP의 암호화 및 암호 해독을 구현합니다. 암호화 방법 : RSA에 따르면
REM 연락처 : [email protected]
classclsrsa
공공 시공식
공개 공화국
public -modulus
publicfunctionCrypt (plngmessage, plngkey)
onerrorresumenext
dimllngmod
Dimllngresult
dimllngindex
ifplngkeymod2 = 0then
llngresult = 1
OPLLNGINDEX = 1TOPLNGKEY/2
llngmod = (plngmessage^2) modmodulus
'ModMayerRorOnkeyGeneration
llngresult = (llngmod*llngresult) modmodulus
iferrthenexitfunction
다음
또 다른
llngresult = plngmessage
OPLLNGINDEX = 1TOPLNGKEY/2
llngmod = (plngmessage^2) modmodulus
onerrorresumenext
'ModMayerRorOnkeyGeneration
llngresult = (llngmod*llngresult) modmodulus
iferrthenexitfunction
다음
endif
crypt = llngresult
최종 기능 장애
PublicFunctionEncode (ByValpStrMessage)
dimllngindex
dimllngmaxindex
Dimlbytascii
dimllngencryped
llngmaxindex = len (pstrmessage)
ifllngmaxindex = 0thenexitFunction
OPLLNGINDEX = 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)
OPLLNGINDEX = 1TOLLNGMAXINDEXSTEP4