The permutation ciphers are used to generate a ciphertext (encrypted text) by re-arranging the position of the letters in a given plaintext.
How does it work?
Select the block size (n) and a permutation.
Divide a given plaintext into blocks of n letters and use ‘x’ as padding, if necessary.
Apply a permutation to each block and generate the encrypted ciphertext
Encrypted ciphertext is egtnelem nodn tor ae daehco htres’m iaxl
The program needs to get the following information from the user:To encrypt: a text file that includes the plaintext, and a block size and the permutationinformation via standard input (keyboard).
To decrypt: a binary file that includes an encrypted ciphertext, and a block size and thepermutation information via standard input (keyboard).
The program should be able to process up to 8 characters at each block with a minimum of 2 characters