Encryption 101

Encryption involves transforming data, known as plaintext, into a coded format called ciphertext. We use some form of decryption key to reverse the ciphertext to plaintext. The key in this sense conceals the information from those who are not authorized to access it.


Encryption vs. Cryptography

This encryption and decryption are accomplished using various mathematical algorithms, also called: ciphers. Additionally, cryptographic keys are used for authentication, ensuring that only authorized parties can access the encrypted data by encrypting and decrypting it. This system of keys and algorithms forms the basis of maintaining data confidentiality and security in digital communications.

Note. Encryption is a subset of cryptography. Encryption is the process of encrypting, and decrypting (scrambling, and unscrambling) some data. Cryptography is the science of concealing the content of data.


Why encryption

Well it’s quite simple, do you want your data to be visible to everyone, or do you want some or all of you data to be concealed and still usable? Encryption is used in most technical applications, but especially in regards to scenarios such as: secure online transactions, encrypted emails, chats, and messages, secure web-, mobile-, and network traffic etc.

Encryption is mainly used to make the data available to the intended parties.

So encryption can aid with:

  • Confidentiality: The intended parties can view and use the data
  • Authentication: The sender is a legitimate source, and the receiver is the intended recipient
  • Integrity: The original content hasn’t been modified
  • Non-repudiation: The sender cannot deny sending the message

History of encryption & ciphers

Yes, just some small amount of history:

  1. Hieroglyphs: Hieroglyphs were found in the tomb of Khnumhotep II, some of the hieroglyphs were put in to obscure or conceal some parts of Mr. Khnumhotep’s life.
  2. Caesar cipher: Julius Caesar used a rudimentary type of encryption to hide his correspondence. Each letter is replaced with another at a fixed number.
  3. Enigma: The enigma machine was used during WW2 to conceal the communication of Nazi Germany’s military communications. The cracking of the enigma led to the invention of the electric computer.
  4. AES etc: More advanced encryption algorithms and tools has been developed since the modern internet age has developed, alongside developments in warfare, banking, personal privacy etc.

Encryption keys

We need to have some form of key, password or knowable parameter to be able to both encrypt and decrypt data. These are often generated by a mathematical algorithms. The danger we have then is that we have a key with a set size that can be guessed, often by computers, to bruteforce the key.

The size of the key is “key” to the foundational safety of a encryption algorithms, tools and frameworks. The type of mathematical algorithm used to generate the keys are also important in the strength of the underlying encryption. The size of the keys are measured in bits, and they range between: 128 - 4096 bits in size.


Types of encryption algorithms

asymmetric-symmetric Image source

There are often two types of encryption algorithms umbrella terms:

  • Symmetric (Private-key cryptography)
    • We use one key to both encrypt and decrypt the data
    • Pros: Takes less computational power to do as it uses the same key for both encryption, and decryption.
    • Cons: If a bad actor gets hand of the cryptographic key they will have access to the plaintext data.
  • Asymmetric (Public-key cryptography)
    • It uses two different keys to encrypt and decrypt the data. One key is public (encryption), and shared by all parties. The private key (decrypt) are individual and used to decrypt the encrypted data.
    • Pros: Can be seen as safer, and more secure due to its innate nature of being harder to crack. Can be used with digital signatures. Easy to distribute public keys openly whilst not compromising security.
    • Cons: Uses more computational power to implement and use. Often not used with large datasets. One also need to handle the sharing, storage and usages of all the keys.

Types of encryption algorithms:

  • RSA (Asymmetric)
    • One of the initial asymmetric encryption algorithms.
    • Typical key sizes: 2048 or 4096 bits
  • ECC (Asymmetric)
    • A smaller overall footprint, using elliptic curves to form its encryption.
    • Typical key sizes: 256 bits (often comparable to much higher forms of RSA key sizes)
  • AES (Symmetric)
    • Highly used as a standard form of encryption in everything from secure HTTP traffic, to encryption of network traffic etc.
    • Typical key sizes: 128 - 256 bits

E2EE

End-to-end encryption (E2EE) is a standard that is used in modern IT systems, and it’s a more secure and privacy focused way to send and receive data. E2EE is often using both asymmetric and symmetric algorithms and tools to create a unified, complete and ease to use service to ensure confidentiality and integrity. (I plan on writing more about E2EE in another blog post, stay tuned.)


Problems

One of the biggest issues that we are going to face in regards to encryption and data privacy/security, is the rise of… yes you guessed right: AI and quantum computers. These systems can in the near future be able to crack some of the mathematical algorithms and technologies that relies on strong encryption to secure our data.

We also have the issue of old, and unsecure encryption standards and algorithms. We have seen attacks, and exploits pop-up ever so often when a company, or systems has used improper encryption tools, standards or techniques, and it has led to data leaks and just bad things.


Conclusion

This was a brief look into the area of digital encryption. I hope to write more in-depth about subjects like: AES, asymmetric algorithms, cryptography etc. But in the end if you value your data integrity, and you don’t want to send all your data and information in plaintext, then take advantage of encryption. Yes, if you are a spy, use encryption.

via GIPHY