Fundamental difference between Hashing and Encryption algorithms

前端 未结 13 2046
日久生厌
日久生厌 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:02

    You already got some good answers, but I guess you could see it like this: ENCRYPTION: Encryption has to be decryptable if you have the right key.

    Example: Like when you send an e-mail. You might not want everyone in the world to know what you are writing to the person receiving the e-mail, but the person who receives the e-mail would probably want to be able to read it.

    HASHES: hashes work similar like encryption, but it should not be able to reverse it at all.

    Example: Like when you put a key in a locked door(the kinds that locks when you close them). You do not care how the lock works in detail, just as long as it unlocks itself when you use the key. If there is trouble you probably cannot fix it, instead get a new lock.(like forgetting passwords on every login, at least I do it all the time and it is a common area to use hashing).

    ... and I guess you could call that rainbow-algorithm a locksmith in this case.

    Hope things clear up =)

提交回复
热议问题