ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2003, 06:00 AM
leeolive leeolive is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London
Posts: 43 leeolive User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
encrypting a querystring

Hi

I have done a search on this and it seems to be a topic of some interest (700) views, but has not been fully explained.

I have a page which validates a username and password and then, if both are correct, the applicantid is retrieved and passed by querystring using a response.redirect. Apparently it would be wise to encrypt the applicantid when passing it.

Even if you can recommend a better way of passing the value, please could you still fully explain how to do the encryption.

<% else
strApplicantID = rsPandU("ApplicantID")
'Response.Write strApplicantID - this works
Response.Redirect "memberarea.asp?id=" & strApplicantID

Thanks, much appreciated!
Lee

Reply With Quote
  #2  
Old October 24th, 2003, 10:10 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
What's to fully explain ???

Simply do this:


<%
. . .
. .
.
lngID = objRst("ApplicantID")
.
. .
. . .
Response.Redirect "memberarea.asp?id=" & Encrypt(lngID)
%>

Now all you need to do is create your own Encrypt function
for example:


Function Encrypt(ByVal TheString)
Dim x, i, tmp
For i = 1 To Len( TheString )
x = Mid( Thestring, i, 1 )
tmp = tmp & Chr( Asc( x ) + 1 )
Next
tmp = StrReverse( tmp )
Encrypt = tmp
End Function

You will have to create a Decrypt() function that does the opposite such as

Function Decrypt(ByVal encryptedstring)
Dim x, i, tmp, final
encryptedstring = StrReverse( encryptedstring )
For i = 1 To Len( encryptedstring )
x = Mid( encryptedstring, i, 1 )
tmp = tmp & Chr( Asc( x ) - 1 )
Next
Decrypt = tmp
End Function

NOTE: This might need some tweeking and hasn't been tested...

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old November 3rd, 2003, 01:00 AM
leeolive leeolive is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London
Posts: 43 leeolive User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
URGENT - 5.30am please help!

Hi Vlince

Thanks for this.

I am trying to work out your encryption (5.30am) and I think my brain has passed it's expiry date.

I can't figure out the logistics of this - forgive me, I am new to asp.

I think that I have managed to encrypt the QS on the response.redirect. This value now gets passed by response.redirect to 'process.asp' with a link to another page called 'printinstructions.asp'.

This value now retrieved on 'process.asp' page now needs to be passed when the link is clicked. Where and how do I perform the de-encrypt? When the link is clicked before going to the page, or on body load of 'printinstructions.asp'? How do I do this?

Thanks, appreciate it!
Lee

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > encrypting a querystring


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT