Вы находитесь на странице: 1из 38

Terminologies

• Plaintext: Message or data which are in their


normal, readable (not crypted) form.

• Encryption: Encoding the contents of the


message in such a way that hides its contents
from outsiders.

• Ciphertext: The encrypted message


Terminologies
• Decryption: The process of retrieving the
plaintext back from the ciphertext.

• Key: Encryption and decryption usually


make use of a key, and the coding method
is such that decryption can be performed
only by knowing the proper key.
Terminologies
• Cryptography is the art or science of
keeping messages secret. It deals with all
aspects of secure messaging,
authentication, digital signatures, electronic
money, and other applications.

• Cryptosystems: A cryptographic system


(cryptosystem) consists of a pair of data
transformations, namely encryption and
decryption.
Terminologies
• Cryptanalysis: The art of breaking ciphers,
i.e. retrieving the plaintext without knowing
the proper key.

• Cryptographers: People who do


cryptography

• Cryptanalysts: practitioners of cryptanalysis


Conventional Cryptosystem
Principles
• An cryptosystem has the following five
ingredients:
– Plaintext
– Encryption algorithm
– Secret Key
– Ciphertext
– Decryption algorithm
• Security depends on the secrecy of the
key, not the secrecy of the algorithm
Conventional Cryptosystem
Principles

Ciphertext
C=EK(M)

Plaintext Encryption Decryption Plaintext


Message (M) Message (M)
Process E Process D

