In this post I'm going to explain you how to code playfair cipher to encrypt plaintext to cipher. So this post is all about encryption program and will soon add decryption program in this series also so stay tuned!
If you don't know how the algorithm works checkout previous post in this series.
So Without further ado, LET'S BEGIN!!👨💻👩💻
Yes, You're right!
The Algorithm was consist of three steps:
- Convert plaintext into digraphs (i.e., into pair of two letters)
- Generate a Cipher Key Matrix
- Encrypt plaintext using Cipher Key Matrix and get ciphertext.
I hope the code with comments was actually sufficient to understand the logic.
Here's the repository link to the whole code file GitHub Repo
But if you still have any doubts feel free to mention below in discussion section, I would love to answer them.
Also drop a heart ❤ if you gained some knowledge!