I recently have to deal with encrypting some sensitive information which lead me to get to know the encryption algorithms. However, the goal is to encrypt only part of the information in a manner of no decryption.
At the mean time, I remember when I was having internet security class back at ESIGELEC during my master degree, my tutor told us that the general way for encryption is using public key and private key which leads to two-way function(decryptable). I also googled to check for one-way function which lead me to SHA-2. It is quite confusing at the beginning since the result of hashing and encrypting is quite the same (which are just some non sense strings).
But wait a sec, let me take a note on some terminology.
Encryption algorithms: AES: advanced encryption algorithm DES: data encryption algorithm blowfish: RES: Hashing algorithms: SHA MD5 digest: the hashed value or the output. Avalanche effect: little changed of the original info will cause great difference on the digest.
I really like this explanation from Mukesh Kumar who explained these concepts in a simple way. So basically, SHA has the following features:
- given a hashed value, one can not get the original info.(only by brute force search)
- should not cause Collision resistance
- same input value should always generate the same digest.
What is SHA
SHA stand for sucure hashing algorithm. The SHA-2 family consists of six hash functions with digests (hash values) that are 224, 256, 384 or 512 bits: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256.
usage scenario
- data integrity check-sum
- Password verification
- bitcoin
Based on these usage, I might be able to explain them later and even implement them myself.
Reference
SHA-2 Cryptographic hash function