0% found this document useful (0 votes)
30 views52 pages

CH 8

Uploaded by

Ali Alo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views52 pages

CH 8

Uploaded by

Ali Alo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Computer Security

Fundamentals
Chuck Easttom

Presented by:
Dr. Adnan Almutawkkil
[email protected]

Chapter 8 Encryption
Introduction
 Encryption
 Scrambling information.
 One critical part to the security puzzle.
 Without it, all security measures are inadequate.
 Cryptography
 The art of writing or deciphering secret code
 Cryptography ("secret writing"): Making secret
 messages

2
Cryptography VS Encryption
Item Cryptography Encryption

Definition Study of techniques like Process of encoding a message


encryption and decryption
Nature Cryptography is field of study Encryption is more of a
mathematical operation
Basis Based on mathematics and Concepts like cipher, cipher text,
algorithms concepts key are used
Utilization Digital signature and security Facilitate secret communication
related algorithms
Category Symmetric and public key Symmetric and Public key schemes
Cryptography just like Cryptography
Message Cryptography encompasses Encryption being a subset of
Encryption including other Cryptography using algorithm -
verification techniques cipher

3
Cryptography

4
Cryptography Basics

 Cryptography is the use of mathematical


operations to protect messages traveling between
parties or stored on a computer
 Decryption
 Reversal of the scrambling protocol
 Encryption
 Algorithm scrambles plain
 Sender and receiver agree on algorithm
 Message difficult to re-create without protocol
5
Cryptography Types

6
Symmetric Encryption Techniques

7
Ciphers

8
Classical Ciphers
 Substitution Ciphers
 Substitute one letter (or bit) for another in each place
 Transposition Ciphers
 Transposition ciphers do not change individual letters
or bits, but they change their order
 Most real ciphers use both substitution and
transposition
History of Encryption

 In a substitution cipher each character in the


plaintext is substituted for another character
 Old as written communication and war
 Caesar Cipher (simple substituted cipher)
 Shift cipher
 A DOG
 Shift 1 – B EPH
 Shift 2 – C FQI
 Shift negative 1 – Z CNF

10
History of Encryption (cont.)
 Caesar Cipher
 Frequency distribution
cracks this simple cipher.
 Substitution alphabet.
 Substitutes one letter in
the alphabet for another.
 Caesar is a mono-
alphabetic cipher.

11
Plaintext Key Ciphertext

n 4 r
o 8 w
w 15 l
Multi-alphabetic …
i 16 …
Substitution Ciphers
s 23 …
t 16 …
+4 h 3 …
e 9 …
n o p q r
t 12 …
This is a very weak cipher.
i 20 …
Real ciphers use complex m 6 …
math. e 25 …
Binary Operations
 Binary Operations
 AND, OR, XOR

Example of  Example of Example of


AND operation OR operation XOR operation
1 1 0 1 1 1 0 1 1 1 0 1
1 0 0 1 1 0 0 1 1 0 0 1
1 0 0 1 1 1 0 1 0 1 0 0

13
Binary Operations
 XOR only reversible binary operation (XOR
allows you to easily encrypt and decrypt a string)
 Convert plain text to ASCII

A DOG = 065 032 068 079 071

 Then, convert ASCII to binary

0100 0001, 0100 0100, 0100 1111, 0100 0111

© 2016 Pearson, Inc. Chapter 8 Encryption 14


Binary Operations

 XOR the ASCII

0100 0001, 0100 0100, 0100 1111, 0100 0111 Plain text
1111 0111, 1111 0111, 1111 0111, 1111 0111 Key
1011 0110, 1011 0011, 1011 1000, 1011 0000 Cipher text

 Result is cipher text.

15
Cryptography Terms

 Key: The bits that are combined with the plain


text to encrypt it. In some cases this is random
numbers; in other cases it is the result of some
mathematical operation.
 Plain text: The unencrypted text.
 Cipher text: The encrypted text.
 Algorithm: A mathematical process for doing
something.

16
Modern Methods
 Single key (symmetric) encryption
 Same key to encrypt and decrypt
 Blowfish
 Symmetric block cipher
 Works on “blocks” of letters
 Uses variable length key (32–448 bits)
 Freeware

17
Decipher the following:

18
Cryptographic System Stages

 Cryptographic Systems
1. Two parties first agree upon a particular
cryptographic system to use
2. Each cryptographic system dialogue begins with three
brief handshaking stages
3. The two parties then engage in cryptographically
protected communication
 This ongoing communication stage usually constitutes nearly all
