13
Bit Cipher 1

Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

Embed Size (px)

Citation preview

Page 1: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

1

Bit Cipher

Page 2: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

2

Example of bit Cipher

Page 3: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

3

Practical Stream Cipher

Page 4: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

4

Block Cipher

Page 5: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

5

Substitution Cipher: Caesar Cipher

Page 6: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

6

Vigenère Cipher Example

Suppose that the plaintext to be encrypted is: ATTACKATDAWN

The person sending the message chooses a keyword and repeats it until it matches the length of the plaintext, for example, the keyword "LEMON": LEMONLEMONLE

For successive letters of the message, we are going to take successive letters of the key string, and encipher each message letter using its corresponding key row.

Choose the next letter of the key, go along that row to find the column heading that matches the message character; the letter at the intersection of [key-row, msg-col] is the enciphered letter.

Page 7: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

7

Vigenère cipher Example

For example, the first letter of the plaintext, A, is paired with L, the first letter of the key. So use row L and column A of the Vigenère square, namely L.

Similarly, for the second letter of the plaintext, the second letter of the key is used; the letter at row E and column T is X. The rest of the plaintext is enciphered in a similar fashion:

Plaintext ATTACKATDAWN Key: LEMONLEMONLE Cipher text: LXFOPVEFRNHR

Page 8: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

8

Transposition cipher example

For example, the word ZEBRAS is of length 6 (so the rows are of length 6), and the permutation is defined by the alphabetical order of the letters in the keyword. In this case, the order would be "6 3 2 4 1 5".

The message is read off in columns, in the order specified by the keyword.

Suppose we use the keyword ZEBRAS and the message WE ARE DISCOVERED. FLEE AT ONCE. In a regular columnar transposition, we write this into the grid as Follows:

6 3 2 4 1 5

W E A R E D

I S C O V E

R E D F L E

E A T O N C

E The ciphertext is then read off as: EVLNA CDTES EAROF ODEEC

WIREE

Page 9: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

9

Vernam cipher

Vernam proposed a bit-wise exclusive or of the message stream with a truly random zero-one stream which was shared by sender and recipient.

Example:

SENDING -------

message: 0 0 1 0 1 1 0 1 0 1 1 1 ...

pad: 1 0 0 1 1 1 0 0 1 0 1 1 ...

XOR ---------------------------

cipher: 1 0 1 1 0 0 0 1 1 1 0 0 ...

RECEIVING ---------

cipher: 1 0 1 1 0 0 0 1 1 1 0 0 ...

pad: 1 0 0 1 1 1 0 0 1 0 1 1 ...

XOR ---------------------------

message: 0 0 1 0 1 1 0 1 0 1 1 1 ...

Page 10: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

10

Hashing using SHA224

SHA224("The quick brown fox jumps over the lazy dog") 0x730e109bd7a8a32b1cb9d9a09aa2325d2430587ddbc0c38bad911525 SHA224("The quick brown fox jumps over the lazy dog.") 0x619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d8aa04bb2c8cd4c

Page 11: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

11

Message Authentication Code MAC

In cryptography, a message authentication code (often MAC) is a short piece of information used to authenticate a message and to provide integrity and authenticity assurances on the message.

Integrity assurances detect accidental and intentional message changes, while authenticity assurances affirm the message's origin.

A MAC algorithm, sometimes called a keyed (cryptographic) hash function accepts as input a secret key and an arbitrary-length message to be authenticated, and outputs a MAC (sometimes known as a tag).

The MAC value protects both a message's data integrity as well as its authenticity, by allowing verifiers (who also possess the secret key) to detect any changes to the message content.

Page 12: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

12

Page 13: Bit Cipher 1. Example of bit Cipher 2 Practical Stream Cipher 3

13

MAC vs. Digital Signature

MACs differ from digital signatures as MAC values are both generated and verified using the same secret key. This implies that the sender and receiver of a message must agree on the same key before initiating communications, as is the case with symmetric encryption.