© Seth James Nielson, Christopher K. Monson 2019
S. J. Nielson, C. K. MonsonPractical Cryptography in Pythonhttps://doi.org/10.1007/978-1-4842-4900-0_2

2. Hashing

Seth James Nielson1  and Christopher K. Monson2
(1)
Austin, TX, USA
(2)
Hampstead, MD, USA
 
Hashing is a cornerstone of cryptographic security. It involves the concept of a one-way function or fingerprint. Hash functions only work well when a couple of things are true about them:
  • They produce repeatable, unique values for every input.

  • The output value provides no clues about the input that produced it.

Some hashing functions are better at satisfying these requirements than others, and we’ll talk about some good ones (SHA-256) and some not-so-good ones (MD5, SHA-1) to demonstrate both how they ...

Get Practical Cryptography in Python: Learning Correct Cryptography by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.