can MS SQL store passwords encrypted like MySQL?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rathlon
Forum Commoner
Posts: 45
Joined: Sun Nov 10, 2002 8:07 pm

can MS SQL store passwords encrypted like MySQL?

Post by rathlon »

Or should I use php to do the encryption? If I use php, will the password be stored as the encrypted value or as the plain text?
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

you can encrypt the text in php before sending it to the db. e.g.

Code: Select all

<?php
$password = md5($password);
?>
rathlon
Forum Commoner
Posts: 45
Joined: Sun Nov 10, 2002 8:07 pm

Post by rathlon »

right, but does this get stored in the database as plain text or the encrypted value? If its encrypted, will u have to use

$password = md5($password);

every time you want to compare it for a matched password?
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

it's stored as encrypted. which is a good thing for security reasons
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

and yes, you'll have to md5() any value you want to compare against it.

Mac
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Post by superwormy »

md5() is a hash function, its not encryption

and yes, you'll have to md5 what the user types in to compare it to the value in the database

if it was encrypted, you'd have to either decrypt the value in the database or encrypt the password they typed in to compare the two
rathlon
Forum Commoner
Posts: 45
Joined: Sun Nov 10, 2002 8:07 pm

Post by rathlon »

what exatly does the md5() function do as co pareed to the encrypting functions?
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

here is the rfc for the md5 algorithm: http://www.faqs.org/rfcs/rfc1321.html
Post Reply