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条)

报告相同问题?

悬赏问题

  • ¥50 高维数据处理方法求指导
  • ¥100 数字取证课程 关于FAT文件系统的操作
  • ¥15 如何使用js实现打印时每页设置统一的标题
  • ¥15 安装TIA PortalV15.1报错
  • ¥15 能把水桶搬到饮水机的机械设计
  • ¥15 Android Studio中如何把H5逻辑放在Assets 文件夹中以实现将h5代码打包为apk
  • ¥15 使用小程序wx.createWebAudioContext()开发节拍器
  • ¥15 关于#爬虫#的问题:请问HMDB代谢物爬虫的那个工具可以提供一下吗
  • ¥15 vue3+electron打包获取本地视频属性,文件夹里面有ffprobe.exe 文件还会报错这是什么原因呢?
  • ¥20 用51单片机控制急停。