**Block Cipher**

- A block cipher is one in which a block of plaintext is treated as a whole and used to produce a ciphertext block.
- Typically, a block size of 64 or 128 bits is used.
- the two users share a symmetric encryption key
- The vast majority of network-based symmetric cryptographic applications make use of block ciphers.
- Example of Block ciphers: Playfair cipher, Hill cipher

**P-box (Permutation box):**

- P-box is equivalent to a transposition cipher; it transposes bits.
- Three types of P-boxes are shown:
**straight**P-box,**expansion**P-box and**compression**P-box

P-box can be implemented in hardware (pre-wired) or in software. In software, it is represented as a Lookup table ..

strait p box

straight P-box

**compression P-box and Expansion P box**

- Example of
**Permutation operation as a look up table**for straight P-box

Above Table (table 5.1 in Forouzan) shows 64 entries corresponding to 64 input bits–

- Entries in the table are inputs locations, and
- position(index) of the entry in the table corresponds to output location.
- Ie ., bit in the 58
^{th}location of input will go to 1^{st}location of the output, etc

- Ie ., bit in the 58

**Substitution Box **

- S-box (substitution Box) – can be considered as a substitution cipher. It can have
**different**number of inputs and outputs. S-box**can be keyed or keyless** - In the example, no of inputs is equal to number of outputs.

Corresponding input/output relation

- Following table defines i/o relation for a 3 x 2 S-box. It produces a 2 bit output for an input of 3 bits
- The leftmost bit of input defines the row, rightmost 2 input bits defines the column
- Values on the cross section of selected row & column is the output

- eg: for input 001, output is 10

(for input 100 also, output is 10)