Hashing is one of the simplest and most widely used techniques for protecting personal data. By converting an identifier - such as an email address or customer ID - nto a fixed-length cryptographic value, organizations can reduce the exposure of personal information while still linking records when necessary.
Using Python's hashlib library, a hash can be generated with just a few lines of code:
import hashlib
email = "user@example.com"
hashed_email = hashlib.sha256(email.encode()).hexdigest()
Instead of storing the original email, systems can store only the hash value.
Hashing helps reduce the amount of directly identifiable information stored or shared across systems. It is commonly used in analytics, logging, AI datasets, and internal identifiers where the original value is not required during everyday processing.
The GDPR defines pseudonymization in Article 4(5) as processing personal data so that it can no longer be attributed to a specific individual without additional information, provided that this additional information is kept separately and protected.
Hashing can support pseudonymization by replacing direct identifiers with cryptographic hashes. However, hashing alone is not always sufficient. Predictable values such as names or email addresses may be vulnerable to dictionary or brute-force attacks. In practice, techniques such as salted hashes or HMAC provide much stronger protection.
Hashing does not anonymize personal data. If an individual can still be identified, directly or indirectly, the data remains personal data under the GDPR.
When implemented correctly, hashing is a practical privacy engineering technique that helps organizations reduce risk while supporting GDPR-compliant data processing.