久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='tF8xx'></bdo><ul id='tF8xx'></ul>

      <tfoot id='tF8xx'></tfoot>
      <i id='tF8xx'><tr id='tF8xx'><dt id='tF8xx'><q id='tF8xx'><span id='tF8xx'><b id='tF8xx'><form id='tF8xx'><ins id='tF8xx'></ins><ul id='tF8xx'></ul><sub id='tF8xx'></sub></form><legend id='tF8xx'></legend><bdo id='tF8xx'><pre id='tF8xx'><center id='tF8xx'></center></pre></bdo></b><th id='tF8xx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tF8xx'><tfoot id='tF8xx'></tfoot><dl id='tF8xx'><fieldset id='tF8xx'></fieldset></dl></div>

      <small id='tF8xx'></small><noframes id='tF8xx'>

      1. <legend id='tF8xx'><style id='tF8xx'><dir id='tF8xx'><q id='tF8xx'></q></dir></style></legend>

        用于散列密碼字段的數據類型和長度是多少?

        What data type to use for hashed password field and what length?(用于散列密碼字段的數據類型和長度是多少?)

          <i id='hBKDr'><tr id='hBKDr'><dt id='hBKDr'><q id='hBKDr'><span id='hBKDr'><b id='hBKDr'><form id='hBKDr'><ins id='hBKDr'></ins><ul id='hBKDr'></ul><sub id='hBKDr'></sub></form><legend id='hBKDr'></legend><bdo id='hBKDr'><pre id='hBKDr'><center id='hBKDr'></center></pre></bdo></b><th id='hBKDr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hBKDr'><tfoot id='hBKDr'></tfoot><dl id='hBKDr'><fieldset id='hBKDr'></fieldset></dl></div>
          • <tfoot id='hBKDr'></tfoot>

            <small id='hBKDr'></small><noframes id='hBKDr'>

                  <tbody id='hBKDr'></tbody>
                • <bdo id='hBKDr'></bdo><ul id='hBKDr'></ul>
                  <legend id='hBKDr'><style id='hBKDr'><dir id='hBKDr'><q id='hBKDr'></q></dir></style></legend>

                • 本文介紹了用于散列密碼字段的數據類型和長度是多少?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我不確定密碼散列的工作原理(稍后會實現),但現在需要創(chuàng)建數據庫架構.

                  I'm not sure how password hashing works (will be implementing it later), but need to create database schema now.

                  我正在考慮將密碼限制為 4-20 個字符,但據我所知,加密后的哈希字符串將具有不同的長度.

                  I'm thinking of limiting passwords to 4-20 characters, but as I understand after encrypting hash string will be of different length.

                  那么,如何將這些密碼存儲在數據庫中?

                  So, how to store these passwords in the database?

                  推薦答案

                  更新:僅使用散列函數不足以存儲密碼.您應該閱讀Gilles 在此線程上的回答以獲得更詳細的解釋.

                  Update: Simply using a hash function is not strong enough for storing passwords. You should read the answer from Gilles on this thread for a more detailed explanation.

                  對于密碼,請使用密鑰強化哈希算法,例如 Bcrypt 或 Argon2i.例如,在 PHP 中,使用 password_hash() 函數,默認使用 Bcrypt.

                  For passwords, use a key-strengthening hash algorithm like Bcrypt or Argon2i. For example, in PHP, use the password_hash() function, which uses Bcrypt by default.

                  $hash = password_hash("rasmuslerdorf", PASSWORD_DEFAULT);
                  

                  結果是類似于以下的 60 個字符的字符串(但數字會有所不同,因為它生成了唯一的鹽).

                  The result is a 60-character string similar to the following (but the digits will vary, because it generates a unique salt).

                  $2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a
                  

                  使用 SQL 數據類型 CHAR(60) 來存儲 Bcrypt 哈希的這種編碼.請注意,此函數不會編碼為一串十六進制數字,因此我們無法輕松地將其解壓縮以存儲為二進制.

                  Use the SQL data type CHAR(60) to store this encoding of a Bcrypt hash. Note this function doesn't encode as a string of hexadecimal digits, so we can't as easily unhex it to store in binary.

                  其他散列函數仍然有用,但不能用于存儲密碼,所以我將保留下面的原始答案,寫于 2008 年.

                  Other hash functions still have uses, but not for storing passwords, so I'll keep the original answer below, written in 2008.

                  這取決于您使用的哈希算法.無論輸入如何,散列總是產生相同長度的結果.通常將二進制哈希結果用文本表示為一系列十六進制數字.或者您可以使用 UNHEX() 函數將一串十六進制數字減半.

                  It depends on the hashing algorithm you use. Hashing always produces a result of the same length, regardless of the input. It is typical to represent the binary hash result in text, as a series of hexadecimal digits. Or you can use the UNHEX() function to reduce a string of hex digits by half.

                  • MD5 生成 128 位哈希值.您可以使用 CHAR(32) 或 BINARY(16)
                  • SHA-1 生成 160 位哈希值.您可以使用 CHAR(40) 或 BINARY(20)
                  • SHA-224 生成 224 位哈希值.您可以使用 CHAR(56) 或 BINARY(28)
                  • SHA-256 生成 256 位哈希值.您可以使用 CHAR(64) 或 BINARY(32)
                  • SHA-384 生成 384 位哈希值.您可以使用 CHAR(96) 或 BINARY(48)
                  • SHA-512 生成 512 位哈希值.您可以使用 CHAR(128) 或 BINARY(64)
                  • BCrypt 生成依賴于實現的 448 位哈希值.您可能需要 CHAR(56),CHAR(60)、CHAR(76)、BINARY(56) 或 BINARY(60)

                  截至 2015 年,NIST 建議使用 SHA-256或更高,用于需要互操作性的哈希函數的任何應用程序.但是 NIST 不建議使用這些簡單的哈希函數來安全地存儲密碼.

                  As of 2015, NIST recommends using SHA-256 or higher for any applications of hash functions requiring interoperability. But NIST does not recommend using these simple hash functions for storing passwords securely.

                  較小的散列算法有其用途(例如應用程序內部,而不是用于交換),但它們是已知可破解.

                  Lesser hashing algorithms have their uses (like internal to an application, not for interchange), but they are known to be crackable.

                  這篇關于用于散列密碼字段的數據類型和長度是多少?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發(fā)技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環(huán)數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發(fā)生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                    <tfoot id='e1ZUQ'></tfoot>
                  • <small id='e1ZUQ'></small><noframes id='e1ZUQ'>

                      <tbody id='e1ZUQ'></tbody>
                  • <i id='e1ZUQ'><tr id='e1ZUQ'><dt id='e1ZUQ'><q id='e1ZUQ'><span id='e1ZUQ'><b id='e1ZUQ'><form id='e1ZUQ'><ins id='e1ZUQ'></ins><ul id='e1ZUQ'></ul><sub id='e1ZUQ'></sub></form><legend id='e1ZUQ'></legend><bdo id='e1ZUQ'><pre id='e1ZUQ'><center id='e1ZUQ'></center></pre></bdo></b><th id='e1ZUQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='e1ZUQ'><tfoot id='e1ZUQ'></tfoot><dl id='e1ZUQ'><fieldset id='e1ZUQ'></fieldset></dl></div>
                      <bdo id='e1ZUQ'></bdo><ul id='e1ZUQ'></ul>
                        • <legend id='e1ZUQ'><style id='e1ZUQ'><dir id='e1ZUQ'><q id='e1ZUQ'></q></dir></style></legend>

                            主站蜘蛛池模板: 亚洲精品久久久一区二区三区 | 久久一区二区精品 | 精品av| 在线视频99 | 九色视频网站 | 午夜精品久久久久久久99黑人 | 欧美bondage紧缚视频 | 精品三级在线观看 | 亚洲成人网在线观看 | 性色的免费视频 | 免费在线h视频 | 免费视频一区二区 | 久久精品综合 | 99只有精品 | 狠狠骚 | 日韩欧美一区二区三区免费观看 | 天天干狠狠干 | 日韩高清www| 午夜免费电影 | 中文字幕视频在线免费 | 久久久免费毛片 | 欧美激情a∨在线视频播放 成人免费共享视频 | 亚洲美女网站 | 亚洲免费婷婷 | 久久99精品久久久久久 | 91一区二区三区 | 亚洲一区国产精品 | 久久99精品久久久 | 国产精品呻吟久久av凹凸 | 999国产视频 | 一级特黄网站 | 国产精品免费在线 | 欧洲尺码日本国产精品 | 亚洲欧洲精品成人久久奇米网 | 日韩精品一区二区三区在线播放 | 欧美一区免费 | 一区二区三区在线看 | 色橹橹欧美在线观看视频高清 | 国产 亚洲 网红 主播 | 欧美h| 综合久|