Razor42 Posted October 16, 2013 Posted October 16, 2013 Say If I was creating a database to store passwords and usernames which may have numbers, characters and - or _ etc. what would I use? Would I user VARCHAR or TEXT? Also whats the difference between the two? And if there are any others which would you suggest? Quote
a_bertrand Posted October 16, 2013 Posted October 16, 2013 TEXT doesn't have limit (or nearly) on the size of the field. While VARCHAR you need to define the size of it before, and you cannot store more than that till you increase the size. There is also a limit of how big you can store in there. For a password, I doubt you go anyhow to anything longer than 32 char... so Varchar would be the way to go. Yet... Security wise, I'm far from being sure I would do a DB with all my passwords ;) Quote
Razor42 Posted October 16, 2013 Author Posted October 16, 2013 Thank you for clearing that up. And I know that passwords shouldn't be stored in plain text don't worry :). Quote
a_bertrand Posted October 16, 2013 Posted October 16, 2013 If you hash them (MD5, SHA1, SHA256 or whatever) think that you cannot recover them (yes yes, rainbow tables and others can), so it is basically useless as well if it is to store password for services. If it is for your own site then sure use that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.