CS计算机代考程序代写 scheme chain algorithm PowerPoint Presentation

PowerPoint Presentation

Deakin University CRICOS Provider Code: 00113B

SIT182 – Real World Practices For Cyber Security

Trimester 2 – 2021
Deakin College

Week 8 – Part 1

Deakin University CRICOS Provider Code: 00113B

Cryptography – Basics

2

Topics,

Deakin University CRICOS Provider Code: 00113B

Kerckhoffs’s Principle

3

A cryptosystem/cipher/encryption
algorithm should be secure even if
everything about the system,
except the key, is public
knowledge.

A Dutch Cryptographer

Deakin University CRICOS Provider Code: 00113B

Symmetric Cryptography

4

There are 2 types of encryption algorithms:

• Symmetric algorithms: (also called “secret key”) use the same key for both encryption and decryption

• Asymmetric algorithms: (also called “public key”) use different keys for encryption and decryption

same keys different keys

Deakin University CRICOS Provider Code: 00113B

5

What do you think could be a challenge in both cases? (hint: related to keys needed)

Deakin University CRICOS Provider Code: 00113B

6

For any encryption approach, there are two major challenges:

• Key distribution: how do we convey keys to those who need them to establish secure

communication.

• Key management: given a large number of keys, how do we preserve their safety and make

them available as needed.

Key Distribution and Key Management

Deakin University CRICOS Provider Code: 00113B

7

Asymmetric Encryption Primer

In asymmetric or public key encryption, different keys are used for encryption and decryption.

• Each subject S has a publicly disclosed key KS (“S’s public key”) that anyone can use to encrypt,
and a privately held key K s

−1 (“S’s private key”).

• The relationship is:

Anyone wishing to send a message M confidentially to S sends { M } K s .

Only the holder of K s
−1 can decrypt this message.

• Asymmetric encryption largely solves the key distribution problem. Why? Let’s see …

Deakin University CRICOS Provider Code: 00113B

8

How Many Keys: Symmetric Encryption

Given a symmetric system with n users, how many keys are needed for pairwise secure

communication?

S1

S5

S2

S3

S4

Each time a new user is added to the system, it needs

to share a new key with each previous user. Thus,

for n users, we have n(n − 1)/2 keys.

This is the number of 2-combinations from a set of n people

C(n, 2) = n! / (2! x (n-2)! ) = n(n−1)/2

About n2 keys. Is it efficient for a large number of users?

Deakin University CRICOS Provider Code: 00113B

9

How Many Keys: Asymmetric Encryption

Given an asymmetric system of n users, how many keys are needed for pairwise secure

communication?

• Each time a new user is added to the system, it needs only a public key and a private key.

• Thus, for n users, we have 2n keys.

✓ Compare this with n2 which is needed for symmetric. Much better right?

Deakin University CRICOS Provider Code: 00113B

10

Characteristics of Keys

Typically, in a symmetric (secret key) system, keys are:

• randomly generated k-bit strings,

• simple to generate,

• have no special properties.

In an asymetric (public key) system, keys:

• have special structure (e.g., are large primes), and

• are expensive to generate.

Key sizes are not comparable between the two approaches. A 128-bit symmetric key may be
equivalent in strength to a 3000-bit public key.

Deakin University CRICOS Provider Code: 00113B

11

Stream and Block Ciphers

An important distinction in symmetric cryptographic algorithms is between stream and block

ciphers.

• Stream ciphers: convert one symbol of plaintext directly into a symbol of ciphertext.

• Block ciphers: encrypt a group of plaintext symbols as one block.

Simple substitution is an example of a stream cipher. Columnar transposition (home reading)

is a block cipher.

Most modern symmetric encryption algorithms are block ciphers. Block sizes vary (64 bits for

DES, 128 bits for AES, etc.).

Deakin University CRICOS Provider Code: 00113B

12

Stream Encryption

Advantages:

• Speed of transformation: algorithms are linear in time and constant in space.

• Low error propagation: an error in encrypting one symbol likely will not affect

subsequent symbols.

Disadvantages:

• Low diffusion: all information of a plaintext symbol is contained in a single

ciphertext symbol.

• Susceptibility to insertions/modifications: an active interceptor who breaks the

algorithm might insert spurious text that looks authentic.

Deakin University CRICOS Provider Code: 00113B

13

Block Encryption

Advantages:

• High diffusion: information from one plaintext symbol is diffused into several

ciphertext symbols.

• Immunity to tampering: difficult to insert symbols without detection.

Disadvantages:

• Slowness of encryption: an entire block must be accumulated before encryption /

decryption can begin.

• Error propagation: An error in one symbol may corrupt the entire block.

Deakin University CRICOS Provider Code: 00113B

14

Malleability

• An encryption algorithm is said to be malleable if transformations on the ciphertext produce
meaningful changes in the plaintext.

• It is an undesirable property since it allows an attacker to modify the contents of a message.

• Most modern block-structured ciphers are non-malleable.

For example, suppose that a bank uses a stream cipher to hide its financial information,
and a user sends an encrypted message containing, say, “TRANSFER $0000100.00 TO
ACCOUNT #199.” If an attacker can modify the encrypted message on the wire, and can
guess the format of the unencrypted message, the attacker could be able to change the
amount of the transaction, or the recipient of the funds, e.g. “TRANSFER $0100000.00 TO
ACCOUNT #227”. Malleability does not refer to the attacker’s ability to read the
encrypted message. Both before and after tampering, the attacker cannot read the
encrypted message.

Deakin University CRICOS Provider Code: 00113B

15

Symmetric Key: Single use key vs Multi use key

• Single use key: (one-time key)

• Key is only used to encrypt one message

