Encryption

We have to generate a new key by repeating above key in cyclic order until its length becomes equal to length of plain text.

New Key: NEERAJNEERAJNEERAJ

Now take first letter of plain text and key, i.e. T and N. See row T and column N in vigenere table, take the letter where row T and column N coincides i.e. G. Here G is the first letter of encrypted or cipher text.

Now take second letter of plain text and key i.e. H and E. Again analyze the table to find second letter of encrypted text. This process is repeated for all the letters in plain text.

So finally we get the encrypted text as.

Cipher Text: GLIAAENTVFGANQQVR

Algebraic Form

We can express above process in algebraic equation in following way.

For plain text (P) and key (K), the cipher text can be obtained as.

Ei = (Pi + Ki) mod 26

Decryption

Let’s understand decryption process with another example.

Cipher Text: GLIAAENTVFGANQQVR

Key: NEERAJ

New Key: NEERAJNEERAJNEERAJ

Take first letter in cipher text and key, i.e. G and N. Now take column N and look for letter G in it, the corrosponding row to letter G is T which is the first letter of plain text after decryption. Repeate the same process for all the letters in cipher text.

Thus the plain text is obtained as.

Plain Text: THEJAVAPROGRAMMER

Algebraic Form

We can express above decryption process in algebraic equation in following way.