Hello again! Did I trick you with the title? I know, Let me get straight to the point. You already know about Encoding, Encryption, and Hashing but when I kept those in terms of Identity, Integrity, and Confidentiality it became a bit confusing. Isn’t it? I just wanted to talk about these techniques in terms of privacy and security. There is a high chance that you already know the things I’m about to explain. But, feel free to give it a read. I’m confident that you would know something useful by the end of this blog. Okay, let’s get into the topic.
You must be thinking of Encoding, Encryption, and Hashing are the fundamentals of Software Engineering and why am I over pitching these. But, there are assumptions that these three are similar and any one of them can be used to secure the information but it’s wrong. There is a lot of confusion around these terminologies.
Without a proper understanding of these, A developer could ship insecure storage (or) transmission flows which are volatile to security and data breaches. Today, I will discuss the importance and applicable use cases of these three technologies.
Most of us map these terminologies to a bunch of algorithms and forget the real use cases. From a security point of view, Identity, Integrity, and Confidentiality are the keys to building software.
Identity/Authenticity
To know the origin (or) owner of the information.
Examples:
Integrity
To protect the information from being altered/modified.
Examples:
Confidentiality
Only the authorized have access to restricted information.
Examples:
Encoding is a process of keeping a sequence of characters into a specific format for efficient transmission or storage. As encoding uses publicly available algorithms to format, it is not for securing the information. instead, it is used to optimize the size of data transmitted and to be consumed by a different type of system safely.e.g. base64 is commonly used to encode binary data that needed to be stored or transferred in media which can process textual data.
As the information is encoded with publicly available schema all it takes to decode is the algorithm used to encode it.
Encoding is a process of keeping a sequence of characters into a specific format for efficient transmission or storage. As encoding uses publicly available algorithms to format, it is not for securing the information. instead, it is used to optimize the size of data transmitted and to be consumed by a different type of system safely.e.g. base64 is commonly used to encode binary data that needed to be stored or transferred in media which can process textual data.
As the information is encoded with publicly available schema all it takes to decode is the algorithm used to encode it.
Examples: Base64, Unicode(UTF-8,UTF-16), ASCII, URL Encoding
Use Cases:
Hashing is a one-way street; data that has been hashed cannot be unhashed. Hashing ensures the integrity of data. Meaning, alteration of data would be identified as each input produces the same output always. A hash is usually a hexadecimal string of several characters.
There are hashing algorithms that are compromised which is known as hash collisions. It literally means two inputs generating the same hash. MD5(Message Digest algorithm) is one such algorithm that has been phased out from being secure.
Examples: SHA-1, SHA-2, MD5, SHA-256 etc.
Use Cases:
Encryption guarantees confidentiality. Meaning, Information can be accessed only by those who are authorized to do so. Encryption requires a secret key to access the information.
There are two categories in Encryption.
Symmetric: Using the same key for encryption and decryptionSymmetric encryption
Examples:
Asymmetric: Using private & public keys. Encrypt with public and decrypt with private.
Examples:
Symmetric encryption is faster compared to Asymmetric. Feel free to go through this blog for detailed information.
Use Cases:
I hope you got a bit of clarity on the terminology and use cases. It is important to keep these in mind while designing any software.
TL;DR:
code = coffee + developer