Is Bcrypt used for Hashing or Encryption? A bit of confusion

I have been reading about bcrypt (application perspective). Thinking of using it to store passwords on my site.

Out of some stuff that I read it suggests either ways:

  • eg 1: Bcrypt is a cross platform file encryption utility from bcrypt
  • eg 2: bcrypt is an adaptive password hashing algorithm which uses the Blowfish keying schedule, not a symmetric encryption algorithm. from How To Safely Store A Password
  • bcrypt is an adaptive cryptographic hash function for passwords designed by Niels Provos and David Mazières, based on the Blowfish cipher: from bcrypt wiki
  • What exactly is Bcrypt?


    It is both :)

    Most of the time when people mention BCrypt, they are talking about the adaptive hash algorithm, but it is also the name of an unrelated file encryption utility.

    Both are based on the Blowfish cipher.


    Bcrypt encryption software uses the Blowfish algorithm designed by Bruce Schneier in 1993. [1]

    The bcrypt hash function is just that, a hash function. It does not perform encryption, it hashes. It's based on the Blowfish cipher, and is considered a good thing because you can make it slower over time.

    From Wikipedia:

    This is not cryptographically significantly stronger than the standard Blowfish key schedule, but the number of rekeying rounds is configurable; the hashing process can therefore be made arbitrarily slow, which helps deter brute-force attacks upon the hash or salt.

    In regards to storing passwords on your site, you should be encrypting passwords before you hash them.

    Only after you encrypt them with some encryption algorithm (eg Blowfish, Rijndael / AES) should you use bcrypt to hash the ciphered passwords, and store the password hashes.

    For more details on implementing password security, see the top answer to this question.


    bcrypt is a key derivation function for passwords

    Also difference between hashing(used by bcrypt ) and encryption in simple words will be -

    1) encrypted data can be decrypted via private key. 2) Hashing is one way that is if you hash the plain text its irreversible, hence more secure. The only way to ensure is rehash the plain text and compare it with previously hashed data for equality.

    链接地址: http://www.djcxy.com/p/28942.html

    上一篇: YouTube Iframe嵌入了自动播放

    下一篇: Bcrypt是用于散列还是加密? 有点混乱