Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - hash coding password
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

hash coding password

 Post Reply Post Reply
Author
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Topic: hash coding password
    Posted: 16 March 2005 at 12:31am

I have a table in my access database with usernames and passwords. I want to store the passwords in encrypted form. All codes I found on the net were based on asp .net or required installing a component that had to be bought like aspEncrypt. Is there a code I can use in asp vb script to store the passwords in encrypted form?

Thanks.
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2005 at 1:03am
you could do a series of replaces when a password is entered so that it converts say, "password" to "wnggtcrs" as in replace p with w, a with n, s with g... that kind of thing. That would mean that the database would contain only nonsense passwords that someone who couldnt see the asp replace code wouldn't have the real password.
 
Something like this would do you:
 
var passwordvariable
passwordvariable = request.form("passwordfield")
passwordvariable = Replace(passwordvariable, "a", "b")
the above would replace all a's in the password with b's...
 
It would mean you would have to do a replace line of code for every single valid character... but the chances of breaking a replacement cypher on something as short as a password is fairly low.
 
You could add another level (no idea what the syntax would be, or if it is even possible - suggestions anyone) and basically have a different replacement cypher depending on the number of characters in the password, which would make it harder again if someone gt their hands on your database.
 
As for an encrypt using matrices, it would be a matter of creating a number of variables (dependant on the number of characters in the pw), assign the letters of the pw to those variables after converting them to number form, and then doing the whole matrix multiplication thing which i for the life of me can't remember. The you'd have a problem with getting the numbers to string together one after another instead of just adding up, though it is possible.
 
regardless of what type ou wanted to use if any you would just have the post-cypher password in your database. again, that assumes that you're just wanting to stop people from getting login details from looking at the db... if they could see the asp it'd just take them a few minutes to track down and determine a replace cypher. On the other hand, even if someone had the matrix cypher, they'd have to recognise the code as a vb version of a matrix, then work out the reverse cypher. Even then i they could only see one of the asp or db, it'd be no help to them.
 
I hope that at least gave you some ideas. Anything more complex than that and you'd probably need to spend more time than was worth it considering the cost of buying an encryption. That's probably the case for the matrix cypher, because that's as complex as hell, and its liekly that that is the kind of cypher that you'd be paying for with aspEncrypt, considering most (ass cover, cos there may be something new i don't know of) modern cyphers are matrix cyphers.
 
 
oh, and you'd have to do the replace when doing anything with the password, whether it be validating or creating it...


Edited by ub3rl337ch3ch - 16 March 2005 at 1:08am
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2005 at 1:22am
or check out how WWF does it.

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2005 at 6:24am
i would recommend using WWF style

if the password is ok to be entered an not retriveable into its orginal state.

it encodes it in a way that you have to compare the passwords after the enterd password is encrypted, to see if both encrypted versions match if so then the password the user entered is correct .

if you want 2 way encryption i would recommend trying ub3rl337ch3c

But changeing it into P etc will also have implications because you may change A to P, but when reversing the encryption you will get a different response. you will have to decrypt it in reverse order
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 16 March 2005 at 9:31am
Best way is as DJ air stated.  Store the password in it's MD5 form (lots of free code snippets out there that do this).  Make sure to use a salt, some articles on 4guys on that.
Back to Top
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2005 at 2:20am
Thanks..I used the MD5 way and got it done
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.