PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > Password storage
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Password storage

Réponse
 
LinkBack Outils de la discussion
Vieux 18/08/2007, 10h44   #1
C K
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Password storage

Friends,
I have one question - How to store passwords in MySQL database table in a
secure way so that no one can see the password(understand the password
string)?
Please
Thanks
CPK

--
Keep your Environment clean and green.

  Réponse avec citation
Vieux 18/08/2007, 11h23   #2
Yoge
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

Use MD5 function to encrypt the password column

C K wrote:
> Friends,
> I have one question - How to store passwords in MySQL database table in a
> secure way so that no one can see the password(understand the password
> string)?
> Please
> Thanks
> CPK
>
>



--
Yoge,
AdventNet, Inc.
925-965-6528
yogendrav@adventnet.com
site24x7.com


  Réponse avec citation
Vieux 18/08/2007, 14h23   #3
Sudheer Satyanarayana
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

C K wrote:
> Friends,
> I have one question - How to store passwords in MySQL database table in a
> secure way so that no one can see the password(understand the password
> string)?
> Please
> Thanks
> CPK
>
>

mysql> create table test01 (pass varchar(32));
Query OK, 0 rows affected (0.00 sec)

mysql> insert into test01 values (md5('textpassword'));
Query OK, 1 row affected (0.01 sec)

mysql> select * from test01;
+----------------------------------+
| pass |
+----------------------------------+
| d1c7e2c37b0bb7d92548ac5594d00315 |
+----------------------------------+
1 row in set (0.00 sec)


The md5 function encrypts the input string.

---------
With Warm Regards,
Sudheer. S
www.binaryvibes.co.in
www.lampcomputing.com

  Réponse avec citation
Vieux 18/08/2007, 15h53   #4
C K
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

Thanks to all,
but the problem is that I am using external programs to insert data and I
can't use MySQL functions directly. Can I call/implement such type of
functions using MS Access 2003?
Thanks
CPK


>
>
> The md5 function encrypts the input string.
>
> ---------
> With Warm Regards,
> Sudheer. S
> www.binaryvibes.co.in
> www.lampcomputing.com
>
>



--
Keep your Environment clean and green.

  Réponse avec citation
Vieux 18/08/2007, 17h19   #5
Mogens Melander
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage


On Sat, August 18, 2007 15:53, C K wrote:
> Thanks to all,
> but the problem is that I am using external programs to insert data and I
> can't use MySQL functions directly. Can I call/implement such type of
> functions using MS Access 2003?


MD5() is not an encryption function. The MySQL manual states:

<QUOTE>

MD5(str)

Calculates an MD5 128-bit checksum for the string. The value
is returned as a binary string of 32 hex digits, or NULL if
the argument was NULL. The return value can, for example,
be used as a hash key.

mysql> SELECT MD5('testing');
-> 'ae2b1fca515949e5d54fb22b8ed95575'

This is the “RSA Data Security, Inc. MD5 Message-Digest Algorithm.â€

</QUOTE>


You might want to look at ENCODE() and DECODE() functions. Again from the manual:

<QUOTE>

DECODE(crypt_str,pass_str)

Decrypts the encrypted string crypt_str using pass_str as
the password. crypt_str should be a string returned from ENCODE().

ENCODE(str,pass_str)

Encrypt str using pass_str as the password.
To decrypt the result, use DECODE().

The result is a binary string of the same length as str.

The strength of the encryption is based on how good the random
generator is. It should suffice for short strings.

</QUOTE>

These are all functions you use in your sql statement, so yes. They can be
used in MS Access.

--
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

  Réponse avec citation
Vieux 18/08/2007, 20h17   #6
Mike Aubury
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

But you can use it for passwords (ask Unix)...

You can't decode what the original password was, but you can encode the
password they typed in and check the two hashes match - if they do - the
chances are that the original passwords match (the odds against are huge!)




On Saturday 18 August 2007 16:19, Mogens Melander wrote:

> MD5() is not an encryption function. The MySQL manual states:
>


--
Mike Aubury

Aubit Computing Ltd is registered in England and Wales, Number: 3112827
Registered Address : Murlain Business Centre, Union Street, Chester, CH1 1QP
  Réponse avec citation
Vieux 18/08/2007, 23h23   #7
Mogens Melander
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage


On Sat, August 18, 2007 20:17, Mike Aubury wrote:
> But you can use it for passwords (ask Unix)...
>
> You can't decode what the original password was, but you can encode the
> password they typed in and check the two hashes match - if they do - the
> chances are that the original passwords match (the odds against are huge!)


Well, i got the impression that OP wanted to retrieve the cleartext
string, but i could be wrong.

> On Saturday 18 August 2007 16:19, Mogens Melander wrote:
>
>> MD5() is not an encryption function. The MySQL manual states:
>>


--
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

  Réponse avec citation
Vieux 19/08/2007, 00h03   #8
Sudheer Satyanarayana
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

Hi,

What are those external programs? If you are using a scripting language
like PHP to insert data, you can still use all the MySQL functions in
your query statements. I'm not sure how this is related to MS Access 2003.

