Cryptography - PowerPoint PPT Presentation

1 / 42
About This Presentation
Title:

Cryptography

Description:

snoopers cannot read your credit card number when you send it to Amazon ... tapping hotel phone lines is much easier! or searching rubbish bins ... – PowerPoint PPT presentation

Number of Views:212
Avg rating:3.0/5.0
Slides: 43
Provided by: computin7
Category:

less

Transcript and Presenter's Notes

Title: Cryptography


1
Cryptography
  • Simple Ciphers
  • Modern Cryptography
  • System (secure email)
  • Reading Anderson, chap 5 Singh book and website
    for simple ciphers and historical background

2
Cryptography terminology
  • Encryption convert plaintext message into a
    ciphertext that looks like gibberish
  • Charge 300 to VISA 4560720112985409 becomes
  • iQA/AwUBO8RZysYL3oijlaCiEQI3OwCgm7UzwxUW26KR/emgIB
    sFavKAdgAoN4F
  • Decryption convert ciphertext back into the
    original plaintext
  • iQA/AwUBO8RZysYL3oijlaCiEQI3OwCgm7UzwxUW26KR/emgIB
    sFavKAdgAoN4F becomes
  • Charge 300 to VISA 4560720112985409

3
Cryptography Terminology
  • Encryption and decryption are based on an
    algorithm and a key
  • sometimes two keys, one for encryption and one
    for decryption
  • The algorithm is assumed to be public knowledge,
    but the key is secret
  • Cryptanalysis is deciphering a text without
    knowing the key
  • speciality of GCHQ, NSA, etc

4
Cryptography Usage
  • Privacy we encrypt messages so third parties
    cannot read them
  • snoopers cannot read your credit card number when
    you send it to Amazon
  • Authenticity we encrypt messages to prove they
    are not from by a third party
  • snoopers cannot forge an encrypted message to
    Amazon ordering 300 of books and charging it to
    our account

5
Singh Website
  • http//www.simonsingh.net/The_Black_Chamber/home.h
    tml
  • Caesar cipher
  • Pigpen cipher
  • Monoalphabetic cipher
  • Vigenere cipher

6
Caesar Cipher
  • One of the simplest, add K to each character
  • Meet me is encrypted as
  • Nffu nf (K1)
  • Oggv og (K2)
  • Etc
  • Algorithm is addition, key is K

7
Cryptanalysis
  • Decode the following
  • M jsyrh mx
  • Techniques
  • exhaustive search
  • special patterns (eg, 1-letter words)
  • frequencies

8
Monoalphabetic Cipher
  • Only 26 keys in Caesar cipher, need more keys
  • Monoalphabetic cipher - more complex letter
    mappings
  • Can be based on a key word

9
Example
  • Key Computers
  • Mapping
  • abcdefghijklmnopqrstuvwxyz
  • computersabdfghijklnqvwxyz
  • Encryption example
  • meet me becomes
  • fuun fu

10
Cryptanalysis
  • Example from web page
  • Use
  • Frequencies of letters
  • Frequencies of letter combinations
  • Knowledge about likely words
  • Knowledge about likely keys

11
Vigenere Cipher
  • Need a cipher that doesnt always map plaintext
    letters to the same ciphertext
  • Vigenere Use a set of mappings, repeated every
    Nth character

12
Example
  • Caesar cipher, Key run
  • Example
  • tobeornottobe (drop blanks)
  • runrunrunrunr (repeated key)
  • KIOVIEEIGKIOV (encrypted)
  • Ktr(17), I ou(20), O bn(13)

13
Cryptanalysis
  • Look for repeated letter groups, use to find key
    length
  • Then decrypt each key letter separately
  • Less obvious, generally requires some knowledge
    of cryptography or good mathematical insight

14
Enigma
  • More complex version of Vigenere, with multiple
    mechanical scramblers that map letters into
    ciphertext and advance after each letter.
  • Used by Germans in WW 2
  • British cryptanalysis efforts sparked the birth
    of the computer

15
Modern Cryptography
  • Three building blocks
  • Encrypt/decrypt using same key
  • Known as secret key
  • Encrypt/decrypt using different keys
  • Usually a public key and a private key
  • Encrypt only (decrypt impossible)
  • No key (not needed)
  • Known as hash or message digest

16
Mathematical Cryptography
  • Strong mathematical basis
  • Algorithms based on mathematics, especially
    number theory
  • Formal theories about difficulty of cryptanalysis
    without knowing key
  • Although generally assume P NP
  • Details in Anderson
  • More in Schneiers Applied Cryptography

17
Secret key SP-Networks
  • Secret keys done using SP-networks
  • An SP network is a series of substitutions and
    transpositions
  • substitution map bytes using lookup table
  • transpositions mix up bits from the different
    bytes.
  • Repeat N times
  • Reverse process to decrypt

18
Example
  • Substitution (like monoalphabetic)
  • A -
  • c - ß
  • Etc
  • Transposition
  • Swap 4 low-order bits of adjacent bytes
  • Dr (x44, x72) - Bt (x42, x74)

19
Key
  • Key can control substitutions and transpositions
  • Easier (and as effective) to add key to result
    after a round

20
AES
  • Advanced Encryption Standard (AES)
  • SP-Network with 10-14 rounds
  • Substitution and transpositions are fixed
  • Key added after each round
  • Keys are 16-32 bytes
  • Default for US govt
  • many others will use it as well
  • See Anderson for details
  • Probably cannot be cracked with current
    technology.

