chapter 2 cryptography

Upload: pervin26

Post on 07-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Chapter 2 Cryptography

    1/27

    Click to edit Master subtitle style

    4/22/12

    Basic Encryption Concepts

    Chapter 1

  • 8/3/2019 Chapter 2 Cryptography

    2/27

    4/22/12

    Some terminologies

    Sender, S usually is referred as Alice. Is aperson who sends a message

    Recipient, R usually is referred as Bob. Isa person who receives a message sent byAlice

    Attacker or also called as anintruder/interceptor

  • 8/3/2019 Chapter 2 Cryptography

    3/27

    4/22/12

    Some terminologies

    Encryption: or also called as encoding,encipherment

    Definition: process of scrambling a message so thatits meaning is not obvious/unreadable/cannot be

    understood

    Decryption: also called as decoding,decipherment.

    A reverse process of encryption

    A system for encryption and decryption iscalled a cryptosystem

  • 8/3/2019 Chapter 2 Cryptography

    4/27

    4/22/12

    Some terminologies

    Plaintext,p: original form of a message

    Ciphertext, c: the encrypted form of amessage

    Key: a device to encrypt and decrypt themessage

    In mathematical form,C = E k(M)

    Encryption

    Plaintext

    Key Ciphe

    rtext

    Decryption

    Originalplaintext

    Key

  • 8/3/2019 Chapter 2 Cryptography

    5/27

    4/22/12

    Some terminologies

    Cryptanalysis: by an attacker, trying to findout the original message by studying theencryption and encrypted messages.

    A person who does the cryptanalysis iscalled a cryptanalyst

    Tries to break the algorithm

  • 8/3/2019 Chapter 2 Cryptography

    6/27

    4/22/12

    The intruder

    Block message: prevent it from reaching R,affecting availability

    Intercept message: read or listen it,affecting the confidentiality

    Modify message: seize or change it in someway, affecting the integrity

    Fabricate an authentic-looking message:

    arrange for it to be delivered as is it camefrom S, affecting the authenticity

  • 8/3/2019 Chapter 2 Cryptography

    7/27

    4/22/12

    Therefore the securityobjectivesConfidentiality

    Integrity

    Authenticity

    Availability

    (CIAA)

  • 8/3/2019 Chapter 2 Cryptography

    8/27

    4/22/12

    Two types of cryptosystem:

    Symmetric encryption: Encryption anddecryption are using the same key. It is amirror-image process.

    Eg: Data Encryption Standard (DES),Advanced Encryption Standard (AES)

    Asymmetric encryption: encryption anddecryption are using different keys and

    process.Alice encrypts a message using Bobs public

    key and Bob decrypt the message using hisprivate key

  • 8/3/2019 Chapter 2 Cryptography

    9/27

    4/22/12

  • 8/3/2019 Chapter 2 Cryptography

    10/27

    4/22/12

    Two ways of doing encryptionalgorithmSubstitution: a process of exchanging a

    series of bits to another series of bits

    Provide diffusion

    Permutation: or also called as transposition,a process of rearranging the order of bits

    Provide confusion

    Both diffusion and confusion arecryptographic concepts introduced byShannon.

  • 8/3/2019 Chapter 2 Cryptography

    11/27

    4/22/12

    Confusion

    The cipher must show an avalanche effect.

    The desired effect is called Strict AvalancheCriterion (SAC)

    Definition: if a single bit is complemented in inputbits, it will cause each of the output bit to changewith a probability of half (0.5)

    Avalanche effect can be achieved using

    permutation.

  • 8/3/2019 Chapter 2 Cryptography

    12/27

    4/22/12

    Example of encryption usingsubstitution technique

    1) Caesar CipherEach letter is translated to the letter a fixed

    number of places after it in the alphabet.

    Caesar used a shift of 3

    Encryption using caesar cipher:

    c i= E(pi) =pi + 3

    Decryption using caesar cipher:p i= D(ci) = ci - 3

  • 8/3/2019 Chapter 2 Cryptography

    13/27

    4/22/12

    Caesar Cipher

    Full translation chart of caesar cipher:

    Eg: using this encryption, the message

    TREATY IMPOSSIBLE

    Would be encoded as

    P:T R E A T Y I M P O S S I B L E

    c: w u h d w b l p s r v v l e o h

    Plaintext 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

    Ciphertext d e f g h i j k l m n o p q r s t u v w x y z a b c

  • 8/3/2019 Chapter 2 Cryptography

    14/27

    4/22/12

    weaknesses of Ceasar cipher

    The same letters always translated to thesame another letters

    The ciphertexts retain the space as in theplaintext

    Therefore a cryptanalyst can easily derive apattern from ciphertext if the plaintext is inenglish words

  • 8/3/2019 Chapter 2 Cryptography

    15/27

    4/22/12

    Example of encryption usingsubstitution technique

    1) Vernam CipherA type of one-time pad (OTP) encryption

    OTP is considered as a perfect cipher.

    OTP involves an arbitrary longnonrepeating sequence of numbers thatare combined with the plaintext.

    Different message will be using different

    nonrepeating key, and this key is notreused. In other words, the key is only usedonce.

  • 8/3/2019 Chapter 2 Cryptography

    16/27

    4/22/12

    Vernam cipher

    Eg:

    Plaintext V E R N A M C I P H E R

    Numeric equivalent 21 4 17 13 0 12 2 8 15 7 4 17

    + random number 76 48 16 82 44 3 58 11 60 5 48 88

    = sum 97 52 33 95 44 15 60 19 75 12 52 105

    = mod 26 19 0 7 17 18 15 8 19 23 12 0 1

    Ciphertext t a h r s p i t x m a b

  • 8/3/2019 Chapter 2 Cryptography

    17/27

    4/22/12

    Example of encryption usingpermutation technique

    1) columnar transpositionsRearrange the characters of the plaintext

    into columns

  • 8/3/2019 Chapter 2 Cryptography

    18/27

    4/22/12

    Example of columnartranspositionPlaintext: THIS IS TO SHOW HOW ACOLUMNAR TRANSPOSITION WORKS.

    We arrange the letters in five columns as:

    T H I S IS T O S H

    O W H O W

    A C O L U

    M N A R TR A N S P

    O S I T I

    O N W O R

    K S x x x

    The resulting ciphertext wouldthen be read down the columnsas:

    tsoamrook htwcnasnsiohoaniwx xsolrstoxihwutpirx

  • 8/3/2019 Chapter 2 Cryptography

    19/27

    4/22/12

    Good Encryption algorithm

    Shannon proposed several characteristicson a good cipher:

    1.The amount of secrecy needed shoulddetermine the amount of labor appropriate

    for the encryption and decryption

    2.The set of eys and the enciphering algorithmshould be free from complexity

    3.The implementation of the process should beas simple as possible

    4. Errors in ciphering should not propagate andcause corruption of further information in the

    message

  • 8/3/2019 Chapter 2 Cryptography

    20/27

    4/22/12

    Stream cipher

    Caesar and vernam cipher are streamciphers

    The cipher operates bit by bit

    More suitable for communication

    Find out what are the

    disadvantages andadvanta es of

  • 8/3/2019 Chapter 2 Cryptography

    21/27

    4/22/12

    Block cipher

    The cipher operates on a block of bits

    Harder for a cryptanalyst to break the code.

    A block cipher encrypts a group of plaintext

    symbols as one block. Columnartransposition are examples of blockciphers.

  • 8/3/2019 Chapter 2 Cryptography

    22/27

    4/22/12

    Example of block ciphers

    Data Encryption Standard (DES)

    Two fundamental building blocks ofencryption: substitution and transposition

    The strength: repeated application of thesetwo techniques, one of top of the other, fora total of 16 cycles.

    Encrypt the plaintext as blocks of 64 bits.

    The key is 64 bits long

    Suitable for implementation on a single-purpose chip.

  • 8/3/2019 Chapter 2 Cryptography

    23/27

    4/22/12

    DES

    Figure 2-8 Cycles of Substitution andPermutation.

  • 8/3/2019 Chapter 2 Cryptography

    24/27

    4/22/12

    Example of block cipher

    Advanced Encryption Standard (AES)

    Invented by two Belgian cryptographers,Vincent Rijmen and Joan Daemen

    Fast algorithm, has strong mathematicalfoundation; uses substitution, transposition,and the shift, exclosive OR, and additionoperations.

    It also repeats cycles, or also called rounds.

    There are 10,12 or 14 cycles for keys of128, 192 and 256 bits respectively.

  • 8/3/2019 Chapter 2 Cryptography

    25/27

    4/22/12

    AES

    Consists of four steps:

    Byte substitution; uses substitution boxstructure similar to the DES, substituting eachbyte of a 128 bit block according to a

    substitution table

    Shift row: a transposition step.

    Mix column: this step involves shifting left and

    exclusive-Oring bits with themselves.Add subkey: Here, a portion of the key unique

    to this cycle is exclusive-Ored with the cycleresult.

  • 8/3/2019 Chapter 2 Cryptography

    26/27

    4/22/12

    AES

    Figure: AES Algorithm.You may go here http://www.cs.bc.edu/~

    straubin/cs381-05/blockciphers/rijndael_ingles2004.swf

    to experience the simulation of AES

    http://www.cs.bc.edu/~straubin/cs381-05/blockciphers/rijndael_ingles2004.swfhttp://www.cs.bc.edu/~straubin/cs381-05/blockciphers/rijndael_ingles2004.swfhttp://www.cs.bc.edu/~straubin/cs381-05/blockciphers/rijndael_ingles2004.swfhttp://www.cs.bc.edu/~straubin/cs381-05/blockciphers/rijndael_ingles2004.swf
  • 8/3/2019 Chapter 2 Cryptography

    27/27

    4/22/12

    Comparison of DES and AES

    DES AESDate 1976 1999

    Block size 64 bits 128 bits

    Key length 56 bits

    (effectivelength)

    128, 192, 256

    (and possiblymore) bits

    Encryptionprimitives

    Substitutionand

    permutation

    Substitution,shift, bit mixing

    Cryptographicprimitives

    Confusion anddiffusion

    Confusion anddiffusion

    Design Open Open

    Design Closed Open