Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Encryption protects messages by turning readable information, called plaintext, into scrambled information, called ciphertext. This matters because messages often travel across networks where other people or machines could copy them. With strong encryption, copied data looks meaningless without the correct key. Encryption is used in messaging apps, banking websites, Wi-Fi networks, and many other systems that need privacy and trust.

The basic mechanism is an algorithm that combines the message with a key to produce ciphertext. The receiver uses a matching key and a decryption algorithm to recover the original message. Symmetric encryption uses the same secret key for encryption and decryption, while public key encryption uses a public key to encrypt and a private key to decrypt. Modern secure systems often combine both methods to get fast encryption and safe key exchange.

Key Facts

  • Encryption changes plaintext into ciphertext using an algorithm and a key.
  • Decryption changes ciphertext back into plaintext using the correct key.
  • Symmetric encryption uses one shared key: ciphertext = Encrypt(plaintext, secret key).
  • Public key encryption uses two related keys: ciphertext = Encrypt(plaintext, public key).
  • A brute force attack tries possible keys until one works, so longer keys are harder to guess.
  • Number of possible keys for an n-bit key = 2^n.

Vocabulary

Plaintext
Plaintext is the original readable message before encryption.
Ciphertext
Ciphertext is the scrambled output produced by encrypting plaintext.
Key
A key is a secret or private value used by an encryption algorithm to lock or unlock data.
Symmetric encryption
Symmetric encryption is a method where the same shared key is used to encrypt and decrypt a message.
Public key encryption
Public key encryption is a method where a public key encrypts data and a related private key decrypts it.

Common Mistakes to Avoid

  • Thinking encryption hides that a message was sent, which is wrong because encryption usually hides the content, not the existence of communication.
  • Sharing the secret key in the same unprotected channel as the message, which is wrong because anyone who intercepts both can decrypt the message.
  • Assuming a secret algorithm is the main source of security, which is wrong because modern encryption is designed to stay secure even if the algorithm is known.
  • Using very short keys or simple ciphers, which is wrong because attackers can test small key spaces quickly with computers.

Practice Questions

  1. 1 A system uses a 4-bit key. How many possible keys could an attacker try in a brute force attack?
  2. 2 A message is 1200 bytes long before encryption. If encryption adds a 16-byte initialization vector and a 16-byte authentication tag, how many total bytes are sent?
  3. 3 Explain why a messaging app might use public key encryption to exchange a symmetric key, then use symmetric encryption for the actual conversation.