Member-only story
Encoding VS hashing VS encryption
I have always been asked, online and offline.
- Why must use UTF-8 instead of ASCII?
- Why use base64 encoding here instead of URL encoding? And how is it different from UTF-8 encoding?
- why encoding can not be used for encryption purposes? it is also hard to read.
- And Isn’t hashing enough to be used for all encryption purposes? like hash a password to store in a database, we are doing it, right?
- Then why not use encryption to replace the cases where hashing is being used?
- Is it right to say that asymmetric is more secure than symmetric encryption?
- …
Hope this post can clarify the understanding.
Encoding
First thing. We should understand the purpose.
When A developer talks to a machine
We work with text, and machines only understand binaries. Conversion between text (array of characters) needs to happen. e.g. when we open/close a file, need to specify which encoding is being used to read or write. like ASCII or Unicode (UTF-8, and do not use UTF-16, it waste space) to support foreign languages. these encodings are called character encoding. every character encoding has different rules to convert between char to binary.