Preneel Cryptographic Algorithms 2011
Preneel Cryptographic Algorithms 2011
• 4. Networking protocols
– email, web, IPsec, SSL/TLS
• 5. New developments in cryptology
• 6. Cryptography best practices
• 7. Hash functions
Definitions
data entities
Confidentiality encryption anonymity
confidentiality
Integrity
Availability authentication data authentication identification
Authorisation
4
Cryptology: basic principles
CRYP CRYP
Clear %^C& %^C&
TOB
Clear
TOB @&^( @&^(
text OX OX text
Symmetric cryptology:
confidentiality
• old cipher systems:
– transposition, substitution, rotor machines
• the opponent and her power
• the Vernam scheme
• DES and triple-DES
• AES
• RC4
Old cipher systems (pre 1900)
7
Cryptanalysis example:
TIPGK RERCP JZJZJ WLE GVCTX EREPC WMWMW JYR
UJQHL SFSDQ KAKAK XMF HWDUY FSFQD XNXNX KZS
VKRIM TGTER LBLBL YNG IXEVZ GTGRE YOYOY LAT
WLSJN UHUFS MCMCM ZOH JYFWA HUHSF ZPZPZ MBU
XDTKO VOVGT NDNDN API KZGXB IVITG AQAQA NCV
YNULP WKWHU OEOEO BQJ LAHYC JWJUH BRBRB ODW
ZOVMQ XKXIV PFPFP CRK MBIZD KXKVI CSCSC PEX
APWNR YLYJW QGQGQ DSL NCJAE LYLWJ DTDTD QFY
BQXOS ZMXKX RHRHR ETM ODKBF MZMXK EUEUE RGZ
CRYPT ANALY SISIS FUN PELCG NANYL FVFVF SHA
DSZQU BOBMZ TJTJT GVO QFMDH OBOZM GWGWG TIB
ETARV CPCNA UKUKU HWP RGNEI PCPAN HXHXH UJC
FUBSW DQDOB VLVLV IXQ SHOFJ QDQBO IYIYI VKD
Plaintext? k = 17 8
Old cipher systems (pre 1900) (2)
• Substitutions
– ! Easy to
ABCDEFGHIJKLMNOPQRSTUVW
break using
XYZ
–
statistical
MZNJSOAXFQGYKHLUCTDVWBI techniques
PER
TRANS ORI S
• Transpositions
POSIT NOTIT
IONS OSAN
P 9
Security
• there are n! different substitutions on an alphabet
with n letters
• there are n! different transpositions of n letters
• n=26: n!=403291461126605635584000000 = 4 . 1026 keys
• trying all possibilities at 1 nanosecond per key
requires....
4.1026 /(109 . 105 . 4 102) = 1010 years
keys per seconds days per
second per day year
10
Letter distributions
11
Assumptions on Eve (the opponent)
• A scheme is broken if Eve can deduce the key
or obtain additional plaintext
• Eve can always try all keys till “meaningful”
plaintext appears: a brute force attack
– solution: large key space
• Eve will try to find shortcut attacks (faster
than brute force)
– history shows that designers are too optimistic
about the security of their cryptosystems
12
Assumptions on Eve (the opponent)
• Cryptology = cryptography + cryptanalysis
• Eve knows the algorithm, except for the key
(Kerckhoffs’s principle)
• increasing capability of Eve:
– knows some information about the plaintext (e.g., in
English)
– knows part of the plaintext
– can choose (part of) the plaintext and look at the ciphertext
– can choose (part of) the ciphertext and look at the plaintext
13
New assumptions on Eve
• Eve may have access to side channels
– timing attacks
– simple power analysis
– differential power analysis
– acoustic attacks
– electromagnetic interference
• Eve may launch (semi-)invasive attacks
– differential fault analysis
– probing of memory or bus 14
Side channel analysis
Oscilloscope
files transfer
The image cannot
Scope trigger
on IO
Current waveform
acquisition
Server Main PC
store the files run the Acquisition R
and run the Treatment software
GCR
software Card extention
command emission
Card
reader
Protection box
15
Timing attacks and power analysis
16
Side channel analysis: EMA
17
Cryptology + side channels
Eve
Alice Bob
CRYP CRYP
Clear %^C& %^C&
TOB
Clear
TOB @&^( @&^(
text OX OX text
18
Mechanical: Hagelin C38
19
Problem: what is this?
• Cryptogram [=14 January 1961 11.00 h]
• <AHQNE XVAZW IQFFR JENFV OUXBD
LQWDB BXFRZ NJVYB QVGOZ KFYQV
GEDBE HGMPS GAZJK RDJQC VJTEB
XNZZH MEVGS ANLLB DQCGF PWCVR
UOMWW LOGSO ZWVVV LDQNI YTZAA
OIJDR UEAAV RWYXH PAWSV CHTYN
HSUIY PKFPZ OSEAW SUZMY QDYEL
FUVOA WLSSD ZVKPU ZSHKK PALWB
SHXRR MLQOK AHQNE 11205
141100> 20
The answer
• Plaintext [=14 January 1961 11.00 h]
• DOFGD VISWA WVISW JOSEP HWXXW
TERTI OWMIS SIONW BOMBO KOWVO
IRWTE LEXWC EWSUJ ETWAM BABEL
GEWXX WJULE SWXXW BISEC TWTRE
SECVX XWRWV WMWPR INTEX WXXWP
RIMOW RIENW ENVOY EWRUS URWWX
XWPOU VEZWR EGLER WXXWS ECUND
OWREP RENDR EWDUR GENCE WPLAN
WBRAZ ZAWWC 21
The answer (in readable form)
• Plaintext [=14 January 1961 11.00 h]
• TRESECV. R V M PRINTEX. PRIMO
RIEN ENVOYE RUSUR. POUVEZ
REGLER. SECUNDO REPRENDRE
DURGENCE PLAN BRAZZA VIS A VIS
JOSEP H. TERTIO MISSION
BOMBOKO VOIR TELEX CE SUJET
AMBABELGE. JULES.
22
The Rotor machines (WW II)
23
Life cycle of a cryptographic algorithm
idea
mathematical analysis
publication
public evaluation
RIP OK
hw/sw implementation
standardization
P C C P
10010 ⊕ 11001 11001 ⊕ 10010
C
01011 01011
Vernam scheme
• 0+1=1
• 1+0=1
• 0+0=0
• 1+1=0
• identical
mathematical symbols
can result in different
electrical signals
26
Three approaches in cryptography
• information theoretic security
– ciphertext only
– part of ciphertext only
– noisy version of ciphertext
• system-based or practical security
– also known as “prayer theoretic” security
• complexity theoretic security:
model of computation, definition, proof
– variant: quantum cryptography
27
Model of a practical stream cipher
IV IV
output output
“looks”
function random function
P C P
28
A5/1 stream cipher (GSM)
18 0
21 0
22 0
205 162
092 013 ... 033 92
162 079 ... 099 143
i
j
33
RC4: weaknesses
• often used with 40-bit key
– US export restrictions until Q4/2000
• best known general shortcut attack: 2241
• weak keys and key setup (shuffle theory)
• some statistical deviations
– e.g., 2nd output byte is biased
– solution: drop first 256 bytes of output
• problem with resynchronization modes (WEP)
34
Block cipher
• large table: list n-bit ciphertext for each n-
bit plaintext
– if n is large: very secure (codebook)
– but for an n-bit block: 2n values
– impractical if n ≥ 32
• alternative n = 64 or 128
– simplify the implementation
– repeat many simple operations
35
Block cipher (2)
P1 P2 P3
C1 C2 C3
• larger data units: 64…128 bits
• memoryless
• repeat simple operation (round) many times 36
Data Encryption Standard (1977)
• encrypts 64 plaintext bits under control of a
56-bit key
• 16 iterations of a relatively simple mapping
• FIPS: US government standard for sensitive
but unclassified data
• worldwide de facto standard since early 80ies
• surrounded by controversy
37
Security of DES (56 bit key)
• PC: trying 1 DES key: 15 ns
• Trying all keys on 250 PCs:
1 month: 226 x 216 x 25 x 28= 255
• M. Wiener’s design (1993):
1,000,000 $ machine: 3 hours
(in 2010: 5 seconds)
1 2 3
41
Symmetric Key Lengths and Moore’s “law”
AES
-128
3-key
2-key 3DES
3DES
DES
S S S S S S S S S S S S S S S S
round
Key Schedule
round S S S S MixColumns
MixColumns S S S S MixColumns
S S S S MixColumns
S S S S
round
... • Key length: 16/24/32 bytes
.. • Block length:
round – Rijndael: 16/24/32 bytes
– AES: 16 bytes only
44
AES Status
• FIPS 197 published on Nov. 6, ‘01, effective May 26, ‘02
• mandatory for sensitive US govt. information
• mid 2003: AES-128 also for classified information and
AES-192/-256 for secret and top secret information!
• fast adoption in the market (thousands of products)
– Feb. 2010: 1290 AES product certifications by NIST http://
csrc.nist.gov/groups/STM/cavp/documents/aes/aesval.html
– standardization: ISO, IETF, IEEE 802.11,…
• slower adoption in financial sector
• software: 7.6 cycles/byte [Käsper-Schwabe’09]
• hardware: Intel will provide AES instruction (Westmere,
2010) at 0.75 cycles/byte for decryption
45
Encryption limitations
• Ciphertext becomes random string: “normal” crypto
does not encrypt a credit card number into a (valid)
credit card number
• Typically does not hide the length of the plaintext
(unless randomized padding)
• Does not hide existence of plaintext (requires
steganography)
• Does not hide that Alice is talking to Bob (requires
traffic confidentiality)
Symmetric cryptology:
data authentication
• the problem
• hash functions without a key
– MDC: Manipulation Detection Codes
• hash functions with a secret key
– MAC: Message Authentication Codes
47
Data authentication: the problem
• encryption provides confidentiality:
– prevents Eve from learning information on the
cleartext/plaintext
– but does not protect against modifications (active
eavesdropping)
• Bob wants to know:
– the source of the information (data origin)
– that the information has not been modified
– (optionally) timeliness and sequence
• data authentication is typically more complex
than data confidentiality 48
Data authentication: MAC algorithms
• Replace protection of authenticty
of (long) message by protection • CBC-MAC
of secrecy of (short) key • HMAC
• Add MAC to the plaintext
49
MAC algorithms
50
Data authentication: MAC algorithms
• typical MAC lengths: 32..96 bits
– Forgery attacks: 2m steps with m the MAC
length in bits
• typical key lengths: (56)..112..160 bits
– Exhaustive key search: 2k steps with k the key
length in bits
• birthday attacks: security level smaller than
expected
51
MAC algorithms
• Banking: CBC-MAC based on triple-DES
54
MDC Security requirements (n-bit result)
? x ≠ ? ? ≠ ?
h h h h h
58
Limitation of symmetric cryptology
• Reduce security of information to security of
keys
60
Public key cryptology: digital signature
61
A public-key distribution protocol: Diffie-Hellman
• Before: Alice and Bob have never met and share no
secrets; they know a public system parameter α
generate x αx generate y
compute α x compute α y
αy
compute k=(α y)x compute k=(α x) y
• encryption: c = me mod n
• decryption: m = cd mod n try to factor 2419
63
Factorisation records
2009: 768 bits or 232 digits
768 bits
512 bits
2000 2009
Picture of the11.7
4-channel Varian
spectrometer labT Oxford magnet,
room temperature bore
15=5x3
grad students in
sunny California...
65
Advantages of public key cryptology
• Reduce protection of information to
protection of authenticity of public keys
• Confidentiality without establishing secret
keys
– extremely useful in an open environment
• Data authentication without shared secret
keys: digital signature
– sender and receiver have different capability
– third party can resolve dispute between sender
and receiver 66
Disadvantages of public key cryptology
67
Crypto software libraries
http://ece.gmu.edu/crypto_resources/web_resources/libraries.htm
C/C++/C# Java
• Botan (C++) • SunJCA/JCE
• Cryptlib • BouncyCastle (BC)
• Crypto++ (C++) • CryptixCrypto (until ’05)
• Libgcrypt (C++) • EspreSSL
• MatrixSSL (C++) embedded • FlexiProvider
• Miracl (binaries) • GNU Crypto
• OpenSSL (C++) • IAIK
• Java SSL
• BouncyCastle (BC#) • RSA JSafe
Reading material
69
Selected books on cryptology
• D. Stinson, Cryptography: Theory and Practice, CRC
Press, 3rd Ed., 2005. Solid introduction, but only for the
mathematically inclined.
• A.J. Menezes, P.C. van Oorschot, S.A. Vanstone,
Handbook of Applied Cryptography, CRC Press,
1997. The bible of modern cryptography. Thorough and
complete reference work – not suited as a first text book.
Freely available at http://www.cacr.math.uwaterloo.ca/hac
• N. Smart, Cryptography, An Introduction: 3rd Ed.,
2008. Solid and up to date but on the mathematical side.
Freely available at http://www.cs.bris.ac.uk/~nigel/Crypto_Book/
• B. Schneier, Applied Cryptography, Wiley, 1996.
Widely popular and very accessible – make sure you get the
errata.
• Other authors: Johannes Buchmann, Serge Vaudenay
70
Books on network security and more
• W. Stallings, Network and Internetwork Security:
Priniples and Practice, Prentice Hall, 5th Ed.,
November 2009. Solid background on network security.
Explains basic concepts of cryptography. Tends to confuse
terminology for decrypting and signing with RSA.
• Nagand Doraswamy, Dan Harkins, IPsec - The New
Security Standard for the Internet, Intranets, and
Virtual Private Networks, Prentice Hall, 1999. A well
written overview of the IPsec protocol (but now outdated).
• W. Diffie, S. Landau, Privacy on the line. The
politics of wiretapping and encryption, MIT Press,
2007. The best book so far on the intricate politics of the
field.
71
More information: some links
• IACR (International Association for
Cryptologic Research): www.iacr.org
• IETF web site: www.ietf.org
• Cryptography faq: www.faqs.org/faqs/
cryptography-faq
• Counterpane links: www.counterpane.com/
hotlist.html
• Digicrime (www.digicrime.org) - not serious
but informative and entertaining
72