21
Public Key Cryptography
  • Algorithms with different encryption and
    decryption keys
  • knowing encryption key does not tell you
    decryption key, and vice-versa
  • RSA is best known
  • We can publish one key and keep other secret
  • Much slower (1000 times) than AES

22
Public Key Cryptography
  • Privacy - public encryption key, private
    decryption key
  • Anyone can send me a message that no one else can
    read
  • Authenticity - private encryption key, public
    decryption key
  • I can send a message to anyone else, and they can
    verify that it came from me

23
Maths Prime Numbers (RSA)
  • Public encrypt key
  • N product of two primes P and Q
  • E another number (some constraints)
  • Encryption Take plaintext to power E, ciphertext
    is result modulo N
  • Decryption take cipher text to power D,
    plaintest is result mod N
  • D is private key
  • D cannot be calculated from E and N (public
    key), unless N can be factored

24
Example
  • P 3, Q 11, N PQ 33 E 3
  • Plaintext 5
  • Ciphertext 5 3 mod 33 26
  • D 7 (computed from P, Q)
  • Decrypt 267 mod 33 5

25
Cryptanalysis
  • Can derive private key from public key if can
    factor the N component of public key
  • Can factor 512-bit number with 100s of CPU-years
  • Available to NSA, GCHQ (not random hacker)
  • Cannot factor 1024-bit number with present
    technology and maths

26
One-Way Hash Functions
  • Produce a fixed length key (typically 20 bytes)
    from a message of arbitrary size.
  • Given just key, cannot produce a text that hashes
    to this key
  • Example use password storage
  • if we store hashed passwords, then attacker wont
    know password even if he can read the password
    file

27
MD5
  • Popular hash func for passwords, etc
  • 64 rounds, in each round texts is broken into
    4-byte chunks which are combined in various ways
  • If MD5(X) Y and you are given Y
  • Cannot find X from Y
  • Some people think may be able to find XX such
    that MD5(XX) is also Y

28
Systems
  • How do all these components (secret key, public
    key, hash) work together in a complete system?
  • Sending email

29
S/MIME
  • Standard for sending secure email
  • Partially based/inspired on PGP
  • Similar systems (eg, SSL) used to encrypt
    Internet and Web traffic
  • Supported by most email clients
  • Sometimes problems with webmail clients

30
Send Private Email
  • How send private email?
  • AES but how distribute keys securely to
    recipients?
  • Public-key but too slow for large messages?

31
Send private email
  • Solution generate random key for AES or other
    SP algorithm
  • Encrypt this with public key (its short)
  • Encrypt main message with AES key

32
Send authenticated email
  • How?

33
Send authenticated email
  • Create a short message digest with hash
    function
  • Encrypt this with public key
  • Send plaintext message plus encrypted digest

34
How distribute keys?
  • Public and private keys are embedded in
    certificates
  • Option 1 People give each other their public-key
    certificates
  • Option 2 Certificates held in a central DB
  • certificate authorities
  • Can get free personal email certificate from
    Thwaite (and others)
  • Will discuss later in more detail

35
How produce random keys?
  • People bad at suggesting random keys
  • Random number functions on computers arent
    really random
  • Random-number hardware exists, but it is expensive

36
S/MIME Vulnerabilities
  • Assume victim (V) wants to send a secure email to
    her bank transferring money
  • How could an attacker (A) forge/modify the
    message to get the money transferred to his
    account?

37
S/MIME Vulnerabilities
  • Usual weaknesses in sender/receiver
  • Eg, virus takes over Vs computer, modifies email
    before it is sent
  • Worse, gets certificate so can forge arbitrary
    emails
  • Poor validation of certificate
  • A gets certificate saying he is V, because
    certificate authority does not check

38
Other Vulnerabilities
  • Traffic analysis
  • why is George sending 100s of encrypted emails to
    our competitor?
  • Cryptographic weakness
  • quantum computing
  • secret algorithms known only to NSA?

39
S/MIME (SSL) Summary
  • Cryptography itself is quite good
  • Major problem is human carelessness and
    dishonesty
  • I dont think anyone has ever stolen a credit
    card from an encrypted message
  • tapping hotel phone lines is much easier!
  • or searching rubbish bins
  • leakage by dishonest companies (or staff) is a
    much bigger threat

40
Cryptography Summary
  • Modern cryptography has a strong mathematical
    basis
  • Including formal theorems
  • Generally can use as a black box
  • Secret-key, public-key, hash
  • Main vulnerabilities in practice are due to human
    problems, not maths

41
Cryptography Coda
  • From Schneiers Secrets and Lies, p xii
  • Since writing Applied Cryptography, I have made
    a living as a cryptography consultant designing
    and analysing security systems. To my initial
    surprise, I found that the weak points had
    nothing to do with the mathematics. They were in
    the hardware, the software, the networks, and the
    people. Beautiful pieces of mathematics were
    made irrelevant through bad programming, a lousy
    operating system, or someones bad password
    choice.

42
Key Points
  • Cryptography encryption and decryption of
    messages
  • For privacy and authenticity
  • Modern crypto based on maths
  • Provides building blocks
  • Secret key, public key, hash
  • These put together into systems
  • Weak point is usually people, not maths
Write a Comment
User Comments (0)
About PowerShow.com