By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,865 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,865 IT Pros & Developers. It's quick & easy.

easy way to do basic querystring encryption?

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
TJS
http://www.antoniob.com/projects/PUriQueryCrypt.aspx

"Jason Shohet" <__******@yahoo.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
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

Nov 18 '05 #2

P: n/a
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
Nov 18 '05 #3

P: n/a
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

--
Best regards,

Andrew P. Revinsky
"Jason Shohet" wrote:
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

Nov 18 '05 #4

P: n/a
"Jason Shohet" <__******@yahoo.com> wrote in
news:us**************@TK2MSFTNGP09.phx.gbl:
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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.