of the dialogue
Modern Methods (cont.)
 Data Encryption Standard (DES)

DES Key Keyspace # of Possible Keys One Computer to decrypt

256
56-bit 11111111 11111111 11111111 72,000,000,000,000,000 134 Year
11111111 11111111 11111111 11111111

© 2016 Pearson, Inc. Chapter 8 Encryption 20


Modern Methods (cont.)
 Advanced Encryption Standard (AES).
 It was the algorithm eventually chosen to replace
DES. It is a block cipher that works on 128-bit blocks.
 It can have one of three key sizes of 128, 192, or 256
bits.
 This was selected by the United States government to
be the replacement for DES and is now the most
widely used symmetric key algorithm.
 AES is the block cipher everyone should use today
 Unless you have a really, really good reason

21
Major Symmetric Key Encryption Ciphers
RC4 DES 3DES AES
Key Length 40 bits or 56 112 or 168 128, 192, or
(bits) more 256
Key Strength Very weak Weak Strong Strong
at 40 bits
Processing Low Moderate High Low
Requirements
RAM Low Moderate Moderate Low
Requirements
Remarks Can use keys Created in Applies DES Today’s gold
of variable the 1970s three times standard for
length with two or symmetric
three key
different encryption
DES keys

Shorter keys = faster Longer keys = slower


processing, but less secure processing, but more secure
Advantages of AES

 The key is much stronger due to the key length


 AES runs faster than 3DES on comparable hardware
 AES is more efficient than DES and 3DES on comparable
hardware

The plain text is now


encrypted using 128
AES

An attempt at
deciphering the text
using a lowercase,
and incorrect key
Modern Methods (cont.)

 One major problem with symmetric key


encryption

How do you transmit the symmetric key?

 The answer: public key encryption

24
Modern Methods (cont.)

 Public key (asymmetric) encryption


 Opposite of single key encryption.
 One key (public key) used to encrypt .
 One key (private key) used to decrypt.
 Only holder of a private key can decrypt messages.

25
Modern Methods (cont.)
 Public key (asymmetric) encryption
 Depends on large prime numbers, factoring, and
number theory.
 Public key encryption is most widely used.
 Pretty Good Privacy (PGP):
 The first popular implementation of public-key cryptography.
 Its primary use is to protect the contents of email messages
 Freeware
 Quite secure
 Phil Zimmerman – 2004

26
RSA (Rivest Shamir Adleman)

27
Properties of RSA
 One hundred times slower than
DES in hardware
 One thousand times slower than
DES in software
 Used to protect small amounts of
data
 Ensures confidentiality of data
thru encryption
 Generates digital signatures for
authentication and nonrepudiation
of data
Modern Methods (cont.)

 Public key (asymmetric) encryption


 RSA
 You start by generating two large random primes, p and
q, of approximately equal size. Now you need to pick
two numbers so that when multiplied together the
product will be the size you want (that is, 128 bits, 256
bits, and so on).
 Now multiply p and q to get n.
 Let n = pq
 Let m = (p - 1)(q – 1)

29
Modern Methods (cont.)
 Public key (asymmetric) encryption
 RSA
 Now select another number; call this number e. Pick e so that it is
co-prime to m.
 Choose a small number e, co-prime to m.
 Youare almost done generating a key. Now you just find a number d
that when multiplied by e and modulo m would yield a 1. (Note:
Modulo means to divide two numbers and return the remainder. For
example 8 modulo 3 would be 2.).
 Find d, such that de % m = 1.
 Now publish e and n as the public key. Keep d and n as the secret
key. To encrypt, simply take your message raised to the e power and
modulo n.

30
The RSA signature Scheme

31
Modern Methods (cont.)

 Legitimate versus fraudulent encryption


 Warning signs of frauds
 Unbreakable – No such thing.

 Certified – No recognized certification for


encryption methods.
 Inexperienced people – Inventors of the
previously discussed methods had years of
experience.

32
Avoid ‘bad’ crypto

 Unbreakable
 Unhackable
 Secret algorithm
 Kerchoff’s principle

33
Digital Signatures
 A digital signature is not used to ensure the confidentiality of a message, but
rather to guarantee who sent the message.
 This is referred to as nonrepudiation. Essentially, it proves who the sender is.
 Digital signatures are actually rather simple, but clever. They simply reverse
