Basic Ciphers
Ahmet Burak Can Hacettepe University
abc@hacettepe.edu.tr
1 Information Security
Basic Ciphers Ahmet Burak Can Hacettepe University - - PowerPoint PPT Presentation
Basic Ciphers Ahmet Burak Can Hacettepe University abc@hacettepe.edu.tr Information Security 1 Information Security Computer Security: Ensure security of data kept on the computer Network Security: Ensure security of
abc@hacettepe.edu.tr
1 Information Security
Computer Security:
Network Security:
Approaches to Secure Communication
hides the existence of a message
hide the meaning of a message
Information Security 2
Least significant bit values of pixels can be used to hide
3
Hamlet, Macbeth, Julius Caesar Merchant of Venice, King Lear
Information Security
The message:
PRESIDENT'S EMBARGO RULING SHOULD HAVE IMMEDIATE NOTICE. GRAVE SITUATION AFFECTING INTERNATIONAL LAW. STATEMENT FORESHADOWS RUIN OF MANY NEUTRALS. YELLOW JOURNALS UNIFYING NATIONAL EXCITEMENT IMMENSELY.
Take the first letters of the message:
PERSHINGSAILSFROMNYJUNEI
When you parse it, you will get the real message:
PERSHING SAILS FROM NY JUNE I
Information Security 4
Cryptographythe study of mathematical techniques
Cryptanalysisthe study of mathematical techniques for
Cryptologythe study of cryptography and cryptanalysis.
Information Security 5
Encryption (encipherment): the process of transforming
Decryption (decipherment): the process of making the
Key: the special knowledge shared between
Plaintext: the data to be concealed. Ciphertext: the result of encryption on the plaintext
Information Security 6
Information Security 7
Plaintext Ciphertext Original Plaintext Encryption Decryption Key Key
There are different methods of breaking a cipher,
Information Security 8
CiphertextBonly attack The cryptanalyst knows only
KnownBplaintext attack The cryptanalyst knows one or
Information Security 9
ChosenBplaintext attack The cryptanalyst can choose a
ChosenBciphertext attackSimilar to the chosenB
Information Security 10
Shift Cipher Transposition Cipher MonoBalphabetical Substitution Cipher Polyalphabetic Substitution Ciphers Rotor Machine Enigma
Information Security 11
A substitution cipher The Key Space:
Encryption given a key K:
Decryption given K:
History: K = 3, Caesar’s cipher
Information Security 12
Information Security 13
Can an attacker find K?
Once K is found, very easy to decrypt
Information Security 14
Write the plaintext horizontally in fixed number
Example:
m e e t m e n e a r t h e c l
w e r a t t w e l v e m i d n i g h t t
Information Security 15
Can an attacker decrypt a transposed text?
Once the number of columns is guessed, very easy to
Information Security 16
The key space: all permutations of Σ = {A, B, C, …, Z} Encryption given a key ̟:
Decryption given a key ̟:
π=B A D C Z H W Y G O Q X S V T R N M L K J I P F E U
Information Security 17
Exhaustive search is infeasible
Key space size is 26! ≈ 4*1026
Information Security 18
Basic ideas:
History of frequency analysis:
Information Security 19
Vowels, which constitute 40 % of plaintext, are often separated by
Letter A is often found in the beginning of a word or second from
Letter I is often third from the end of a word. Letter Q is followed only by U Some words are more frequent, such as the, and, at, is, on, in
Information Security 20
The number of different ciphertext characters or
The cipher text is examined for patterns, repeated
Replace ciphertext characters with possible plaintext
Frequency analysis made substitution cipher insecure
Information Security 21
Using nulls
Deliberately misspell words
Homophonic substitution cipher
These make frequency analysis more difficult, but not
Information Security 22
Shift ciphers are easy to break using brute force attacks,
Substitution ciphers preserve language features and are
Information Security 23
Main weaknesses of monoalphabetic substitution
Idea for a stronger cipher (1460’s by Alberti)
Information Security 24
25
Vigenere masks the frequency with which a character
Any message encrypted by a
Information Security 26
Find the length of the key.
Vigenère cipher is vulnerable: once the key length is
How to Find the Key Length?
Kasisky test Index of coincidence (Friedman)
Information Security 27
Two identical segments of plaintext will be encrypted to
Algorithm:
28
Basic idea: if the key in
Implementation idea: multiple rounds of substitution A machine consists of multiple cylinders
Information Security 29
A mBcylinder rotor machine has 26m different
Information Security 30
Patented by Scherius in 1918
Widely used by the Germans from 1926 to the end of
Information Security 31
Use 3 scramblers (rotors):
3 scramblers can be used in
Plug board: allowed 6 pairs
Total number of keys ≈ 1016 Later versions use 5 rotors
Information Security 32
A reflector enables to
First rotor rotates after
Second rotor rotates
and so on
Information Security 33
Machine was designed under the assumption that the
Daily keyThe settings for the rotors and plug boards
Message keyEach message was encrypted with a
Information Security 34
Recover 3 secrets
With 2 months of day keys and Enigma usage
Information Security 35
Keeping a machine (i.e., a cipher algorithm) secret does
Large number of keys are not sufficient Known plaintext attack was easy to mount Key management was the weakest link People were also the weakest link Even a strong cipher, when used incorrectly, can be
Information Security 36
Auguste Kerckhoff (1835 – 1903) was a Dutch linguist
The security of a protocol should rely only on the
Information Security 37