Use the same toy keystream to recover the original nibbles. This is toy arithmetic only, not deployable security.

Example

Use the same toy keystream to recover the original nibbles.

highlighted = computed this step

Step 1 — Set up

Set up the exact toy cryptography values.

cipher nibbles, keystream((1, 2, 12), (6, 7, 8))\begin{array}{c|c}\text{cipher nibbles, keystream}&\text{((1, 2, 12), (6, 7, 8))}\end{array}

Step 2 — Decrypt byte 1

Compute the highlighted cryptography value.

index, cipher, key, plain(1, 1, 6, 7)\begin{array}{c|c}\text{index, cipher, key, plain}&\hlmath{\text{(1, 1, 6, 7)}}\end{array}

Step 3 — Decrypt byte 2

Compute the highlighted cryptography value.

index, cipher, key, plain(2, 2, 7, 5)\begin{array}{c|c}\text{index, cipher, key, plain}&\hlmath{\text{(2, 2, 7, 5)}}\end{array}

Step 4 — Decrypt byte 3

Compute the highlighted cryptography value.

index, cipher, key, plain(3, 12, 8, 4)\begin{array}{c|c}\text{index, cipher, key, plain}&\hlmath{\text{(3, 12, 8, 4)}}\end{array}

Final Step — Round trip

Compute the highlighted cryptography value.

decrypted vs originalmatch\begin{array}{c|c}\text{decrypted vs original}&\hlmath{\text{match}}\end{array}
cryptography This lesson shows why both sides must know the same symmetric key stream.