How are types of Cryptography combined in our daily activities?

How are types of Cryptography combined in our daily activities?

Nowadays, we spend much time on the Internet for reading news, watching videos, or surfing social networks. But have you ever stopped to consider that Cryptography is continuously protecting our information behind the scenes?

This article will explore three pillars of modern cryptography — symmetric encryption, asymmetric encryption, and hash functions—and see how they work together to keep our data secure.

Symmetric Key

Symmetric Key is the modern improvement of classical cipher encryption. The major challenge is safely distributing the secret key to all intended recipients.

  • Single Key Encryption: A single secret key is used for both encryption and decryption.
  • Key Sharing: The same key must be shared between the sender and the receiver making key distribution a potential weak point for attackers.

Asymmetric Key

Asymmetric encryption addresses the key-sharing problem by introducing a mathematically linked pair of keys: public and private. However, that leads to high computation costs.

  • Key pair Encryption: Messages encrypted with the public key can only be decrypted with the corresponding private key, and vice versa.
  • Key Exchange: Public keys can be shared openly, but private keys must remain secret. The private key can't be generated from the public key.

Use case

  • Message authentication: The sender uses the receiver’s public key to encrypt, only the receiver’s private key can decrypt.
  • Digital signatures: The sender encrypts messages with their private key. The receivers use the sender's public key to decrypt and verify the sender's identity.

Hash Functions

Hash functions don’t encrypt data. They transform data into a fingerprint that reveals if the data has changed.

  • One-Way Function: Transform a variable-length string to a fixed-size string (digest). This function is irreversible.
  • Collision-Resistance: The same input produces the same hash. If the data is modified, a different hash is generated.

Use case

  • Credentials storage: Only the hash value of user credentials is stored in the database. Comparing hashes can authenticate users without revealing their raw passwords.
  • Data integrity: The sender computes and publishes the message's digest. The receiver recomputes the hash value and compares it to check if the data is modified.

Hybrid cryptography

Many real-world systems combine types of encryption to leverage their advantages.

HTTPS / TLS


  • Asymmetric encryption (e.g., RSA/ECC) is used during the TLS handshake to verify server identity and secure symmetric key delivery.
  • The symmetric key (e.g., AES) is then used for the bulk data encryption for the rest of the session.
  • Hash functions (e.g., SHA-2) are used to ensure data integrity in the transfer progress.

Digital Signatures

  • Signers hash the message first, then use an asymmetric private key to sign the hash value.
  • Recipients verify the signature using the signer’s public key and the same hash function.


References:



要查看或添加评论,请登录

Hoan Tran Viet的更多文章

  • What exactly are VPN secure tunnels?

    What exactly are VPN secure tunnels?

    Most of us have used a VPN at least once—maybe to bypass website restrictions or securely access private company…

    2 条评论
  • MAC vs. IP Addresses: Why We Need Both?

    MAC vs. IP Addresses: Why We Need Both?

    I'm writing this article after drinking a couple of beers. It will not be formal and concise, but it is my spontaneous…

    1 条评论
  • How are Secret keys exchanged through insecure networks?

    How are Secret keys exchanged through insecure networks?

    In the previous post, we learned about the combination of symmetric keys (used for session data encryption) and…

    7 条评论
  • How Kubernetes authenticate internal access?

    How Kubernetes authenticate internal access?

    When you access the Kubernetes API server, you authenticate as a regular user. But what happens when Pods start making…

  • How Kafka achieves its design goals (Part II)

    How Kafka achieves its design goals (Part II)

    Following the previous article, we continue to explore key features of Kafka's design that help it achieve the target…

  • How Kafka achieves its design goals (Part I)

    How Kafka achieves its design goals (Part I)

    In recent years, almost of us have been using Kafka for many use cases such as message brokers, activity tracking, and…

    2 条评论
  • How does HDD physically work?

    How does HDD physically work?

    I've used hard disk drives since I first started using computers. Before SSDs and cloud storage became prevalent, HDDs…

  • Analog recording history (Part III - Vinyl)

    Analog recording history (Part III - Vinyl)

    In the previous parts, we have explored phonograph cylinders which used cylinders as the medium to store audio signals.…

  • How the Edison Phonograph works

    How the Edison Phonograph works

    In the previous part, we explored the early history of analog sound recording. Edison's phonograph, invented by Thomas…

  • Analog audio recording history (Part I - Phonograph)

    Analog audio recording history (Part I - Phonograph)

    Cassette players preserve many memories of Vietnamese people from the 1970s to 1990s. At that time, my country was…

    2 条评论

社区洞察

其他会员也浏览了