With Warm Regards,
Sudheer. S
www.binaryvibes.co.in
www.lampcomputing.com


C K wrote:
> Thanks to all,
> but the problem is that I am using external programs to insert data and I
> can't use MySQL functions directly. Can I call/implement such type of
> functions using MS Access 2003?
> Thanks
> CPK
>
>
>
>> The md5 function encrypts the input string.
>>
>> ---------
>> With Warm Regards,
>> Sudheer. S
>> www.binaryvibes.co.in
>> www.lampcomputing.com
>>
>>
>>

>
>
>



  Réponse avec citation
Vieux 19/08/2007, 21h37   #9
David T. Ashley
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

On 8/18/07, C K <shreeseva.it@gmail.com> wrote:

> Friends,
> I have one question - How to store passwords in MySQL database table in a
> secure way so that no one can see the password(understand the password
> string)?



It is considered bad security practice to store passwords using reversible
encryption. The issue is that users tend to choose the same passwords
across different computing systems, as well as personal e-mail and banking
accounts.

The most common method is to keep a string, known only to the server, that
is used to generate the MD5 or SHA1 hash actually stored. The stored
value is then generated using something like:

MD5(CONCAT(server_string, user_password, server_string))

In order to be able to mount some kind of an attack other than brute force,
an attacker would need to also have the server_string.

The disadvantage of using only the user password for the MD5 is that it
lends itself to a dictionary attack. So, a bit of randomness thrown in is
ful.

http://en.wikipedia.org/wiki/Dictionary_attack

As another poster pointed out, the probability of two different passwords
having the same hash is remote. Using the SHA1 (160 bits) as an example,
and assuming about 64 different characters (6 bits) available for passwords,
the SHA1 is about 26 characters of information. Remote.

Dave.

  Réponse avec citation
Vieux 20/08/2007, 17h36   #10
Michael Dykman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Password storage

If you can't access functions directly, you could implement a trigger
on that row to intercept the password as it being written and do your
MD5 encoding there.

- michael


On 8/18/07, C K <shreeseva.it@gmail.com> wrote:
> Thanks to all,
> but the problem is that I am using external programs to insert data and I
> can't use MySQL functions directly. Can I call/implement such type of
> functions using MS Access 2003?
> Thanks
> CPK
>
>
> >
> >
> > The md5 function encrypts the input string.
> >
> > ---------
> > With Warm Regards,
> > Sudheer. S
> > www.binaryvibes.co.in
> > www.lampcomputing.com
> >
> >

>
>
> --
> Keep your Environment clean and green.
>



--
- michael dykman
- mdykman@gmail.com

- All models are wrong. Some models are useful.
  Réponse avec citation
Vieux 20/08/2007, 19h46   #11
Brown, Charles
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut mysql error

Hello all.

I noticed that the last entry in mysql error log was two weeks ago. Can
some one tell me why mysql is not writing to this log

********************************************
This message is intended only for the use of the Addressee and
may contain information that is PRIVILEGED and CONFIDENTIAL.

If you are not the intended recipient, you are hereby notified
that any dissemination of this communication is strictly prohibited.

If you have received this communication in error, please erase
all copies of the message and its attachments and notify us
immediately.

Thank you.
********************************************
  Réponse avec citation
Vieux 20/08/2007, 19h51   #12
Michael Dykman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysql error

Have you had any errors in the last 2 weeks? Have you restarted your
server in the last 2 weeks? Your problem might just be a symptom of
no problem at all.

- michael

On 8/20/07, Brown, Charles <CBrown@bmi.com> wrote:
> Hello all.
>
> I noticed that the last entry in mysql error log was two weeks ago. Can
> some one tell me why mysql is not writing to this log
>
> ********************************************
> This message is intended only for the use of the Addressee and
> may contain information that is PRIVILEGED and CONFIDENTIAL.
>
> If you are not the intended recipient, you are hereby notified
> that any dissemination of this communication is strictly prohibited.
>
> If you have received this communication in error, please erase
> all copies of the message and its attachments and notify us
> immediately.
>
> Thank you.
> ********************************************
>



--
- michael dykman
- mdykman@gmail.com

- All models are wrong. Some models are useful.
  Réponse avec citation
Vieux 20/08/2007, 19h54   #13
Mike Zupan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysql error

A common issue a lot of people have is this

rm logfile

if the mysql server is still accessing that file it will not continue to
write to that file again till mysql is restarted

if that was the case the proper way to clear a log and keep the server
running is

cp /dev/null logfile

On 8/20/07, Brown, Charles <CBrown@bmi.com> wrote:
>
> Hello all.
>
> I noticed that the last entry in mysql error log was two weeks ago. Can
> some one tell me why mysql is not writing to this log
>
> ********************************************
> This message is intended only for the use of the Addressee and
> may contain information that is PRIVILEGED and CONFIDENTIAL.
>
> If you are not the intended recipient, you are hereby notified
> that any dissemination of this communication is strictly prohibited.
>
> If you have received this communication in error, please erase
> all copies of the message and its attachments and notify us
> immediately.
>
> Thank you.
> ********************************************
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=hijinks@gmail.com
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h02.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18038 seconds with 21 queries