210 ISY · Lecture 5
1 / 30
210 ISY · Lecture 5

Cryptography

Two data security techniques, a model of a cryptosystem, and symmetric-key encryption with block and stream ciphers.

Use ← → to move. Tap dotted words for meanings. “Quoted” lines are your slides’ exact words.
A question first

The class group chat

Ali sends Sara a door code in a group chat that others read. Plan 1 mixes up the code with a secret rule. Plan 2 hides it in a normal sentence. Which plan can hide that a secret exists?

A

Plan 1, the mixed-up code.

B

Plan 2, the normal sentence.

C

No plan. People always notice a secret.

Pick one now. We return to it at the end.
The map

Your slides’ map of cryptography

Cryptography system

  • Data security techniques
  • Steganography
  • Security model
  • Types of Cryptography
  • Crypt analysis

Symmetric-key Cryptography

  • Character-level encryption
  • Bit-level encryption
  • Symmetric-key algorithms

Public-key cryptography

  • RSA
  • Hash function

This deck has two parts. Techniques and model: data security techniques, steganography and the security model. Symmetric-key: the types of cryptography and symmetric-key encryption.

Your slides name Crypt analysis, Symmetric-key algorithms, RSA and Hash function here, but do not teach them in this lecture.

Techniques and model

Two ways to protect data

You can transform a message to make it secure. Or you can hide the message inside something else.

Data security techniques

Cryptography

“Cryptography means secrete writing.”

“It refers to the art of transforming messages to make them secure and immune to attacks.”

“It involves three distinct mechanisms: symmetric-key encipherment, asymmetric-key encipherment, and hashing.”

Secrete: secret. Immune to: safe from. Distinct mechanisms: separate tools. Encipherment: turning a message into secret code.

Steganography

“Steganography means covered writing.”

“It refers to concealing the message itself by covering it with something else.”

“It is possible to insert secrete binary information into data during digitization process.”

Concealing: hiding. Binary: made of 0s and 1s. Digitization: turning something into digital data.

Steganography · text cover

Hiding bits in spaces

Objective: “It hides information either for secrecy or to protect copyright, prevent tampering or add extra information.”

Secrecy: keeping something secret. Copyright: the owner’s right over a work. Tampering: changing something without permission.

Text cover: “We can use single space between words to represent bit 0 and double space to represent bit 1.”

Represent: stand for.

Example: “Consider the ASCII code of letter A: 01000001.”

This▽0course▽▽1is▽0intended▽0to▽0provide▽0data▽0security▽▽1basics.

Your slides’ sentence. Each ▽ is one space.

Step 1: read each gap. One space gives 0. Two spaces give 1.

Step 2: the 8 gaps give 01000001: the code of A.

Try: which bits does “Meet▽▽me▽at▽▽noon” hide?

Answer: two, one, two spaces: 101.

Steganography · image cover

Hiding bits in an image

“Secrete data can be covered under a color image.”

“Images are made of pixels, each of 3 bytes.”

“In LSB method, LSBs are set to 0s.”

“The ASCII code of the character is inserted in LSBs.”

LSB: least significant bit, the last bit on the right of a byte. Inserted: put in.

Example: “Consider the ASCII code of letter M: 01001101.” “This can be hide in 3 pixels.”

Be hide: be hidden.

Pixel 1010100111011110001010101
Pixel 2011001011011110001011110
Pixel 3000101010100101001111110

Your slides’ 9 bytes, in the order the slide lists them. The marked last bit of each byte is its LSB. our grouping Three bytes per pixel.

Step 1: 3 pixels × 3 bytes = 9 LSBs. The 8 bits of M need 8 of them.

Step 2: the first 8 LSBs read 10110010: M’s code 01001101 from its last bit to its first.

Step 3: the last of the 9 LSBs stays 0.

Note: your slides do not say this order. Ask your instructor which order your exam uses.

Security model

Model of a cryptosystem

Security system

“The two parties (principals) must cooperate for the exchange of the message.”

“A channel is established by the two principals.”

“It is desirable to protect the information transmission from an opponent who may present a threat.”

“All the techniques for providing security have three components.”

Parties: sides. Cooperate: work together. Established: set up. Desirable: wanted. Transmission: sending. Opponent: the enemy side.

Notice: in your slides’ picture, the trusted third party is linked to both principals and to the channel. The opponent is linked to the channel.

Trusted Third Party e.g., Distributor
of secret information
Principal Principal Message Message Security
related
transformation
Security
related
transformation
Channel Secret
information
Secret
information
Opponent
Security model Asked in your slides

Three components

Your slides ask: “List the three components of the Security System?” Their answer:

1 “A security-related transformation of information to be sent. Examples include:

  • Encryption of message to be unreadable by opponent.
  • Addition of a code to verify the identity of the sender.”

2 “Some secret information shared by the two principals and unknown to the opponent. An example is an encryption key.”

3 “A trusted third party for distributing secret information to the two principals.”

Unreadable: cannot be read. Verify the identity: check who it really is. Trusted: relied on. Distributing: giving out.

Security model

Four basic security tasks

