Parece que no hay muchos métodos de cifrado en ASP. Ahora, según la información del senior, las funciones de cifrado y descifrado se resuelven en ASP.
rsa.asp
<%
REM implementa el cifrado y el descifrado en ASP, método de cifrado: según RSA
Contacto REM: [email protected]
Classclsrsa
Publicprivatekey
PublicPublicKey
Publicmodulus
PublicFunctionCrypt (plngMessage, plngkey)
OnerrorResumEnext
Dimllngmod
Dimllngresult
Dimllngindex
IfplngkiMod2 = 0then
llngresult = 1
Forllngindex = 1ToPlngkey/2
llngmod = (plngMessage^2) Modmodulus
'ModmayerroronKeyGeneración
llngresult = (llngmod*llngresult) Modmodulus
Iferrthenexitfunction
Próximo
Demás
llngresult = plngMessage
Forllngindex = 1ToPlngkey/2
llngmod = (plngMessage^2) Modmodulus
OnerrorResumEnext
'ModmayerroronKeyGeneración
llngresult = (llngmod*llngresult) Modmodulus
Iferrthenexitfunction
Próximo
Endif
Cripta = llngrresult
Función final
PublicFunctionEncode (ByValPrMessage)
Dimllngindex
DimllngmaxIndex
Dimlbytascii
Dimllngencrypted
llngmaxIndex = Len (PstrMessage)
IfllngmaxIndex = 0ThenExitFunction
Forllngindex = 1TollngmaxIndex
lbytascii = ASC (Mid (PstrMessage, Llngindex, 1))
llngencrypted = crypt (lbytascii, llave pública)
Encode = encode & numberToHex (llngencrypted, 4)
Próximo
Función final
PublicFunctionDecode (ByValPrMessage)
Dimlbytascii
Dimllngindex
DimllngmaxIndex
Dimllngencyeddata
Decode = ""
llngmaxIndex = Len (PstrMessage)
Forllngindex = 1TollngMaxIndexStep4