Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try this:</p> <pre class="lang-vb prettyprint-override"><code>' Encrypt and decrypt functions for classic ASP (by TFI) '********* set a random string with random length *********** cryptkey = "GNQ?4i0-*\CldnU+[vrF1j1PcWeJfVv4QGBurFK6}*l[H1S:oY\v@U?i,oD]f/n8oFk6NesH--^PJeCLdp+(t8SVe:ewY(wR9p-CzG&lt;,Q/(U*.pXDiz/KvnXP`BXnkgfeycb)1A4XKAa-2G}74Z8CqZ*A0P8E[S`6RfLwW+Pc}13U}_y0bfscJ&lt;vkA[JC;0mEEuY4Q,([U*XRR}lYTE7A(O8KiF8&gt;W/m1D*YoAlkBK@`3A)trZsO5xv@5@MRRFkt\" '**************************** ENCRYPT FUNCTION ****************************** '*** Note: bytes 255 and 0 are converted into the same character, in order to '*** avoid a char 0 which would terminate the string function encrypt(inputstr) Dim i,x outputstr="" cc=0 for i=1 to len(inputstr) x=asc(mid(inputstr,i,1)) x=x-48 if x&lt;0 then x=x+255 x=x+asc(mid(cryptkey,cc+1,1)) if x&gt;255 then x=x-255 outputstr=outputstr&amp;chr(x) cc=(cc+1) mod len(cryptkey) next encrypt=server.urlencode(replace(outputstr,"%","%25")) end function '**************************** DECRYPT FUNCTION ****************************** function decrypt(byval inputstr) Dim i,x inputstr=urldecode(inputstr) outputstr="" cc=0 for i=1 to len(inputstr) x=asc(mid(inputstr,i,1)) x=x-asc(mid(cryptkey,cc+1,1)) if x&lt;0 then x=x+255 x=x+48 if x&gt;255 then x=x-255 outputstr=outputstr&amp;chr(x) cc=(cc+1) mod len(cryptkey) next decrypt=outputstr end function '**************************************************************************** Function URLDecode(sConvert) Dim aSplit Dim sOutput Dim I If IsNull(sConvert) Then URLDecode = "" Exit Function End If 'sOutput = REPLACE(sConvert, "+", " ") ' convert all pluses to spaces sOutput=sConvert aSplit = Split(sOutput, "%") ' next convert %hexdigits to the character If IsArray(aSplit) Then sOutput = aSplit(0) For I = 0 to UBound(aSplit) - 1 sOutput = sOutput &amp; Chr("&amp;H" &amp; Left(aSplit(i + 1), 2)) &amp; Right(aSplit(i + 1), Len(aSplit(i + 1)) - 2) Next End If URLDecode = sOutput End Function </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload