dongxianshuai8927 2012-08-08 18:44
浏览 185
已采纳

密码哈希应该以二进制或十六进制数存储吗?

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?

  • 写回答

2条回答 默认 最新

  • douhuan6157 2012-08-08 18:46
    关注

    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:

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了