[SOLVED] Encrypted Password

This is a discussion on "[SOLVED] Encrypted Password" within the Classic ASP section. This forum, and the thread "[SOLVED] Encrypted Password are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jan 2nd, 2008, 06:43
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
[SOLVED] Encrypted Password

I don't know if this is done through server side scripting (ASP/PHP) or maybe Javascript, but since this forum (PHP) is so popular, I posted it here to get some fast feedback

Ok, I have downloaded an ASP Forum from Web Wiz Guide and I went behind the forum code to see how they coded some "thing". It came to my attention to see how they manage to do the Encrypted Password.

Situation:

When we successfully register to the system (Username & Password), and went to the database to see the password field, all I can see is some numbers and alphabets combination.

My password is: monie, but in the database it displays this:

BC2BFC83DBD77018D12B980BE82933332B99977A

This is really a secure way of storing a password! Even the Admin guy of the forum doesn't know the user password!

So my typical simple direct question is, How to do that?

Thanks in advance.
Cheers...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 2nd, 2008, 06:51
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Encrypted Password

That "Hash" it.

Basically hashing is a one-way encryption method.. The most popular are MD5 SHA1 and SHA2..

They take a string and encrypt it into a uniform length..... Most scripting languages include an implementation of these algorithms...

MySQL has it as a password function

Code: Select all
INSERT INTO table VALUES (PASSWORD('monie'), username)
PHP makes it even easier

PHP: Select all



$hash 
md5('monie');

$hash sha1('monie'); 
I assume ASP has one as well

It will not be retrievable....
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 2nd, 2008, 07:02
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

Thanks Rakuli.

That means we need to Encrypt the password before saving them to the database, right?
What about the login page, will the password field recognize the Encrypted password?
Or do we need to Decrypt them?

Thanks.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 2nd, 2008, 07:05
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Encrypted Password

You can never actually decrypt them, it is one way only.

When you are checking passwords, you are comparing hashes rather than passwords. You has the password first and the check it against the database value.

in mysql this would be

Code: Select all
SELECT username FROM table WHERE password = PASSWORD('monie')
Or in PHP

PHP: Select all



if (md5('monie') == $password)
    echo 
'Password is okay!'
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jan 2nd, 2008, 07:18
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

OK, let me search for the ASP Hash Algorithm first

EDIT: Found it, using MD5. I will look into it tonight. Thanks Rakuli! I'll get back to you ASAP
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

Last edited by Monie; Jan 2nd, 2008 at 08:04.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jan 3rd, 2008, 00:41
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

Ok, I manage to do it using MD5. What you need to do is download the MD5.asp file and include then on top of your page (verify page and register form page)

HTML: Select all
 <!--#include file="MD5.asp"-->
 ..
 ..
Password = MD5(Request.Form("txtPassword"))
Thanks Rakuli
Cheers...

P/S: Could you move this thread to ASP? Thanks.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jan 3rd, 2008, 00:48
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Encrypted Password

ASP has hardly any built in functions!
You'd probably have to download like 200 files to get the functions for a forum.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jan 3rd, 2008, 01:18
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

As a matter of fact, ASP do have some built in function!Hai Alex. Just want to ask you
Do you mean when using MD5 in PHP, you just use the md5(textHere)? No other file needed? Include?

Cool..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jan 3rd, 2008, 01:41
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Encrypted Password

Yes you can do that, among a few other encryption functions.
Thanks for those links though!
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jan 3rd, 2008, 01:55
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

Cool...

In asp you need to download one asp file, named md5.asp (few hundred lines of code) just to use the MD5 Algorithm!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jan 3rd, 2008, 02:56
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Encrypted Password

Quote:
Cool...

In asp you need to download one asp file, named md5.asp (few hundred lines of code) just to use the MD5 Algorithm!
It takes the same amount of lines but PHP is open source and md5 was long ago built into the core of the Zend Engine... ASP evolution is somewhat slower.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jan 3rd, 2008, 03:06
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

This encrypted password cannot be reversed engineered, aren't they?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Jan 3rd, 2008, 03:18
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: Encrypted Password

Md5 is one way yes. It cannot be reversed.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Jan 3rd, 2008, 03:40
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Encrypted Password

Nice!
Thanks Alex!
Thanks Rakuli!

Cheers..
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Forgot password and Change password PHP script Chono PHP Forum 4 May 16th, 2008 09:13
[SOLVED] Spry password confirmation widget in DW CS3 grandadbob Scripts and Online Services 5 Nov 30th, 2007 18:34
[SOLVED] Connection string for password protected databases alexgeek Classic ASP 6 Oct 31st, 2007 15:59
need help with password VanHype JavaScript Forum 2 May 24th, 2007 12:05
[SOLVED] password protection Anonymous User Web Page Design 2 Feb 7th, 2005 18:05


All times are GMT. The time now is 22:12.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved