home *** CD-ROM | disk | FTP | other *** search
/ 207.233.110.77 / 207.233.110.77.tar / 207.233.110.77 / vbasic / Crypt-DeCrypt.asp < prev    next >
Text File  |  2001-10-03  |  782b  |  34 lines

  1. <%
  2. ' This function takes a file name and/or path and encrypts it so that
  3. ' the user does not know the internal file structure of our web server
  4. Function Crypt(strTest)
  5.     Dim strTemp
  6.     Dim x
  7.     Dim y
  8.     For x = 1 to len (strTest)
  9.         y = asc(mid(strtest,x,1))
  10.         y = y + CInt(Session("seed"))
  11.         y = y XOR 255
  12.         strTemp = strTemp & chr(y)
  13.     next 'x
  14.     ' Set return value and exit function
  15.     Crypt = strTemp
  16. End Function
  17.  
  18. ' This function takes an encrypted file name and/or path and decrypts it.
  19. Function DeCrypt(strTest)
  20.     Dim strTemp
  21.     Dim x
  22.     Dim y
  23.     For x = 1 to len (strTest)
  24.         y = asc(mid(strtest,x,1))
  25.         y = y XOR 255
  26.         y = y - CInt(Session("seed"))
  27.         strTemp = strTemp & chr(y)
  28.     next 'x
  29.     ' Set return value and exit function
  30.     DeCrypt = strTemp
  31. End Function
  32. %>
  33.  
  34.