Sitemap
Coinmonks

Coinmonks is a non-profit Crypto Educational Publication. Other Project — https://coincodecap.com/ & Email — gaurav@coincodecap.com

Follow publication

Image source: Jon Moore

Introduction to Cryptography: One time pads and stream ciphers

7 min readFeb 24, 2020

--

Understanding Basic Ciphers

An example of a (very insecure) Substitution Cipher

Based on the above Substitution Cipher, what does the following encrypted ciphertext say? Can you decrypt: "ifmmp xpsme!"

A schematic of the Advanced Encryption Standard cipher logic

Example 1: The One Time Pad

XOR: The bitwise operation in OTPs. For example, 0 xor 0 ,1 xor 1 yields the 0 bit and 0 xor 1 ,1 xor 0 yields the 1 bit.

It’s important to call out that OTPs have an important vulnerability by nature of XOR’s properties: if you generate many ciphertexts with the same key, and assuming an attacker gets at least 2 of your ciphertexts, the attacker can actually reverse engineer the original key! Attack explained.

Relating OTP to Terminology

Alice encrypts a file with the same key that Bob uses to decrypt the file
Illustration of a Perfect Secrecy cipher, even if some parts of its keys are compromised

Based on the above definition, does a cipher which uses a repeating key demonstrate perfect secrecy? If the key is hellohellohellohello…

Example 2: The Stream Cipher

And it turns out that there are algorithms out there that can do this type of key expansion for you in a relatively secure way, such that each encryption key still looks relatively random and yields “random” looking keys as a result.

Stream Ciphers use unique encryption keys randomly derived from the same static key

Relating Stream Ciphers to Terminology

Main takeaways

How can I learn more:

--

--

Coinmonks
Coinmonks

Published in Coinmonks

Coinmonks is a non-profit Crypto Educational Publication. Other Project — https://coincodecap.com/ & Email — gaurav@coincodecap.com

Nicole Zhu
Nicole Zhu

Written by Nicole Zhu

Founder @MenloResearch. My own opinions @freelerobot

Responses (1)