What Is Hashing in Cybersecurity?

Written by Coursera Staff • Updated on

Hashing is an encryption technique used in cybersecurity to protect and manage information. Learn more about what hashing is and how it’s used.

[Featured image] A cybersecurity tech in a gray shirt stands up, looking at a tablet in front of a wall of video security monitors, working with hashing.

Key takeaways

Hashing is a technique for converting data values into unique identifiers called hashes for quick yet secure data access. 

  • As a one-way function, hashing makes it impossible to obtain the original data from the hash, boosting data integrity. 

  • A hash function converts data of any size into a fixed-length string.

  • You can advance your cybersecurity career by deepening your understanding of key data security concepts like hashing, encryption, and cryptography. 

Discover what hashing is and how it differs from encryption. If you’re ready to start preparing for a role in cybersecurity, consider pursuing the Google Cybersecurity Professional Certificate. In as little as six months, you can learn how to protect networks, devices, and data from unauthorized access and cyberattacks using security information and event management (SIEM) tools. 

What is hashing?

Hashing is a data security technique used to convert data values into alternate, unique identifiers called hashes for quick and secure access. Hashing can be used for data security because the one-way process prevents access to or tampering with the source data.

Read more: Data Protection vs. Data Security: What’s the Difference?

What is a hash function?

A hash function is an algorithm that transforms any amount of data into a fixed-length element or string. A good hash function ensures that even tiny changes in input data will produce dramatically different hash outputs. This property is crucial for security applications, where the hash function must make it nearly impossible to derive the original input from the hash.

How is hashing primarily used by security professionals?

In computer science, hashing is a technique used in data structures like hash tables, where it converts inputs of any size into a fixed-size string of characters, typically in numerical format. You can perform this through hash functions. It takes data, like a name or a file, and creates a unique hash for it.

Data retrieval

One of the primary uses of hashing is data retrieval. Hash tables, for instance, use hashing to store and retrieve data efficiently. When you add data to a hash table, the hash function computes a hash for that data. This hash then determines where the data is stored. When you need to retrieve the data, the hash function calculates the hash again and directly accesses the location of the data. This process makes data retrieval incredibly quick, regardless of the size of the data.

Cryptography

Another significant use of hashing is in the field of cryptography, specifically in verifying data integrity. In digital signatures, for example, a document’s hash is encrypted with a private key to create the signature. The recipient can then use the sender's public key to decrypt the signature, recompute the hash, and compare it to the received hash. If the hashes match, the document is authentic and untampered with.

What is hashing vs. encryption?

When you encrypt plaintext, you scramble it into ciphertext that is unreadable. Upon receiving the ciphertext, you can apply a relevant key to decrypt it and make it readable again. The process of hashing transforms plaintext into a unique code that you are unable to turn back into a form that is readable. 

What are the limitations of hashing?

Despite its benefits, hashing does have limitations. A hash collision occurs when different inputs produce the same hash output. While good hash functions make this highly unlikely, it's not impossible. Also, hashing is a one-way function, so you can't get the original data from the hash. While this is good for security, it's not ideal for situations where you need to retrieve the original data.

Related terms

[Video Thumbnail] Google Cybersecurity Professional Certificate

Explore our free cybersecurity career resources

Stay current with what’s trending in cybersecurity with Career Chat, a weekly LinkedIn newsletter by Coursera. Build or refresh your foundational knowledge in cybersecurity or discover career paths in this field by subscribing to our other free digital resources: 

Accelerate your career growth with a Coursera Plus subscription. When you enroll in either the monthly or annual option, you’ll get access to over 10,000 courses.

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.