Four Basic Security Tasks
1“Design an algorithm for performing the security-related transformation.→ component 1
2Generate the secret information to be used with the algorithm.→ component 2
3Develop methods for the distribution and sharing of the secret information.→ component 3
4Specify a protocol for principals to use security algorithm and secret information to achieve security service.”→ all three

Generate: make. Distribution: giving out. Specify: state exactly. Protocol: a set of rules the parties follow. Achieve: reach.

our links The arrows to the three components are our links, not your slides’.

Symmetric-key

Cryptography arrangement

Your slides’ picture of a message on its way.

Sender
Plaintext
Encryption Algorithm key Ke
Ciphertext
Network
Decryption Algorithm key Kd
Plaintext
Receiver

The sender starts with plaintext, the message you can read.

The encryption algorithm uses the key Ke. It gives ciphertext, the mixed-up message.

The ciphertext crosses the network.

The decryption algorithm uses the key Kd. The receiver gets the plaintext again.

Symmetric-key Asked in your slides

Categories of cryptography

Your slides ask: “Differentiate between categories of cryptography Techniques?” Their categories:

Encryption/Decryption
Conventional (symmetric-key) methods
Character-level encryption
Bit-level encryption
(Asymmetric-key) Public-key methods

Conventional: traditional. Symmetric: the same on both sides. Asymmetric: not the same on both sides. Character: a letter, number or sign.

our link Cryptography’s three mechanisms on your slides name both kinds too: symmetric-key encipherment and asymmetric-key encipherment, with hashing.

For public-key methods, your slides give only the name (Extra)Extra: not in your slidesIn public-key methods, the encryption key and the decryption key are different..

Symmetric-key

Five ingredients

Secrete key shared by
sender and recipient
Sender Encryption
Algorithm
Network Decryption
Algorithm
Receiver Plaintext
Input
Transmitted
Ciphertext
Plaintext
Output
1 2 3 4 5

“Ingredients of Symmetric-key Cryptography

  1. Plaintext The original message that is fed into the algorithm as input.
  2. Encryption algorithm It transforms the plaintext to a ciphertext.
  3. Secret key Transformations performed depend on that key.
  4. Ciphertext It is the scrambled message produced as output.
  5. Decryption algorithm It is the encryption algorithm run in reverse to produce plaintext from the ciphertext.”

Fed into: given to. Scrambled: mixed up so it cannot be read. In reverse: the other way round. Recipient: receiver.

Notice: one secret key feeds both algorithms.

Symmetric-key

Six properties

“Properties

  1. It was the only type of encryption in use till the late 1970s.
  2. The encryption and decryption keys (Ke), (Kd) are the same and should be kept secrete.
  3. It is also referred to as conventional encryption, secret-key, or single-key encryption.
  4. The Decryption algorithm is the inverse of the Encryption algorithm.
  5. Any one who knows the encryption algorithm and key can deduce the decryption algorithm.
  6. For m users, the number of required keys is [m×(m-1)]/2.”

Till: until. Referred to as: called. Inverse: the opposite. Deduce: work out.

KeKd
Common mistake: thinking Ke and Kd differ. In symmetric-key encryption they are the same.
Symmetric-key

How many keys?

our picture AB CD
[m×(m-1)]/2m = the number of users

How to read it: m times (m minus 1), then divided by 2.

Worked example: 4 users, A to D.

  1. 14 × (4 − 1) = 4 × 3 = 12.
  2. 212 ÷ 2 = 6 keys.

Why it works (our reading): each pair of users shares one key. Each user pairs with m − 1 others. Each pair is counted twice, so we divide by 2.

Try: 5 users?

Answer: 5 × 4 = 20. 20 ÷ 2 = 10 keys.

Block and stream ciphers

Block cipher

“A block of plaintext symbols of size m (m > 1) are encrypted at a time creating a block of ciphertext of the same size.”

“The block size is usually a multiple of 64 bits.”

“A single key is used to encrypt the whole block even if the key is made of multiple values.”

Symbols: characters or bits. m > 1: m is more than 1. A multiple of 64: 64, 128, 192 and so on. Multiple values: several parts.

Notice: m bits in, m bits out, one key.

Plaintext blocks m-bits m-bits Block
cipher
Key k bits m-bits Ciphertext blocks
Block and stream ciphers

Stream cipher

“It processes the input elements continuously, producing one symbol (a character or a bit) at a time, as it goes along.”

“There are plaintext stream, cipher stream, and key stream.”

“Stream ciphers are more immune to the corruption of bits during transmission.”

“They are faster than block ciphers.”

“Their hardware implementation is easier.”

Input elements: the pieces that go in. Continuously: without stopping. Corruption of bits: bits damaged. Hardware implementation: building it in hardware.

Notice: a block cipher takes m symbols at a time. A stream cipher gives one symbol at a time.

Plaintext stream Stream
cipher
Key stream Ciphertext stream
Back to the question

The class group chat

Ali sends Sara a door code in a group chat that others read. Plan 1 mixes up the code with a secret rule. Plan 2 hides it in a normal sentence. Which plan can hide that a secret exists?

