Fundamental difference between Hashing and Encryption algorithms

前端 未结 13 2052
日久生厌
日久生厌 2020-11-21 06:35

I see a lot of confusion between hashes and encryption algorithms and I would like to hear some more expert advice about:

  1. When to use hashes vs encryptions<

13条回答
  •  长情又很酷
    2020-11-21 07:15

    when it comes to security for transmitting data i.e Two way communication you use encryption.All encryption requires a key

    when it comes to authorization you use hashing.There is no key in hashing

    Hashing takes any amount of data (binary or text) and creates a constant-length hash representing a checksum for the data. For example, the hash might be 16 bytes. Different hashing algorithms produce different size hashes. You obviously cannot re-create the original data from the hash, but you can hash the data again to see if the same hash value is generated. One-way Unix-based passwords work this way. The password is stored as a hash value, and to log onto a system, the password you type is hashed, and the hash value is compared against the hash of the real password. If they match, then you must've typed the correct password

    why is hashing irreversible :

    Hashing isn't reversible because the input-to-hash mapping is not 1-to-1. Having two inputs map to the same hash value is usually referred to as a "hash collision". For security purposes, one of the properties of a "good" hash function is that collisions are rare in practical use.

提交回复
热议问题