يبدو أن هناك العديد من طرق التشفير في ASP. الآن ، استنادًا إلى معلومات الكبار ، يتم فرز وظائف التشفير والتشفير في ASP.
RSA.asp
<٪
تقوم REM بتنفيذ التشفير وفك التشفير في ASP ، طريقة التشفير: وفقًا لـ RSA
Rem Contact: [email protected]
ClassClsrsa
PublicPrivinkey
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 & numbertoex (llngencrypted ، 4)
التالي
الوظيفية
PublicFunctionDecode (ByValpStrMessage)
dimlbytascii
dimllngindex
dimllngmaxIndex
dimllngencrypteddata
فك التشفير = ""
llngMaxIndex = Len (pstrmessage)
forllngindex = 1tollngmaxIndexStep4