Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ALGORITHM

Encryption: Step 1: Find the number of Characters (except space). Step 2: Find the nearest squares after this number. (M2) Step 3: Form an MxM Matrix and fill the empty row/column by random characters. Step 4: Perform the Transpose of a matrix. Step 5: Add 1 to M to the 1st row, Add M to 1 to the 2nd row of a Transpose Matrix and so on. Then the resulting matrix will be R Matrix. Step 6: Add 1 to M to the 1st column, Add M to 1 to the 2nd column of a Transpose Matrix and so on. Then the resulting matrix will be S Matrix. Step 7: Add two matrices R and S. Step 8: The contents of the resulting matrix will form the final Cipher Text.

Decryption: Step 1: Find the number of characters in the Cipher Text and divide it by 2. The resulting number will give the (M2) value. Step 2: Form an MxM Matrix taking 2 characters at a time. Step 3: Select the 1st character of each and every columns and form a matrix. Step 4: Sub 1 to M to the 1st row, sub M to 1 to the 2nd row of a Matrix and so on. Step 5: Perform the Transpose of a matrix. Step 6: The contents in the resulting matrix will give the original Plain Text.

Example:

Plain Text: ENGINEER Encryption: 1. Number of Characters: 8 2. Nearest square: 9 (3x3) 3. E N G I N E E R A 4. Transpose Matrix E I E NNR GEA 5. F K H Q P S H G D 6. F L F P P T J F D 7. FF KL HF QP PP ST /* /* /* +1 +3 +1 +2 +2 +2 +3 +1 +3 */ */ */ /* /* /* +1 +2 +3 +3 +2 +1 +1 +2 +3 */ */ */

HJ GF DD

8. Cipher Text: FFKLHFQPPPSTHJGFDD

Decryption: 1. Number of characters: 18 => 18/2 = 9, so 3x3 matrix. 2. FF KL HF QP PP ST HJ GF DD 3. F K H Q P S HG D 4. E I E NN R GE A /* /* /* -1 -2 -3 -3 -2-1 -1 -2 -3 */ */ */

5. Transpose Matrix:

E N G I N E E R A

6. Original Plain Text: ENGINEER

You might also like