### Present Remotely

Send the link below via email or IM

• Invited audience members will follow you as you navigate and present
• People invited to a presentation do not need a Prezi account
• This link expires 10 minutes after you close the presentation

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

# CyberPDX Crypto 2: Simple Ciphers

No description
by

## Wu-chang Feng

on 10 July 2018

Report abuse

#### Transcript of CyberPDX Crypto 2: Simple Ciphers

Our intelligence organization has managed to capture the key settings for the M3 Enigma machine being used by a nefarious professor at Portland State to transmit coded messages to his operatives. He sent this message today. Can you help us decode it?
Transposition
CyberPDX Cryptography
Simple Ciphers

Monoalphabetic
Polyalphabetic
Previously
Encoding
Apply function to information to represent it
Function is known to make translation easy
This module
Encryption
Apply a function to information to hide what it represents
Function is hidden to make translation difficult
Initial Enigma had capacity of 3 rotors
Rotors rotated during encryption/decryption
Wheel 3 rotated one position every key press
Wheel 2 rotated one position every time Wheel 3 rotated a full revolution
Wheel 1 rotated one position every time Wheel 2 rotated a full revolution
How many characters before one sees the same rotor settings?
Each character of plaintext translates to same ciphertext
Character frequency analysis breaks all monoalphabetic substitution ciphers
Idea
Use multiple substitution ciphers across different parts of plaintext

Function can only be one of 26 values
Try all 26 positions
See which one gives back English
Multiple rotors can be placed serially and rotated into arbitrary positions
How many permutations are possible below?
Heart of Enigma is a rotor
Fixed wiring implements a specific permutation
Can be rotated to give 26 different permutations
Never repeat a permutation
Continuously generate a different character mapping
Vigenère key = CYBERDIS

Ciphertext #1 = CLZWFFQWVWULRW
Ciphertext #2 = YMVPUJQNGSQECLBLNC
Ciphertext #3 = NGCIIWGXQPBPZWBDG
Ciphertext #4 = UCDYILBQYGMPUHAWTTF
Ciphertext #5 = PCJXYHZSPBMSJHJGVF
Ciphertext #6 = DCONRPQFHPBRBOQF

Plaintext = ?

Restart key for each snippet
tep yhteszxdytxsj rsbp xo yuesgpjpuuszgb

x ryj oesu fsh tep uszgb
oexjxjk oexccpzxjk ongpjbxb
tpgg cp nzxjrpoo jsu uepj bxb
fsh gyot gpt fshz epyzt bprxbp
Perform arbitrary mapping of plaintext characters to ciphertext characters
Shift cipher
Each letter of plaintext replaced by a letter a fixed number of positions down the alphabet
Often implemented via a wheel
Find an "n" that decodes the snippets into 2 to 4 words
Combine decoded snippets to get the full message.
___________________
| | | | | | |
| H | E | L | P | M | |
_| E | I | A | M | U |__|
| | N | D | E | R | A |
| | T | T | A | C | K |
| |___|___|___|___|___|
Plaintext
“HELP ME I AM UNDER ATTACK”
Re-uses same Caesar cipher based on length of key
Key = PSU

Plaintext “FOOBARAAAAAA”
AEGMNR
nededf
ahtese
lwtloa
ctfeah
.tse.l
GERMAN
“defend the east wall of the castle..”
Character frequency
of English text
Letter Frequency
E 12.02
T 9.10
A 8.12
O 7.68
I 7.31
N 6.95
S 6.28
R 6.02
H 5.92
D 4.32
Transposition ciphers change the order of characters, but not the characters themselves
Anagrams
Columnar transposition
Arrange message in table, reorder columns based on a key
“nededf aht esel wtlo ac tfe ah.tse.l”
Scytale cipher
Used by ancient Greeks to communicate during military campaigns
Encoding and decoding done with rod of same diameter
Ciphertext
“HENTEIDTLAEAPMRCMUAK”
From Wikipedia:
Scytale group activity
Snippet #1: eanhdtwouiiucott
Snippet #2: mllosirikase
Snippet #3: aphswohiuitt
Snippet #4: aaecsrosem,lpmy
Snippet #5: wegharneniordnwe
Snippet #6: mlkauirtnthgiejnrr
Monoalphabetic ciphers keep ordering of characters the same, but implement a fixed substitution of plaintext characters to ciphertext characters
Caesar cipher
Simple substitution
tep yhteszxdytxsj rsbp xo yuesgpjpuuszgb