• Encrypted email: new key generated for every email

• Multi use key: (many time key)

• Key used to encrypt multiple messages

• SSL: same key used to encrypt many packets

• How to add protection? Use of random nonce (details not covered in this unit)

Deakin University CRICOS Provider Code: 00113B

16

Single Use Key Example: One Time Pad (OTP)

0 1 0 1 1 1 0 0 1 0Key:

1 1 0 0 0 1 1 0 0 0Plaintext:

1 0 0 1 1 0 1 0 1 0Ciphertext:

XOR Truth Table

• Key is changed each time.
• Can you think of a way to break this cipher?

Deakin University CRICOS Provider Code: 00113B

17

Single Use Key Example: One Time Pad (OTP)

• OTP is “secure” against ciphertext-only attacks (COA)

• Ciphertext gives attacker no information/power

• Secure against adversary with unlimited computational power ☺

• Information-theoretically secure

Limitation :

• Key must be truly random in each use. Else, ”entropy” in plaintext may be
used by attacker.

• Key as long as the message!

Important

Deakin University CRICOS Provider Code: 00113B

18

Key Distribution Centre (KDC)

• In symmetric/secret key scheme, still the key has to be exchanged somehow. In fact, even in
substitution cipher, the first key must be passed on.

• The Sender and Receiver can meet, use post, or pigeons …

• To avoid delay and huge number of keys, one way is to use Key Distribution Centre (KDC).

• KDC shares a different key with each user in a
network:

• Alice tells the KDC she wants to communicate
with Bob.

• The KDC generates a session key.

• The KDC sends the session key to Alice and
Bob using the different symmetric keys they
share with KDC.

Deakin University CRICOS Provider Code: 00113B

19

Modern Symmetric Encryption

Designed to process large volumes of text quickly, they use machine operations (arithmetic,

bitwise, table lookup) that are cheap and easy to implement.

Most modern symmetric encryption algorithms are:

• block ciphers:take input in fixed size blocks

• implemented in rounds: perform similar operations repeatedly

Such an algorithm is called an iterated block cipher.

Deakin University CRICOS Provider Code: 00113B

20

Modern Symmetric Encryption

Data Encryption Standard (DES) – 1950: only 56-bit key length. Do not worry about the

numbers in these key lengths. Simply remember that longer keys have stronger

encryption and take longer to crack.

Triple DES: tried to improve DES by encrypting the message, then decrypting it with a

different key and then encrypting it with a third key.

1990: Specialized DES Cracker machine -> DES key in only a few hours ☺

AES, Blowfish, IDEA.

Deakin University CRICOS Provider Code: 00113B

21

Advanced Encryption Standard (AES)

In 1995, NIST (National Institute of Standards and Technology) began a search for a new, fast,

secure symmetric encryption algorithm that was:

• unclassified;

• publicly disclosed;

• available royalty-free for use worldwide;

• symmetric block cipher algorithm for blocks of 128 bits;

• usable with key sizes of 128, 192, and 256 bits.

From 15 contenders, the Rijndael algorithm of Belgian researchers Vincent Rijmen and Joan

Daemen was chosen in 2000 as the Advanced Encryption Standard (AES).

We will not cover AES details in this unit. More in Cryptography unit.

Deakin University CRICOS Provider Code: 00113B

22

Security of Advanced Encryption Standard (AES)

• AES is incorporated in many commercial encryption products. The algorithm is fairly new, but

has been subjected to extensive analysis

• No flaws have been discovered, but that does not mean that none exists

• AES is modular and the key length can be extended if necessary. Similarly, the number of

rounds can be increased.

• AES is a widely-used modern symmetric encryption algorithm.

• AES uses a block of 128-bits.

• AES allows keys of size 128-bits, 192-bits, and 256-bits, with 10, 12, 14 rounds,

respectively.

Important

Deakin University CRICOS Provider Code: 00113B

23

Modes of Usage: ECB

• The simplest way of using a block cipher like AES is to encrypt (with the same key) each block in

the plaintext. This is a block encryption mode called “Electronic Code Book” (ECB).

• Identical blocks in the plaintext yield identical blocks in the ciphertext.

Deakin University CRICOS Provider Code: 00113B

24

Modes of Usage: CBC

To solve the problem of EBC, do something to “randomize” blocks before they’re encrypted.

• Cipher Block Chaining (CBC): “XOR” each successive plaintext block with the previous

ciphertext block and then encrypt.

• The IV is XORed with the 1st plaintext block to produce the first ciphertext block. The IV must

only be known to the sender and receiver and can be sent with ECB encryption.

We don’t cover the details in this unit.

Deakin University CRICOS Provider Code: 00113B

25

Modes of Usage: CBC

Deakin University CRICOS Provider Code: 00113B

26

CBC Vulnerabilities

Though much better than ECB, CBC still has some weaknesses (e.g. vulnerable to Padding Oracle
attack (see https://en.wikipedia.org/wiki/Padding_oracle_attack for details).

Numerous other block encryption modes have been devised…

• A naive use of encryption as in Electronic Code Book leaves

too much regularity in the ciphertext.

• Block encryption modes such as CBC attempt to hide this by

chaining blocks together in some manner.

Important

https://en.wikipedia.org/wiki/Padding_oracle_attack

Deakin University CRICOS Provider Code: 00113B

Acknowledgement

Acknowledging the kind support and contribution of:
Dr Arash Shaghaghi (Deakin University, Australia), Prof. Chang-Tsun Li (Deakin University, Australia), Prof. Sanjay
Jha (The University of New South Wales, Australia), Dr. Nicolas Courtois (University College London, UK), and Dr.
Young (University of Texas at Austin, USA).

27