easy way to do basic querystring encryption?

  • Thread starter Thread starter Jason Shohet
  • Start date Start date
J

Jason Shohet

I'm getting a URL w/ a querystring coming in to start my app.
In session_start, I was thinking of scrambling that querystring to keep it
from prying eyes....
Any ideas?
Doesn't need to be fullproof, just quick and dirty :) ty jason shohet
 
i downloaded it but can't seem to find the encryption class file :) In fact
i don't see any dll's, or .cs files, just .pas & .dpk files, whatever those
are.
Not sure how to use that in my asp.net / c# codebehind environment

TY
 
Sorry for untidy code, yet I used it for a specific task of en/decrypting longs.

Public Shared Function Encode(ByVal cnum As Long) As String
Dim i0 As Long
Dim e As Long
Dim tcnum As Long
Dim pos As Integer, a As Integer
Dim str As String
Dim i As Integer

Randomize()
i0 = CInt(Int(26 * Rnd()))
str = Chr(Asc("A") + i0)
e = 29
tcnum = cnum Xor &H55555555
pos = i0
For i = 0 To 7
a = tcnum Mod 16
pos = (pos + a * e) Mod 26
str &= Chr(Asc("A") + pos)
tcnum = Int(tcnum / 16)
Next
Return str
End Function

Public Shared Function Decode(ByVal str As String) As Long
Dim i As Integer
Dim tcnum As Long
Dim a As Integer
tcnum = 0
For i = str.Length - 1 To 1 Step -1
tcnum *= 16
a = (Asc(str.Chars(i)) - Asc(str.Chars(i - 1)) + 26) Mod 26
a = (a + (a Mod 3) * 26) / 3
tcnum += a
Next i
Return (tcnum Xor &H55555555)
End Function
 
i downloaded it but can't seem to find the encryption class file :)
In fact i don't see any dll's, or .cs files, just .pas & .dpk files,
whatever those are.
Not sure how to use that in my asp.net / c# codebehind environment


The files were built with Borland Delphi .NET

Just use the DLLs in the BIN directory.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top