computing-networking

How Encryption Works

Encryption scrambles readable information using a rule and a secret value called a key.

Imagine a special lockbox: everyone can see the box, but its lock follows exact rules, and only the right key can open the protected message inside.

  1. A readable message labeled plaintext before it enters an encryption process.Readable letter=Plaintext

    Step 1

    Data begins as plaintext

    A readable message, photo, or file is called plaintext before encryption.

  2. Readable data moving through a box of fixed mathematical encryption rules.PlaintextAlgorithmChanged data

    Step 2

    An algorithm follows exact rules

    An encryption algorithm is public mathematics that rearranges data in a precise, repeatable way.

  3. The same plaintext entering an algorithm with two keys and producing two different ciphertexts.Key ASame messageCiphertext AKey BSame messageCiphertext B

    Step 3

    The key changes the result

    The key supplies a value to the algorithm. Different keys produce different scrambled output.

  4. Readable plaintext compared with scrambled ciphertext that does not reveal the message.PlaintextMeet at noonCiphertext7F A2 19 D4

    Step 4

    Ciphertext hides the meaning

    The encrypted output is ciphertext. Seeing it should not reveal the original data without the needed key.

  5. Ciphertext and the correct key entering decryption and returning the readable message.CiphertextCorrect keyDecryptionPlaintext

    Step 5

    The right key reverses it

    Decryption uses the required key to recover plaintext. Without that key, guessing should be impractically difficult.

  6. One shared secret key compared with a public and private key pair.SymmetricOne shared secretkeyFast for lots ofdataAsymmetricPublic and privatekeysUseful withoutshared secret

    Step 6

    Keys can be shared or paired

    Symmetric encryption shares one secret key. Asymmetric encryption uses a public key and a related private key.

Common trap

Encrypted data is automatically authentic and unchanged.

Encryption hides content. Systems also need authentication and integrity checks to confirm who sent it and whether it changed.

Quick check

What turns plaintext into ciphertext?

  1. An algorithm using a key
  2. A faster internet connection
  3. A brighter screen
Show the answer

The encryption algorithm follows exact rules, while the key changes the specific result.

Sources

  1. EncryptionNational Institute of Standards and Technology
  2. What is encryption?IBM