The difference between Obfuscation, Hashing, and Encryption

encryptionhashobfuscation

What is the difference between Obfuscation, Hashing, and Encryption?

Here is my understanding:

  • Hashing is a one-way algorithm; cannot be reversed
  • Obfuscation is similar to encryption but doesn't require any "secret" to understand (ROT13 is one example)
  • Encryption is reversible but a "secret" is required to do so

Best Answer

Hashing is a technique of creating semi-unique keys based on larger pieces of data. In a given hash you will eventually have "collisions" (e.g. two different pieces of data calculating to the same hash value) and when you do, you typically create a larger hash key size.

obfuscation generally involves trying to remove helpful clues (i.e. meaningful variable/function names), removing whitespace to make things hard to read, and generally doing things in convoluted ways to make following what's going on difficult. It provides no serious level of security like "true" encryption would.

Encryption can follow several models, one of which is the "secret" method, called private key encryption where both parties have a secret key. Public key encryption uses a shared one-way key to encrypt and a private recipient key to decrypt. With public key, only the recipient needs to have the secret.