Computer Science - ilya-khadykin/notes-outdated GitHub Wiki

Cryptography

Sending a secret message with cryptographic key

Alice wants to send a secret message to Bob:

  • they exchange cryptographic key
  • Alice uses the key to encrypt the message
  • Bob uses the same key to decrypt the message

Main point: without secret key Eve (third party observer) cannot understand the message

Example 1. Enigma encryption machine Turing managed to reverse engineered the algorithm

Example 2. One-time pad

Example 3. Linear feedback shift register

Encoding text a sequence ob bits

Base64 encoding:

  • simple method of representing text
  • 64 different symbols allowed: A-Z, a-z, 0-9, +, /
  • 6 bits to represent each symbol
  • ASCII (8 bits - 256 symbols) and Unicode (16 bits - 65 536+ symbols) methods are similar

Encryption with a one-time pad

Characteristics:

  • cryptographic key known only to sender and receiver (Good choice: random sequence of bits).
  • security depends on using each sequence only once

Preparations:

  • create a random sequence of bits (one-time pad)
  • send one-time pad to intended recipient through secure channel

Encryption:

  • encode text as a sequence of N bits
  • use the first N bits of the pad (need to have as many bits as there are in the message)
  • compute a new sequence of N bits from the message and the pad
  • decode result to get a sequence of characters