Encryption Decryption
Key (K) Key (K')
Classifications
• Classification of cryptosystems
– Symmetric cryptosystems
– Asymmetric cryptosystems
Symmetric Cryptosystem
• The same key is used for both encryption and
decryption purposes

Ciphertext
C=EK(M)
Plaintext Encryption Decryption Plaintext
Message (M) Message (M)
Process E Process D

Key (K)
Symmetric Cryptosystem
• Examples of symmetric cryptosystem are Data
Encryption Standard (DES)

• Problem : How do we distribute the key securely?


Key Distribution
• A key could be selected by A and physically
delivered to B.

• A third party could select the key and physically


deliver it to A and B.

• If A and B have previously used a key, one


party could transmit the new key to the other,
encrypted using the old key.
Key Distribution
• If A and B each have an encrypted connection
to a third party C, C could deliver a key on the
encrypted links to A and B.

• Session key:
– Data encrypted with a one-time session
key.At the conclusion of the session the key
is destroyed
Key Distribution
• Permanent key:
– Used between entities for the purpose of
distributing session keys

• Protocol:
– Defines the detail formats of messages sent
from one entity to the another to accomplish
a job
Assymmetric Cryptosystem
• Different keys are used for encryption and
decryption purposes.

• The pair of keys are mathematically related and


consist of a public key that can be published
without doing harm to the system's security and a
private key that is kept secret.

• Also known as public key cryptosystems


Assymmetric Cryptosystem
• The public key is used for encryption purposes
and lies in the public domain.
• Anybody can use the public key to send an
encrypted message.
• The private key is used for decryption purposes
and remains secret.
• An example of a public cryptosystem is the RSA
cryptosystem.
Assymmetric Cryptosystem

Ciphertext
C=EK(M)
Plaintext Encryption Decryption Plaintext
Message (M) Message (M)
Process E Process D

Public key Private key (K')


(K)
Types of Ciphers
• Ciphers can be broadly classified into the
following two categories depending upon
whether
(i) a symbol of plaintext is immediately converted
into a symbol of ciphertext (Stream Ciphers)
(ii) or a group of plaintext symbols are converted as a
block into a group of ciphertext symbols (Block
Ciphers)
Stream Ciphers:

 Stream cipher encrypts a single character or bit of plaintext at a time.


It also decrypts a single character or bit of ciphertext at a time.
 Call the plaintext stream P, the ciphertext stream C, and the key
stream K.

 Figure below shows the idea behind stream cipher.


 Characters in the plaintext are fed into encryption algorithm, one at a
time.

 The ciphertext
characters are also
created one at a
time.

Figure: Idea behind stream cipher

9.17
Stream Ciphers (continued…)
Example:

 Given plaintext: 10011011110100001


Let the keystream be a stream of 1s and 0s.
 If we use an exclusive or (XOR) with the keystream and plaintext, we get
ciphertext.
 This keystream is called periodic, since the sequence '10' repeats over
and over.
       
Plaintext : 10011011110100001
Keystream : 10101010101010101
Ciphertext : 00110001011110100 (by XORing each plaintext bit with corresponding keystream bit)

 To decrypt this ciphertext, all we need to do is again XOR the ciphertext


with the keystream:
Ciphertext : 00110001011110100
Keystream : 10101010101010101
Plaintext (XOR) : 10011011110100001

9.18
Block Ciphers:

 A symmetric-key modern block cipher encrypts an


n-bit block of plaintext or decrypts an n-bit block of ciphertext
together.
 The decryption algorithm must be the inverse of the encryption
algorithm.
 Both operations must use the same secret key of k-bit length so that
Bob can retrieve the message sent by Alice.
 If the message has the fewer than n bits, padding must be added to make
it an n-bit block.
 If the message has more than n bits, it should be divided into n-bit blocks
and the appropriate padding must be added to the last block if necessary.
 The common values of n are 64, 128, 256, or 512 bits.

9.19
Block Ciphers (continued…):
 Block ciphers are currently better analyzed, and seem to have a broader
range of applications. Many current ciphers are block ciphers. Example: Data
Encryption Standard (DES), Advanced Encryption Standard (AES), and IDEA
all are block algorithms.
 In a block cipher, a group of plaintext symbols of size m (m > 1) are
encrypted together creating a group of ciphertext of the same size. A single
key is used to encrypt the whole block even if the key is made of multiple
values.
 Figure below shows the general idea of encryption and decryption in a
modern block cipher.

Figure: A modern block cipher

9.20
Block Ciphers (continued…):

Example

Plaintext : The only thing we have to fear is fear itself

Modified plaintext : Theonlythingwehavetofearisfearitself

Plaintext blocks : Theonlyt hingweha vetofear isfearit selfXend (break the plaintext into 8-character block)

Ciphertext blocks : tylnoehT ahewgnih raefotev tiraefsi dneXfles (just reverse each plaintext block)

Ciphertext : tylnoehTahewgnihraefotevtiraefsidneXfles

9.21
Stream Ciphers
• A symbol of plaintext is immediately converted
into a symbol of ciphertext
• Advantages
– Speed of transformation
– Low error propagation
• Disadvantages
– Low diffusion
– Susceptible to malicious insertions and modifications
Block Ciphers
• A group of plaintext symbols are converted as a
block into a group of ciphertext symbols
• Advantages
– Diffusion
– Immunity to insertions
• Disadvantages
– Slowness of encryption
– Error propagation
General Types of Ciphers
• Substitution ciphers
– Letters of the plaintext messages are replaced
with other letters during the encryption

• Transposition ciphers
– The order of plaintext letters is rearranged
during encryption
General Types of Ciphers
• Product ciphers
– Combine two or more ciphers to enhance the
security of the cryptosystem
Trends
• Block size: larger block sizes mean greater
security
• Key Size: larger key size means greater
security
• Number of rounds: multiple rounds offer
increasing security
Traditional Substitution Symmetric- Key Ciphers
Monoalphabetic Ciphers
 In monoalphabetic substitution, the relationship between a symbol in the
plaintext to a symbol in the ciphertext is always one-to-one.
 That is, a character or symbol in the plaintext is always changed to the
same character or symbol in the ciphertext regardless of its position in the
text.
 For example, if letter A in the plaintext is changed to letter D, every letter A
is changed to letter D.
 Additive cipher, Caesar cipher, multiplicative cipher, affine cipher etc. are
some examples of monoalphabetic ciphers.

Example:
The following shows a plaintext and its corresponding ciphertext. The cipher is
probably monoalphabetic because both l’s (els) are encrypted as O’s.

Plaintext: hello Ciphertext: KHOOR

4.27
Traditional Substitution Symmetric- Key Ciphers
Polyalphabetic Ciphers
 In polyalphabetic substitution, each occurrence of a character may have a
different substitute.
 The relationship between a character in the plaintext to a character in the
ciphertext is one-to-many.
 For example, if letter “a” could be enciphered as “D” in the beginning of
the text, but as “N” at the middle.
 Polyalphabetic ciphers have the advantage of hiding the letter frequency
of the undelying language. Eve cannot use the single-letter frequency
statistics to break the ciphertext.
 Autokey cipher, playfair cipher, vigenere cipher, Hill cipher etc. are some
examples of polyalphabetic ciphers.

Example:

The following shows a plaintext and its corresponding ciphertext. The cipher
is polyalphabetic because each l (el) is encrypted by a different character.
The first l (el) is encrypted as N; the second as Z.

Plaintext: hello Ciphertext: ABNZF

4.28
Substitution Cipher: Additive Cipher
 The simplest monoalphabetic cipher is the additive cipher. This cipher is
sometimes called a shift cipher and sometimes a Caesar cipher, but the term
additive cipher better reveals its mathematical nature.
 Assume that the plaintext consists of lowercase letters (a to z), and that the
ciphertext consists of uppercase letters (A to Z).
 To be able to apply mathematical operations on the plaintext and ciphertext,
we assign numerical values to each letter as shown in the figure below.

Figure : Plaintext and ciphertext in Z26

Note:
 Each character (uppercase or lowercase) is assigned an integer in Z 26. The
secret key between Alice and Bob is also an integer in Z 26.
 For simplicity, lowercase characters are used as plaintext and uppercase
characters are used as ciphertext.

4.29
Substitution Cipher: Additive Cipher

 When the cipher is additive, the plaintext, ciphertext, and key are integers in
Z26.
 The encryption algorithm adds the key to the plaintext character; the
decryption algorithm subtracts the key from the ciphertext character. That is,
encryption and decryption are inverse of each other.
 Figure below shows the process of additive cipher.

Figure: Additive cipher

4.30
Substitution Cipher: Additive Cipher
Example:

Use the additive cipher with key = 15 to encrypt the message “hello”.

Solution

We apply the encryption algorithm to the plaintext, character by character:

 The result is ‘WTAAD’.


 Note that two instances of the same plaintext character (l) are encrypted as
the same character (A). Hence additive cipher is monoalphabetic.

4.31
Substitution Cipher: Additive Cipher
Example:

Use the additive cipher with key = 15 to decrypt the message “WTAAD”.

Solution:

We apply the decryption algorithm to the plaintext character by character:

 The result is ‘hello’.


 Note that the operation is in modulo 26, which means that a negative result
needs to be mapped to Z26. (for example, -15 becomes 11).

4.32
Transposition Ciphers
• Rearrangement of the letters or a message
Columnar transposition
Plaintext Ciphertext
W H Y D O welrnel
E S I T A hswatta
L W A Y S yiaihhn
R A I N I dtyneed
N T H E N oasinrs
E T H E R
L A N D S
Characteristics of good cipher
• Shannon characteristics
– The amount of secrecy should determine the amount
of labor appropriate for the encryption and
decryption
– The set of keys and encryption algorithm should be
free of complexity
– The implementation of the process should be as
simple as possible
Characteristics of good cipher
– Errors in encryption should not propagate and cause
corruption of further information in the message.
– Ciphertext size should not be larger than plaintext

• Confusion
– The change in ciphertext triggered by an alteration in
the plaintext should be unpredictable
Characteristics of good cipher
• Diffusion
– Change in the plaintext should affect many parts of
the ciphertext

• Other issues
– Perfect secrecy vs. Effective secrecy
– Redundancy of languages
– Unicity distance
Methods of attack
• Ciphertext-only attack
– The attacker gets a ciphertext and tries to find
the corresponding plaintext.

• Known-plaintext attack
– The attacker has some plaintext and its
matching ciphertext. The task is to find a key
corresponding to this match.
Methods of attack
• Chosen-plaintext attack
– Here, the attacker selects a plaintext and ciphers it
using the cryptotechinque he attacks. The plaintext
may be chosen to ease the task of key finding.

Вам также может понравиться