A

Plan 1, the mixed-up code.

Plan 1 is cryptography: “the art of transforming messages to make them secure and immune to attacks.” The others still see the mixed-up code.

B

Plan 2, the normal sentence.

Plan 2 is steganography: “concealing the message itself by covering it with something else”, like single and double spaces.

C

No plan. People always notice a secret.

Steganography hides the message itself, so others can miss it.

If Plan 1 uses symmetric-key encryption, Ali and Sara share the same secret key.

Review

You can now

  • Tell cryptography from steganography, and hide bits with a text cover or the LSB method.
  • Name the parts of the model of a cryptosystem, and list its three components.
  • List the four basic security tasks.
  • Draw the categories of cryptography, and name the five ingredients of symmetric-key cryptography.
  • Work out the number of keys for m users, and tell a block cipher from a stream cipher.

Next: Lecture 6.

Review · revision sheet

Words in this deck

cryptography
secret writing: transforming messages to make them secure and immune to attacks
steganography
covered writing: concealing the message itself by covering it with something else
LSB
least significant bit: the last bit on the right of a byte
ASCII
American Standard Code for Information Interchange: a code for each character
cryptosystem
a system that uses cryptography to protect messages
component
a part of a system
principal
one of the two parties who exchange the message
opponent
the other side, who may present a threat
symmetric-key
encryption and decryption keys are the same and should be kept secret
public-key
(asymmetric-key) methods: the other category of encryption/decryption
encryption algorithm
transforms the plaintext to a ciphertext
decryption algorithm
the encryption algorithm run in reverse to produce plaintext from the ciphertext
plaintext
the original message fed into the algorithm as input
ciphertext
the scrambled message produced as output
secret key
the transformations performed depend on that key
block cipher
encrypts a block of m symbols (m > 1) at a time into a ciphertext block of the same size
stream cipher
processes the input continuously, producing one symbol (a character or a bit) at a time
Ke
the encryption key
Kd
the decryption key
encryption
changing data into a secret form others cannot read
decryption
changing ciphertext back into plaintext
algorithm
a set of steps a computer follows
threat
a potential violation of security; it need not actually occur
hashing
making a short, fixed-size code from data
Final quiz · about 11 minutes

Sixteen questions, nine kinds

Everything you need is in this deck. Each question has one check. Your score waits on the final slide.

1

Choose one
Pick the best answer.

2

True or false
Judge one claim.

3

Fill the gap
Drag or tap a word.

4

Match
Pick each meaning.

5

Sort
Put each item in a group.

6

Put in order
Tap the steps in order.

7

Find the mistake
Tap the wrong part.

8

Work it out
Type a number.

9

Label the figure
Put each label on its number.

Kind 1 of 9 · choose one

Choose the best answer

1 · Ali hides one character in a color image with the LSB method. What happens to the LSBs before the character’s ASCII code goes in?

2 · An opponent learns the encryption algorithm and the key of a symmetric-key system. What can he deduce?

Kind 2 of 9 · true or false

True or false?

3 · “In the security system, a trusted third party distributes secret information to the two principals.”

4 · “In symmetric-key encryption, the encryption key Ke and the decryption key Kd are different.”

Kind 3 of 9 · fill the gap

Drag or tap the right word into the gap

5 · Component 2 of the security system: some secret information shared by the two principals and to the opponent.

6 · Symmetric-key encryption is also called conventional, secret-key, or -key encryption.

Kind 4 of 9 · match

Choose the right meaning for each one

7 · Ingredients of symmetric-key cryptography

Plaintext
Ciphertext
Encryption algorithm
Decryption algorithm

8 · The two data security techniques, and steganography’s two covers

Cryptography
Steganography
Text cover
Image cover

Kind 5 of 9 · sort

Put each item in its group

9 · Block cipher or stream cipher?

Encrypts m symbols (m > 1) at a time
Produces one symbol at a time
Faster of the two
Its size is usually a multiple of 64 bits
Works with a key stream
One key is used for all m symbols together

10 · Cryptography or steganography?

Single and double spaces between words carry bits
Involves hashing
Involves symmetric-key encipherment
An ASCII code goes into the LSBs of a color image
Transforms messages to make them immune to attacks
Hides information to protect copyright

Kind 6 of 9 · put in order

Tap the steps in order

11 · Your slides’ four basic security tasks, first to last:

Kind 7 of 9 · find the mistake

Tap the part that is wrong

12 · The first component of the security system

13 · Categories of cryptography

Kind 8 of 9 · work it out

Type the number

14 · In a text cover, a single space stands for bit 0 and a double space for bit 1. Letter B has the ASCII code 01000010. How many double spaces hide it?

15 · For m users, symmetric-key encryption needs [m×(m-1)]/2 keys. How many keys do 6 users need?

Kind 9 of 9 · label the figure

Put each label on its number

16 · Your slides’ model of a cryptosystem. Which part is at each number?

1 Principal Principal Message Message 4 2 Secret
information
Secret
information
3
1
2
3
4

Final quiz · your score

0 / 16

Answer the questions, then come back here.