encrypt basics

Upload: dellendo-farquharson

Post on 05-Apr-2018

238 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Encrypt Basics

    1/28

    Basics of Cr ypt ogr aphy

  • 7/31/2019 Encrypt Basics

    2/28

    Ter minology

    Plaint ext - t he or iginal message

    Cipher t ext - t he coded message

    Cipher - algor it hm f or t r ansf or ming plaint ext t ocipher t ext

    key - inf o used in cipher known only t osender / r eceiver

    Cr ypt analysis (codebreaking) - t he st udy of

    pr inciples/ met hods of decipher ing cipher t extwit hout knowing key

    Cr ypt ology - t he f ield of bot h cr ypt ography andcrypt analysis

  • 7/31/2019 Encrypt Basics

    3/28

    Mor e Ter minology

    Symmet r ic Encr ypt ion

    Bot h Sender / Receiver use t he same

    algor it hms/ keys f orencr ypt ion/ decr ypt ion

    Asymmet r ic Encr ypt ion

    Sender / r eceiver can employ dif f er entkeys

  • 7/31/2019 Encrypt Basics

    4/28

    Symmet r ic Encrypt ion Model

  • 7/31/2019 Encrypt Basics

    5/28

    Encr ypt ion Basics

    Gen() algor it hm f or gener at ing keys

    Encr ypt ion algor it hm t o conver t

    plaint ext int o cipher t ext E(M, keys) = C

    Decr ypt ion algor it hm t o conver t

    cipher t ext t o plaint ext D(C, keys) = M

  • 7/31/2019 Encrypt Basics

    6/28

    Some ear ly cipher s

    Subst it ut ion (eg., Caesar cipher )

    Secur it y is har d: t f dvsj uz j t ibse

    C = (M+k) mod 26

    M = (C-k) mod 26

    Only 26 possibilit ies wit h EnglishAlphabet

    Br ut e For ce sear ch can decr ypt

  • 7/31/2019 Encrypt Basics

    7/28

    Monoalphabet ic cipher

    I nst ead of plain r ot at ion, use r andom

    let t er subst it ut ion

    Key is 26 let t er s longPlain: abcdefghijklmnopqrstuvwxyz

    Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN

    Plaintext: security is hard

    Ciphertext: AFVOYWUZ WA JDYQ

  • 7/31/2019 Encrypt Basics

    8/28

    Monoalphabet ic cipher

    26! Combinat ions

    Dif f icult t o decr ypt ?

    Not r eally!

    Language gives lot s of hint s

    Single let t er s are I or A

    Most common let t er E

    Use Lang. char act er ist ics t o break

  • 7/31/2019 Encrypt Basics

    9/28

    English let t er Fr equencies

  • 7/31/2019 Encrypt Basics

    10/28

    Br eaking subst it ut ion cipher s

    Use Let t er f r equencies of cipher t ext

    Compar e t o plaint ext f r equencies

    These dont change enable analysis

    Use common t wo-let t er wor ds et c.

  • 7/31/2019 Encrypt Basics

    11/28

    Measur es of cipher s

    Shannon Secrecy

    Pr (M = m| E(K,m) = c) = Pr (M = m)

    Pr obabilit y of guessing t he plaint ext

    knowing t he cipher t ext = pr obabili t y of

    guessing plaint ext wit hout knowing

    cipher t ext

  • 7/31/2019 Encrypt Basics

    12/28

    Per f ect Secr ecy

    Pr ( E(K, m) = c) = Pr (E(K, m) = c)

    Pr obabilit y of any message giving a

    cipher t ext is t he same

  • 7/31/2019 Encrypt Basics

    13/28

    Block vs. St r eam cipher s

    Block cipher s encr ypt block at a t ime

    Message is br oken int o blocks and

    encrypt ed

    St r eam cipher s pr ocess a bit or byt eat a t ime dur ing

    encr ypt ion/ decr ypt ion

  • 7/31/2019 Encrypt Basics

    14/28

    Shannon and ciphers

    Claude Shannon int r oduced idea ofsubst it ut ion-per mut at ion (S-P) net wor ks(1949) t he basis of moder n block ciphers

    S-P net wor ks ar e based on t he t wopr imit ive crypt ogr aphic oper at ions: subst it ut ion(S-box)

    per mut at ion(P-box)

    Pr ovide conf usionand dif f usionof message

  • 7/31/2019 Encrypt Basics

    15/28

    Conf usion and Dif f usion

    Cipher needs t o complet ely obscur e

    st at ist ical pr oper t ies of or iginal message

    Shannon suggest ed conf usion & dif f usion Dif f usion dissipat es st at ist ical st r uct ure

    of plaint ext over bulk of cipher t ext

    Conf usion makes r elat ionship bet ween

    cipher t ext and key as complex as possible

  • 7/31/2019 Encrypt Basics

    16/28

    Shannons one-t ime pad

    Choose a key as long as t he message

    E (M, k) = k XOR M = C

    D (C, k) = k XOR C = M Choose k r andomly (unif or mly

    dist r ibut ed in {0,1}l ), l = message

    lengt h One-t ime pad has per f ect secr ecy

    Pr ( m xor k = c) = Pr (m xor k = c) = 2-l

  • 7/31/2019 Encrypt Basics

    17/28

    One t ime pad

    Each key wor ks only once

    Wor ks wit h f ixed lengt h messages

    Key lengt h = message lengt h

    Not ver y pr act ical

  • 7/31/2019 Encrypt Basics

    18/28

    Fiest el Cipher

  • 7/31/2019 Encrypt Basics

    19/28

    Fiest el Cipher (I BM, 70s)

    Par t it ions input block int o t wo halves

    Employs mult iple r ounds of processing

    Per f orms a subst it ut ion on lef t dat a halfbased on a f n. of r ight half & subkey

    Employs permut at ion swapping halves

    I mplement s Shannons subst it ut ion-per mut at ion net wor k concept

  • 7/31/2019 Encrypt Basics

    20/28

    Cipher par amet er s

    Block size incr easing size improves secur it y, but slows cipher

    key size

    incr easing size improves secur it y, makes exhaust ive keysear ching har der , but may slow cipher

    Number of r ounds incr easing number improves secur it y, but slows cipher

    Subkey generat ion

    great er complexit y can make analysis harder , but slowscipher

    Round f unct ion great er complexit y can make analysis harder , but slows

    cipher

  • 7/31/2019 Encrypt Basics

    21/28

    Decr ypt ion

  • 7/31/2019 Encrypt Basics

    22/28

    DES cipher

    Dat a Encr ypt ion St andar d

    Most widely used block cipher in

    world Adopt ed in 1977 by NI ST as a

    st andar d

    Encr ypt s 64-bit dat a using 56-bit key Based on I BMs Lucif er cipher (128-

    bit key)

  • 7/31/2019 Encrypt Basics

    23/28

    DES Encrypt ion

  • 7/31/2019 Encrypt Basics

    24/28

    I nit ial per mut at ion

    Fir st st ep of t he dat a comput at ion

    I P r eor der s t he input dat a bit s

    Even bit s t o LH half , odd bit s t o RHhalf

    Quit e r egular in st r uct ur e

    easy t o build h/ w

  • 7/31/2019 Encrypt Basics

    25/28

    DES Rounds

    Uses t wo 32-bit L & R halves

    Similat t o Feist el cipher can descr ibe as:

    Li = Ri1Ri = Li1 xor F(Ri1, Ki)

    Takes 32-bit R half and 48-bit subkey and: expands R t o 48-bit s using perm E

    adds t o subkey passes t hr ough 8 S-boxes t o get 32-bit r esult

    f inally per mut es t his using 32-bit perm P

  • 7/31/2019 Encrypt Basics

    26/28

    DES Round

  • 7/31/2019 Encrypt Basics

    27/28

    St r engt h of DES

    56-bit keys have 256 = 7.2 x 1016 values

    Br ut e f or ce sear ch r equir es lot of wor k

    But , possible in 1997 on I nt ernet in a f ew mont hs

    in 1998 on dedicat ed h/ w in a f ew days

    in 1999 above combined in 22hr s!

    Must be able t o r ecognize plaint ext

    Alt er nat ives t o DES being consider ed

  • 7/31/2019 Encrypt Basics

    28/28

    Ref er ences

    [1] Net wor k Secur it y Essent ials,Applicat ions and St andar ds, 2nd

    edit ion by William St allings Chapt er 2