Hashing

Computer Science: OCR A Level, topic 3.1.6

Hashing

Hashing can be used for both protecting data and for comparing files.

Hashing

Hashing

  • Hashing is the process of taking an input, performing some form of calculation on the input that outputs a value of fixed size.
  • The output is known as a hash.
  • The hash function has no inverse (non-invertible).
  • This means hashing is extremely secure as you cannot reverse a hash to get back to the original data that was input.
Passwords

Passwords

  • Hashing can be used to store passwords.
  • When a user creates a password for an account, it is put through a hashing function and stored as the encrypted password.
  • A password entered by a user to gain access to the account will be put through the same hashing function and compared to the stored password.
  • No one can know your actual password by looking in the database.
Digital signatures

Digital signatures

  • Hashing can also be used as a way of adding digital signatures to files.
  • The hash output value can be encrypted with a private key and sent to someone else and they use the matching public key to decrypt.
  • This way you know it has come from that one specific person.

Test yourself on Hashing

Practise this topic for free