Professional Documents
Culture Documents
Cryptography: Seite 39 Prof. Dr. A. Lehmann - IT Security
Cryptography: Seite 39 Prof. Dr. A. Lehmann - IT Security
• Introduction
• Cryptosystems
− Substitution
− Transposition
− Symmetric
− Asymmetric
• Hash Functions
• Cryptography model
Encryption Decryption
Linguistical
Steganography
[Babi]
Seite 41 Prof. Dr. A. Lehmann | IT Security
Semagram Example
• Jargon
− Special languages or special signs, e.g. weed, Mary Jane, purple haze,
snow
• Concealment Cipher
− Null Cipher, e.g. a letter after each punctuation mark
− Grille Cipher, e.g. hidden message must be written with a mask
[Babi]
Seite 43 Prof. Dr. A. Lehmann | IT Security
Technical Steganography
• Methods to conceal a secret message, such as the use of invisible ink,
microdots, and shaved heads
• Steganography in images
− E.g. Least Significant Bits
R G B
0010 0111 1110 1001 1100 1000
0010 0111 1100 1000 1110 1001
1100 1001 0010 0111 1110 1001
Hidden Message 1000 0011
[Ecke]
Seite 44 Prof. Dr. A. Lehmann | IT Security
Modifications in Image
Histogram:
original steganography
• Substitution Cipher
− Substitute symbol or group of symbols by other symbol or group of
symbols, order is preserved
• Transposition Cipher
− Retain symbols but change order
• Product Cipher
− Combination of the above
• Also a basis for modern cryptographic methods, applied to Bits and Bytes
[Kapp]
Seite 46 Prof. Dr. A. Lehmann | IT Security
Substitution Cipher
• Example: Caesar Cipher
• E.g. n = 7
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
[Kapp]
Seite 47 Prof. Dr. A. Lehmann | IT Security
Transposition Cipher
• Example: Scytale Cipher
• An early Greek transposition cipher a strip of paper was wound round a staff
B I R T H D A Y
2 5 6 7 4 3 1 8
K N O W L E D G
E I S P O W E R
• In general:
− Ciphertext-Only-Attack
− Known-Plaintext-Attack
− Chosen-Plaintext-Attack
− Chosen-Ciphertext-Attack
[Kapp]
Seite 49 Prof. Dr. A. Lehmann | IT Security
Brute Force Attack
• If there are finitly many keys, try until one fits
[Kapp]
Seite 50 Prof. Dr. A. Lehmann | IT Security
Security of Encryption Schemes
• Encryption keys ought to be long. Is this sufficient?
• Scrambled text
rqjenjmanjvcqjcxwnmjhmxfwrwjujkjvjfrcqrcberlrxdbajlrb
cbfrcqrcbpxenawxaqjerwpqrburybmaryyrwpfrcqcqnfxambxor
wcnayxbrcrxwjwmwduurorljcrxwxwnmjharpqccqnanrwjujkjvj
urccunkujltkxhbjwmkujltpraubfruuknjkuncxsxrwqjwmbfrcq
urccunfqrcnkxhbjwmfqrcnpraubjbbrbcnabjwmkaxcqnabrqjen
jmanjvcxmjhrqjenjmanjvcqjcxwnmjhnenahejuunhbqjuuknngj
ucnmjwmnenahqruujwmvxdwcjrwbqjuuknvjmnuxfcqnaxdpqyujl
nbfruuknvjmnyujrwjwmcqnlaxxtnmyujlnbfruuknvjmnbcajrpq
cjwmcqnpuxahxocqnuxambqjuuknanenjunmjwmjuuounbqbqjuub
nnrccxpncqna
[Kapp]
Seite 51 Prof. Dr. A. Lehmann | IT Security
Statistical Analysis
Letter Relative
Frequency
in English
Language
A 8.167 %
B 1.492 %
C 2.782 %
D 4.253 %
E 12.702 %
F 2.228 %
G 2.015 %
H 6.094 %
I 6.966 %
J 0.153 %
K 0.772 %
L 4.025 %
M 2.406 %
N 6.749 %
O 7.507 %
P 1.929 %
rqjenjmanjvcqjcxwnmjhmxfwrwjujkjvjf
Q 0.095 % rcqrcberlrxdbajlrbcbfrcqrcbpxenawxa
R 5.987 % qjerwpqrburybmaryyrwpfrcqcqnfxambxo
S 6.327 % rwcnayxbrcrxwjwmwduurorljcrxwxwnmjh
T 9.056 % arpqccqnanrwjujkjvjurccunkujltkxhbj
wmkujltpraubfruuknjkuncxsxrwqjwmbfr
U 2.758 % cqurccunfqrcnkxhbjwmfqrcnpraubjbbrb
V 0.978 % cnabjwmkaxcqnabrqjenjmanjvcxmjhrqje
W 2.360 % njmanjvcqjcxwnmjhnenahejuunhbqjuukn n=9
X 0.150 % ngjucnmjwmnenahqruujwmvxdwcjrwbqjuu
knvjmnuxfcqnaxdpqyujlnbfruuknvjmnyu
Y 1.974 % jrwjwmcqnlaxxtnmyujlnbfruuknvjmnbca
Z 0.074 % jrpqcjwmcqnpuxahxocqnuxambqjuuknane
njunmjwmjuuounbqbqjuubnnrccxpncqna
• Key
− As long as the plaintext (minimum)
− Truly random
− Never reused
• Limitations:
− Key management extremely expensive
+ Demand for random numbers is huge
+ Key exchange must be secure
[Ecke]
Seite 54 Prof. Dr. A. Lehmann | IT Security
Cryptographical Methods
• Symmetrical Method (Secret-Key)
Encryption Decryption
Sender Key (e) Key (d) Receiver
public private
[Ecke]
Seite 55 Prof. Dr. A. Lehmann | IT Security
Symmetric Cipher Model
• Plaintext block of size m is translated into ciphertext block using the key of
size n Key (Size n)
Encryption Decryption
• DES (Data Encryption Standard):
− Block size 64 Bit
− Key size 56 Bit
[Ecke]
Seite 56 Prof. Dr. A. Lehmann | IT Security
Symmetric Encryption Schemes
[Ecke]
Seite 57 Prof. Dr. A. Lehmann | IT Security
Block Cipher
• Plaintext is split into blocks of fixed length
C1 C2 … Cn
Plaintext
[Ecke]
Seite 58 Prof. Dr. A. Lehmann | IT Security
Block Cipher Modes
• ECB (Electronic Code Book)
• Problems:
− Reload blocks
− Change order
− Remove block
[Ecke]
Seite 59 Prof. Dr. A. Lehmann | IT Security
Block Cipher Modes
• CBC (Cipher Block Chaining)
IV
IV
[Ecke]
Seite 60 Prof. Dr. A. Lehmann | IT Security
Further Cipher Modes
• OFB (Output Feedback) and CFB (Cipher Feedback)
• OFB generates keystream blocks, which are then XORed with the plaintext
blocks to get the ciphertext
Block Block Block
IV
Cipher Cipher Cipher
Decryption
Ciphertext Ciphertext Ciphertext
Encryption
Nonce Nonce Nonce
Block Block Block
+ + +
Cipher Cipher Cipher
Ctr Ctr+1 Ctr+n
…
Plaintext Plaintext Plaintext
Decryption
Nonce Nonce Nonce
Block Block Block
+ + +
Cipher Cipher Cipher
Ctr Ctr+1 Ctr+n
…
Ciphertext Ciphertext Ciphertext
[Ecke]
Seite 62 Prof. Dr. A. Lehmann | IT Security
Asymmetric Encryption
• Key pair: private and public key
Recipient’s Recipient’s
Public Key Private Key
Encryption Decryption
Sender Recipient
[Ecke]
Seite 63 Prof. Dr. A. Lehmann | IT Security
Public-Key Methods
• Public key encrypted messages can only be decrypted with the private key
[Kapp]
Seite 64 Prof. Dr. A. Lehmann | IT Security
Example: RSA
• RSA, developed by Rivest, Shamir, Adleman
coprime
5. Determine d as d = e−1 (mod λ(n)); that is, d is the modular multiplicative inverse of e
modulo λ(n)
[Reis]
Seite 65 Prof. Dr. A. Lehmann | IT Security
Comparison
Symmetric Asymmetric
Key exchange Secure channel is Public key
necessary
Key length Mostly 128 or 256 Bit Mostly 2048 – 8192 Bit
Performance Fast, easily implementable 100 – 1000 times slower
in hardware or software
[Reis]
Seite 66 Prof. Dr. A. Lehmann | IT Security
Hybrid Methods
• First, utilize public key method to transmit a session key for symmetrical
encryption
A B
[Kapp]
Seite 67 Prof. Dr. A. Lehmann | IT Security
Hash Functions
• One-way Hash, not injective → may have collision
• Proof of integrity
[Reis]
Seite 68 Prof. Dr. A. Lehmann | IT Security
Hash Functions
• Based on compression function
M1 M2 Mn + Padding
IV G G … G Hash Value
[Ecke]
Seite 69 Prof. Dr. A. Lehmann | IT Security
Example Hash Function
• Message Digest Algorithm 5 (MD5)
• Only 2128 different hash values → many existing files with same hash value
• Two very similar inputs should not result in same hash value (collision
resistance)
[Reis]
Seite 70 Prof. Dr. A. Lehmann | IT Security
Message Authentication Code (MAC)
• Data integrity and authenticity of source of data
Message
MAC MAC MAC
Key Key
Algorithm Algorithm
[Ecke]
Seite 71 Prof. Dr. A. Lehmann | IT Security
HMAC Method
• Uses key to vary initial vector
• Uses hash function H (compression function block size B) and a secret key K
[Reis]
Seite 72 Prof. Dr. A. Lehmann | IT Security