- Assignment of values:
- Letters A,B,..,Z as 1,2,..,26.
- Digits 1,2,..,9 as 27,28,..,35.
- Digit 0 as 0 only.
- PT is divided into blocks of 16 bytes represented by Matrix Mp.
- Key is array K of size 16 which has values generated from random(1,26) with repetition.
- Perform transpose of Mp as Mp^T
- Formulate Encrypted Key matrix Ke using for i in Ke: i=i%2
- Resultant Matrix Cpk = Mp^T + Ke
- Since Cpk is a 4x4 matrix,
- Rotate 1st row by 1 element, 2nd row by 2 elements, 3rd row by 3 elements, 4th row by 0 elements. This gives matrix Chr.
- Rotate 1st column by 1 element, 2nd column by 2 elements, 3rd column by 3 elements, 4th column by 0 elements. This gives matrix Cvr.
- Matrix Cvr is the final encrypted block