Let’s keep this short and just compare the facts. How are encryption, encoding and hashing different from each other?
Hashing
Let’s start with hashing. Hashing is meant to protect or keep data such as strings (passwords usually) or file secure. The ideal hash function has three main properties – it is extremely easy to calculate a hash for any given data, it is extremely difficult or almost impossible in a practical sense to calculate a text that has a given hash, and it is extremely unlikely that two different messages, however close, will have the same hash. Popular hashing algorithms are BlowFish, md5, sha1, sha256 etc.
It’s also advisable to use hashing algorithms with a “salt” to make it even harder to crack a hashed password. PHP developers can read more here (doesn’t hurt to read either if you write apps in java, .net, python etc)
Encryption
Encryption is the process of transforming information (referred to as plaintext) using an algorithm (called cipher) to make it unreadable to anyone except those who knows the secret key. The result of the process is encrypted information (in cryptography, referred to as ciphertext). To get back the plaintext (the reverse of encryption = decryption), an individual will need to know the key and the encryption algorithm used. Popular encryption algorithms are AES, Blowfish, RSA etc.
Encoding
Encoding transforms data into another format using a scheme that is publicly available so that it can easily be reversed. It does not require a key as the only thing required to decode it is the algorithm that was used to encode it. Examples are base64, sending files in email, url encoding, encoding MPEG-1 to AVI, encoding WAV to MP3 etc.
Conclusion
Encoding – Data transformation. No key and can be easily reversed provided we know what algorithm was used in encoding.
Encryption – Protect data. Original data can be obtained if we know the key and encryption algorithm used.
Hashing – Protect data. Nearly impossible to crack/hack to the original data.
John says
simple and nice.. thanks !!