Cryptography is used to protect communication by converting the original message (plaintext) into an unreadable form (cipher text) using encryption. The cipher text is sent over the communication channel, and the intended recipient applies the decryption to recover the original message. The goal is to maintain the confidentiality of the message.

How does message encryption work

A message (m) is to be sent from Alice to Bob. Carol (potential eavesdropper) may be able to observe the communication channel.

  1. Send message with encryption
    • Alice uses an encryption algorithm (E) to convert the original message (m) into an encrypted version (E(m)). This process is known as encryption, the encrypted message is called cipher text.
    • Alice send the message over communication channel to Bob.
  2. Receiving message using decryption
    • Bob receives the message and applies a decryption function (D) to reveal the original message. This process is known as decryption and can be described as D(E(m)).

The objective is that Carol might see the encrypted message E(m), but should not be able to understand or decrypt the original message m.

Symmetric encryption with key

The encryption algorithms often require a parameter called a “key”, which serves as an input to the algorithm and determines how the data is transformed. (e.g. shift all letters to the left by n, the key is the amount of the shift, n) The key is symmetric which means it is shared by both parties. The sender sends the cipher text, the cipher text can be described as E(m, k) where k is the key. The decoder uses the same shared key to decode: D(E(m, k), k). If the decoder uses a different key, the resulting message is going to be different and unrelated.

Challenges of distributing keys

Since both parties need the same key for encryption and decryption, setting up and sending the shared key securely through the public channel can be challenging as we can’t send the key over the connection without first encrypting it. To transmit the secret key securely, an initial secure key exchange mechanism is required. Common secure key exchange methods include combined public-private key cryptography and digital signature, and Diffie-Hellman Key Exchange.

Key-pairs and digital signature

Alice is the sender and wanted to distribute a shared key to the receiver Bob.

  1. Symmetric shared key creation Alice generates a symmetric shared secrete key that she wants to use for encrypting message with Bob. This key value and be random.
  2. Encryption with Receiver’s public key Alice encrypts shared key with Bob’s public key KPUB,Bob, this ensures that Bob with his private key can decrypt the message and obtain the shared key.
  3. Send with Alice’s digital signature Alice sends the message containing the encrypted shared key with her digital signature.
  4. Bob receives both encrypted message and signature
    • Bob decrypts the message with his private key.
    • Bob then verifies the digital signature and confirm the sender is Alice.
    • Once confirmed, Bob decrypts the encrypted message with his private key and obtain the shared secrete key.

Diffie-Hellman key exchange

Diffie-Hellman key exchange method is used to exchange a symmetric key on an insecure or public channel. Learn more on Diffie-Hellman Key Exchange.


Back to parent node: Network Security and Cryptography

Computer_networksNetwork_securityINFO1112Symmetric_cryptographyDigital_signature