Computer Security I
Computer Security I
Unit 2: Authorization &
Authentication
Based on how they are applied to a plaintext message Cryptographic algorithms can be categorized as;
oBlock Cipher
oStream Cipher
Block Cipher
o Block Ciphers work on a fixed-length segment
of plaintext data, typically a 64-bit or 128-bit block as input, and outputs a fixed length
ciphertext.
oThe message is broken into blocks, and each
block is encrypted through a substitution process.
oWhere there is insufficient data to fill a block, the blank space will be padded prior to
encryption.
oThe resulting ciphertext block is usually the
same size as the input plaintext block.
oBlock ciphers are mostly used in symmetric key encryption.
oExamples - DES, Triple DES, RC2 and AES are
based on the block ciphers.
oColumnar transposition is a block cipher.
For example
A 150-bit plaintext message provides two blocks of 64 bits each with third block of balance 22 bits. The last block of bits needs to be padded up with
redundant information so that the length of the final block equal to block size of the scheme. In our
example, the remaining 22 bits need to have additional 42 redundant bits added to provide a complete block.
oThe process of adding bits to the last block is referred to as Padding.
oOne method of padding is the PKCS#5 by RSA
Block Cipher
Advantages:
oHigh diffusion: information from one plaintext
symbol is diffused into several ciphertext symbols.
oImmunity to tampering: difficult to insert symbols without detection.
Disadvantages:
oSlowness of encryption: an entire block must be accumulated before encryption / decryption can begin.
oError propogation: An error in one symbol may
corrupt the entire block.
Stream Cipher
oStream ciphers convert one bit of plaintext data
directly into a bit of ciphertext data.
oStream ciphers use substitution to encrypt, a cryptographic key is used to generate a pseudo-random stream of digits that are combined with the plaintext digits to create the ciphertext.
oThis keystream must be of the same length as the plaintext message.
oThe keystream is typically XOR'd with the
plaintext using a bitwise operation on individual bits.
oCan be used in real time communication such as VoIP
Stream Cipher
Advantages:
oSpeed of transformation: each bit is encrypted alone as soon as it is read
oLow error propagation: an error in encrypting
one bit likely will not affect subsequent bits.
Disadvantages:
oLow diffusion: all information of a plaintext bit is
contained in a single ciphertext bit.
oSusceptibility to insertions/ modifications: an active interceptor who breaks the algorithm might insert spurious text that looks authentic.
Block vs Stream Ciphers
Block vs Stream Ciphers
Most symmetric block ciphers are based on a the following scheme;
Feistel Cipher Structure
o Feistel Cipher is not a specific scheme of block cipher.
o It is a design model from which many different block ciphers are derived.
o DES is just one example of a Feistel Cipher.
o A cryptographic system based on Feistel cipher
structure uses the same algorithm for both encryption and decryption.
o Process through multiple rounds which partitions
Data Encryption Standard
Data Encryption Standard
(DES)
(DES)
1973, NIST published a solicitation
for an encryption standard
Uses a combination of substitution
and permutation methods to
provide confusion and diffusion
respectively
DES was adopted as encryption
Uses a combination of substitution and
permutation methods to provide confusion and diffusion respectively
Diffusion – dissipates statistical structure of plaintext over bulk of ciphertext.
oDiffusion means that the output bits should depend on the input bits in a very complex way.
oIn a cipher with good diffusion, if one bit of the plaintext is changed, then the ciphertext should change completely, in an unpredictable or pseudorandom manner
Confusion – makes relationship between ciphertext and key as complex as possible
oOne aim of confusion is to make it very hard to find the key even if one has a large number of plaintext-ciphertext pairs produced with the same key.
oTherefore, each bit of the ciphertext should depend on the entire key.
Data Encryption Standard
Data Encryption Standard
(DES)
(DES)
DES was the encryption standard
until 2001 when it was replaced
by AES.
Features:
-
Block size
= 64 bits
-
Key size
= Initially 64bits, reduced to
56 bits where 8 bits are used for
parity, then 48/56 bits are chosen at
random to be used
-
Number of rounds
= 16
DES Rounds
DES
DES
After initialization the DES
algorithm operates on blocks of
data
It splits a data block in half,
scrambles each half
independently, combines the key
with one half and swaps the two
halves.
Concerns About DES
Concerns About DES
The key size was too small (only 56
bits) **concern about brute force
attacks.
Not enough non- linearity. The only
non-linear elements are the S-boxes.
In cryptography, an S-Box(Substitution-box) is
a basic component of symmetric key algorithms which performs substitution. In block ciphers, they are typically used to obscure the
relationship between the key and the ciphertext — Claude Shannon's property of confusion.
Two strong attacks against DES:
Triple DES
Triple DES
Applies the Data Encryption
Standard (DES) cipher algorithm
three times to each data block.
Due to the availability of
Triple DES was designed to
provide a relatively simple
method of increasing the key size
of DES to protect against such
attacks, without designing a
completely new block cipher
algorithm.
No known practical attacks
Advanced Encryption Standard
Advanced Encryption Standard
(AES)
(AES)
In 1997, NIST made a formal call for
algorithms stipulating that the AES
would specify an unclassified,
publicly disclosed encryption
algorithm, available royalty-free,
worldwide.
Goal: replace DES for both
Rijndael Design
Rijndael Design
Design simplicity with rich algebraic
structure and efficiency
Has the option of 3 key lengths: 128
bits, 192 bits or 256 bits
Operates on a 128 bit block with rounds
depending on the key length used.
128 bit key – 10 rounds
192 bit key – 12 rounds
256 bit key – 14 rounds
It is fast in both software and hardware
Rivest-Shamir-Adelman
Rivest-Shamir-Adelman
(RSA) Encryption
(RSA) Encryption
o Inventors:
◦ Ron Rivest, Adi Shamir and Leonard Adelman
o RSA was introduced in 1978 and is an
asymmetric algorithm
o The RSA cryptosystem is the most widely-used public key cryptography algorithm in the world. o It can be used to encrypt a message without the
need to exchange a secret key separately.
o The RSA algorithm can be used for both public key encryption and digital signatures.
RSA ENCRYPTION AND DECRYPTION PROCESS
Encryption
Sender Paul does the following;
1.Obtains the recipient Mary’s public key (n,e)
2.Represents the plaintext message as a positive integer m with 1<m<n
3.Compute the ciphertext C=me
4.Send the ciphertext C to the desired recipient Mary.
Decryption
Recipient Mary does the following
1.Mary Uses her private key (n,d) to compute M = Cd mod n
Determine d (using modular arithmetic) which satisfies the congruence relation e.d
mod(φ(n))= 1
d is kept as the private key exponent.
The public key (e,n) The private key (d,n)
Rivest-Shamir-Adelman
Rivest-Shamir-Adelman
The keys for the RSA algorithm are generated
the following way:
1. Choose two distinct prime numbers p and q. (Note: p cannot be equal to q)
2. Compute n = pq.
n is used as the modulus for both the public and private keys
3. Compute φ(pq) = (p − 1)(q − 1). (φ is Euler's totient function).
In number theory, Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. ... Euler's totient function is a multiplicative function, meaning that if two numbers m and n are relatively prime, then φ(mn) = φ(m)φ(n).
(a) Assume p = 7, q = 13 and e = 29. Using RSA mathematical
techniques, answer the following questions:
(i) Calculate the RSA modulus n.
Answer: n = (p*q) = (7*13) = 91
(ii) Determine the private key d.
Answer: Choose values for d until it satisfies the equation
e*d mod Φ(n) = 1. We first calculate Φ(n).
Φ(n) = (p-1)*(q-1)=(7-1)*(13-1) = 6*12 = 72. We then chose values for d starting from 1 and making single
increments. Once d reached 5, the equation was satisfied, so (29*5) mod 72= 1.Therefore d = 5
(iii) Given a message M = 2, calculate the cipher value C.
Answer: Using the equation C = Me mod n, we can
calculate C.
C = 229 mod 91 = 32
(iv) Given a cipher value C = 41, calculate the original message M.
Answer: Using the equation M = Cd mod n, and having
Public Keys and Trust
Public Key Infrastructure
Public Key Infrastructure
Model
Model
Public-key Infrastructure:
oThe Public key infrastructure (PKI) is the set of
hardware, software, policies, processes, and
procedures required to create, manage, distribute, use, store, and revoke digital certificates and
public-keys.
oPKIs help establish the identity of people, devices,
and services – enabling controlled access to
systems and resources, protection of data, and accountability in transactions through;
o Certificate Authorities (CA’s)
o Digital Certificates
Digital Certificates
oDigital certificates are electronic credentials that
are used to assert the online identities of individuals, computers, and other entities on a network by
binding a Public key to a user which enables a trust relationship.
oMuch as a passport certifies one’s identity as a
citizen of a country, the digital certificate establishes the identity of users within the ecosystem.
oThey are issued by certification authorities (CAs)
that must validate the identity of the
certificate-holder both before the certificate is issued and when the certificate is used. Common uses include
business scenarios requiring authentication, encryption, and digital signing.
Public Key Infrastructure
Public Key Infrastructure
Model
PKI sets up entities called Certificate Authorities (CA) that implement the PKI policy on
certificates.
In general, a CA is usually trusted and
their actions include:
o Manage public key certificates
o Issue certificates by binding a user's or
system's identity to a public key w/ a digital signature
o Scheduling expiration dates
o Revoke certificates when necessary by
publishing to a Cetificate Revocation List (CRL)
Public Key Infrastructure
Public Key Infrastructure
Model
The functions of a CA can be done
in-house (openSSL) or by
commercial service (Eg. Verisign,
GlobalSign, RapidSSL )or a
trusted third party.