Friday, August 22, 2025
Compare encoding, hashing, encryption.
Referred video below.
Encoding | Hashing | Encryption | |
---|---|---|---|
Is reversible? | ✅ | ❌ | ✅ |
Is secure? | ❌ | ✅ | ✅ |
Human can’t understand computer’s language, Computer can’t understand human’s language. We need encoding to solve the problem. Converting human’s language into computer’s language is encoding. Converting computer’s language into human’s language is decoding.
Encoding is reversible, it’s purpose is on data’s store, consistent interpretion.
Encoding is being used to brower’s URL, saving of movies, documents. URL encodion, one of most common encoding is called as Percent-encoding too.
Reference : Percent-encoding from MDN
When we sign up to a webpage, all the password is stored after hashing. Like this, hashing is being used for security. In addition, integrity of data(detect change), quick data search by hashtable, uniqueness of data, data download are purpose of hashing too.
Hashing is not reversible. No matter how long the input is, it prints fixed length of data. If you input same value, it prints same value always.
As it prints always same result when the input is same, it has security fualt. A table which organize input and output data is called as Rainbow-table. To make it more secure, salt is being added to neutralize Rainbow-table.
JSON Web Tokens(JWT) is one of the most common example for hashing.
Reference : JSON Web Tokens - jwt.io
When the system requires reversible security, encryption is the one. the purposes of encryption are on cridential, security, authentication.
Data is being encrypted when it’s being delivered, it can’t be decrypted without proper password key. because of that, it can maintain its security even on the situation that the data has been taken during communication.
One of the most famous cipher is, CAESAR’s cipher. it encrypts the content by converting text with shifting alphabets by a fixed number of position.
hello(after shifting alphabets as the number 3) -> khoor
Reference : Ciphertext from MDN