x ryj oesu fsh tep uszgb
oexjxjk oexccpzxjk ongpjbxb
tpgg cp nzxjrpoo jsu uepj bxb
fsh gyot gpt fshz epyzt bprxbp
Weakness of monoalphabetic ciphers
Polyalphabetic ciphers are substitution ciphers that use multiple alphabets to encrypt messages
Vigenère cipher
Enigma
Enigma rotors
Vigenère decryption activity
Caesar cipher
Vigenère encryption
Example
Does this help?
Scytale example
Enigma operation
Enigma details
How do you break Vigenère?
US Constitution plaintext
Every 8th letter of US Constitution Vigenere-encrypted with key “CYBERDIS”
Left-most rotor rarely moved per message
Allows one to focus on identifying right-most rotor
Enigma weaknesses
Key distribution
Key transmission done via alternate, insecure method
Book of valid Enigma keys for subsequent months captured in 1941
Enigma weaknesses
Enigma activity
http://crypto.cyberpdx.org/static/dailykeys.html
8 different rotors
Reflector
Allows same setting to both encrypt and decrypt, but reduces the number of permutations
No letter can be enciphered to itself
Plugboard

"Key" used for Enigma consists of
Rotors being used
Order of rotors
Initial rotational position of each rotor
Plugboard permutation
Reflector type
How do you break one?
TMMTVC = ?
MQDL JFOK WGDW EFOU BLSI UOLV BHNW OLBA WYBO GELI FPEA KXHO PXNK LHTY VQKR QFXE AQRW IQVY FJBV LJCY WYJZ BQCA HUME HWC
Captured keys:
Enigma emulator
PSUPSUPSUPSU
1. Cycle key across plaintext
2. Key character sets column
Plaintext character sets row
Cipertext at intersection
Column "P", row "F" = U
Column "S", row "O" = G
Column "U", row "O" = I
Column "P", row "B" = Q
Column "S", row "A" = S
Column "U", row "R" = L
Key = PSU

Ciphertext “UGIQSRPSUPSU”
Vigenère decryption
1. Cycle key across ciphertext
PSUPSUPSUPSU
2. Key character sets column
Find ciphertext char in column
Plaintext character is its row
Column "P", letter "U" = F
Column "S", letter "G" = O
Column "U", letter "I" = O
Column "P", letter "Q" = B
Column "S", letter "S" = A
Column "U", letter "L" = R
"UGIQSLPSUPSU"
Oops..key revealed
"Chosen plaintext attack"
Remember this for tonight's movie
"Backward L"
key character
plaintext
ciphertext table
key character
plaintext
ciphertext table
key character
plaintext
ciphertext table
26*26*26 = 17,576
Today is Day 30
Ciphertext
“HENTEIDTLAEAPMRCMUAK”
Scytale decryption
Try every n-th character, until you have English words
Wraparound at end of ciphertext
Every 3rd letter => HTDAPCA
EETEMMK
Ciphertext
“HENTEIDTLAEAPMRCMUAK”
Every 4th letter => HELPM
EIAMU
NDERA
TTACK
Note: Use Input Method of "Block of text" to enter ciphertext
Keep your Enigma key sheet for homework.
defend
theeas
twallo
ftheca
stle..
Example: Magic Ink
How would you decode this?
Use multiple Caesar ciphers on plaintext
Choose cipher based on characters in a secret key
key character
plaintext
"FOOBARAAAAAA"
Reflector makes known-plaintext attack (cribs) easier
"Heil Hitler" at the end of all messages
Immediately rule out certain positions
Pivotal moment in movie
Full transcript