I usually store it in hexadecimal number but realize I could save half of the space if I store it in binary inside MySQL. Are there any issues I should be aware of if I decide to store it in binary?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How many passwords are you expecting to store? Does half the space mean that much to you really?
You are probably representing the passwords in hexadecimal form in your application, so storing them in binary adds another layer of complexity and processing overhead when you perform any operations on those passwords.
My opinion is that you should store them in a way that is convenient for you to work with, rather than one that saves you tiny amounts of space.
Edit:
Going to make some assumptions and take the opportunity to help you a little further.
Since your passwords are in hex, I’m going to assume you’re not using
crypt, and if you’re not, you should be. Worst case scenario, you’re using md5… and god is killing kittens.There’s a lot of questions and answers about bcrypt on stack overflow already, so I’ll not cover the information again here.
The question SHA512 vs. Blowfish and Bcrypt is a good place to start though.
Also have a read of a couple of @ircmaxell‘s blog posts on the subject: