You are on page 1of 13

Bit Cipher

1
Example of bit Cipher
2
Practical Stream Cipher
3
Block Cipher
4
Substitution Cipher: Caesar Cipher
5
Vigenère Cipher Example
6

 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.
Vigenère cipher Example
7

 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
Transposition cipher example
8

 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 24 1 5
WEARED
I S COVE
R EDFLE
E ATONC
E
 The ciphertext is then read off as: EVLNA CDTES EAROF ODEEC WIREE
Vernam cipher
9

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 ...
Hashing using SHA224
10

SHA224("The quick brown fox jumps over the lazy dog")


0x730e109bd7a8a32b1cb9d9a09aa2325d2430587d
dbc0c38bad911525
SHA224("The quick brown fox jumps over the lazy dog.")
0x619cba8e8e05826e9b8c519c0a5c68f4fb653e8a3d
8aa04bb2c8cd4c
Message Authentication Code MAC
11

 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.
12
MAC vs. Digital Signature
13

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.

You might also like