the asymmetric encryption process.
 Recall that in asymmetric encryption the public key (which anyone can have
access to) is used to encrypt a message to the recipient, and the private key
(which is kept secure and private) can decrypt it. With a digital signature, the
sender encrypts something with his private key.
 If the recipient can decrypt that with the sender's public key, then it must have
been sent by the person purported to have sent the message.

34
How a Digital Signature Works
Hash
 Hashing is a type of cryptographic algorithm that has some
specific characteristics.
1. It is one way. That means you cannot "unhash" something.
2. You get a fixed-length output no matter what input is given.
3. It should have few or no collisions. A collision is when two
different inputs provide the same output.

Hashing Hash: bit string of


Bit string of any length
Algorithm small fixed length

36
Hashing
 A hashing algorithm is applied to a bit string of any length
 The result of the calculation is called the hash

 For a given hashing algorithm, all hashes are the same short

length
 Routers use hashing with secret keys
 Ipsec gateways and clients use hashing algorithms
 Software images downloaded from the website have checksums
Sessions can be encrypted
Hashing versus Encryption
Characteristic Encryption Hashing

Result length About the same Short fixed length


length as the regardless of
plaintext message length

Reversible? Yes. Decryption No. There is no way


to get from the short
hash back to the long
original message
Hashing Algorithms
 MD5 (128-bit hashes)
 SHA-1 (160-bit hashes)
 SHA-224, SHA-256, SHA-384, and SHA-512 (name
gives hash length in bits)
 Note: MD5 and SHA-1 should not be used because
they have been shown to be unsecure

39
Message Digest (one way hash)

40
Message Digest Function: MD5

41
Secure Hashing Algorithm (SHA)

42
4
3
VERY Simple Illustration of Rainbow
Tables
List of pre-computed password hashes
Password MD5 Hash (in Hex) Password MD5 Hash (in Hex)

aaaa 74b87337454200d4d33 Aaaaa 594f803b380a41396ed


f80c4663dc5e5 63dca39503542
aaab 4c189b020ceb022e0ec aaabb 120858a7016efcfab669
c42482802e2b8 67b834e9153c
aaac 3963a2ba65ac8eb1c6e aaacc ee43671d755ac457cfe
2140460031925 6e32d1894788e
aaa1 39dc4f1ee693e5adabd Aaa1a 5bbac29650eb36b4de1
dd872247e451f 6885c190a9fa3
aaa2 0ad346c93c16e85e2cb Aaa2a 597f0ce6d11567cc691b
117ff1fcfada3 3f5df35594cb
aaa4 ee93fca7c150d9c548af Aaa4a 4305dc076b3ba2bf8d5
f721c87d0986 5524cddf5a72d
4
4
Hash - Salt
 Random bits added to further secure encryption or hashing. Most often encountered with hashing, to
prevent Rainbow Table attacks.
 Essentially the salt is intermixed with the message that is to be
hashed. Consider this example. You have a password that is
 pass001
 in binary that is
 01110000 01100001 01110011 01110011 00110000 00110000
00110001
 A salt algorithm would insert bits periodically, lets assume for
our example that we insert bits every 4th bit giving us
 0111100001 0110100011 0111100111 0111100111 0011100001
0011100001 0011100011
 If you convert that to text you would get
 xZ7�� #
Cryptanalysis Tools

45
46
Steganography

47
Historical Steganography
 The ancient Chinese wrapped notes in wax
and swallowed them for transport.
 In ancient Greece a messenger’s head might
be shaved, a message written on his head,
then his hair was allowed to grow back.
 In 1518 Johannes Trithmeus wrote a book
on cryptography and described a technique
where a message was hidden by having each
letter taken as a word from a specific
column.
Historical Steganography – Cont.
 During WW II the French Resistance sent messages written on the backs of couriers
using invisible ink
 Microdots are images/undeveloped film the size of a typewriter period, embedded
on an innocuous documents. These were said to be used by spy's during the Cold
War.
Steganography general model

50
Types of Steganography

51
5
2
Cryptanalysis

 A cryptanalyst may attempt


to do any or all of the following:
 to break a single message;

 to recognize patterns in encrypted messages;

 to infer some meaning without breaking the

algorithm;
 to deduce the key;

 to find weaknesses in the implementation or environment or


the use of encryption;
 to find weaknesses in the algorithm, without necessarily
having intercepted any messages.

You might also like