Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

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 ASP Free Forums Sponsor:
  #1  
Old March 7th, 2005, 05:15 AM
freeasphelp's Avatar
freeasphelp freeasphelp is offline
Beyond The Impossible
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Shawnee Mission, KS, USA
Posts: 921 freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level)freeasphelp User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 23 h 25 m 9 sec
Reputation Power: 6
Simple Encryption

A lot of people ask about encryption, well I found a great tutorial that explains a great encryption method. From what I have researched this encryption is XOR256.

While this says Password Encryption, the routine can be used to encrypt just about any text from URLs to cookies!

Encrypting Passwords with ASP

Update:

This method does have some quirks for example it can sometimes, depending on the output of an encrypted text, throw SQL query errors.

To solve this simple encode them using hex or base64.
I prefer using hex as it is less trouble some to decode. Here is a code sample that will show you how to do this:

String to ASCII Codes/ASCII Codes to String
Comments on this post
Lafinboy agrees: Nice link to a very clear and well explained function
banker agrees: Very clever. I good one to know about.
__________________
John Shepard
Beyond The Impossible
-----------------------------
Has a post helped you? Please show your apprecitation by clicking the
image in the right upper corner.
Posting code? Put your code between [code] and [/code] tags.
X-Login and X-Send

Last edited by freeasphelp : March 22nd, 2005 at 01:48 AM.

Reply With Quote
  #2  
Old March 7th, 2005, 06:12 PM
lewy's Avatar
lewy lewy is offline
Alter Ego Wizard
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Edinburg Tx
Posts: 4,376 lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)lewy User rank is General 6th Grade (Above 100000 Reputation Level)  Folding Points: 1009 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 1 Day 21 h 21 m 31 sec
Reputation Power: 1391
Ah, the good old encrypt_text function.
I abandoned this encryption function long time ago in favor of the MD5 encryption scheme used here
The Encrypt_Text has dissapointed me in the past due to the selection process by which users select their passwords. Some password combinations don't fare well with this function.
On the other hand, the MD5 function has not dissapointed me ever since I incorporated it into my login scripts, you can even use it in conjunction with URLs to keep spiders out of your site on secured portions of it.
Anyways, just my two cents after having used this function. With some dissapointment
__________________
................... ASCII and ye shall receive ..................
Knowledge is the only resource on earth that multiplies when shared


Support the Shemzilla Project
Powered by C#

Reply With Quote
  #3  
Old March 8th, 2005, 02:46 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 27,003 Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 17 h 17 m 4 sec
Reputation Power: 1572
nice code to know about indeed - moved this to the Code Help forum which would hold useful code samples from now on.
we can also point on this thread when someone ask for encryption help.

Reply With Quote
  #4  
Old June 7th, 2005, 07:19 AM
donkeyderby donkeyderby is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 19 donkeyderby User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 23 m 40 sec
Reputation Power: 0
Just found this thread while looking for a way to sanitise form data.

Would ASCII encoding form input prevent sql injection or can hex values also cause sql query errors? I thought that hex values could be used to inject sql or is this just via the querystring?

Reply With Quote
  #5  
Old June 7th, 2005, 09:25 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is online now
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 27,003 Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 9th Grade (Above 100000 Reputation Level)  Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342958 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 17 h 17 m 4 sec
Reputation Power: 1572
this is not relevant for sql injection attack. ascii/hex code are still only characters - the database does not care what characters you try to insert. only problem is with the single quote that must be replaced as it's the text delimeter.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Simple Encryption


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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway