Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Storing Passwords in MySQL

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I am new to all this Database stuff...

I am learning them , only because i wanna incorporate some persistent story to my web app...

Can some one tell how i could store the passwords in a way it is unreadable to naked eye..


either,
1)through DBMS--MySQL
2)or programmatically
 
Hung Tang
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Theepan Thevathasan:

either,
1)through DBMS--MySQL
2)or programmatically[/QB]


Either approach is fine. 2) is probably a better solution regarding to portability.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
sorry i was my mistake, that i didnt ask why ...

can some give some code /procedures for the two options...

thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This seems to be a way to do number 1 (Caveat - I don't know MySQL that well, so there is in all probablility a different/better way to do this).

My preference would be to do this programatically round some sort of hashing standard (such as MD5). This way your application is database indenendent, and it allows other applications that can implement a digest using this standard a route to validate passwords based on the database values. Have a look at the classes available to you in the java.security package.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic