Professional Documents
Culture Documents
The simple columnar transposition technique simply arranges the plain text in a sequence of
rows of a rectangle and reads it in a columnar manner. Simple columnar transposition
technique with multiple rounds is the same as basic only the difference is, in multiple rounds,
we iterate the process multiple times.
Algorithm:
Step 1: Write all the characters of plain text message row by row in a rectangle of predefined
size.
Step 2: Read the message in a columnar manner i.e. column by column.
Note: For reading the message, it needs not to be in the order of columns. It can by any
random sequence.
Step 3: The resultant message is cipher text.
Step 4: Repeat the procedure from step 1 to step 3 many times as desired.
Example: Let’s assume that Plain text is a corporate bridge and we need to calculate the
cipher text using a simple columnar transposition technique.
Let’s take 6 columns and arrange the plain text by row-wise manner.
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6
c o r p o r
a t e b r i
d g e
Decide the column order for reading the message – let’s assume 1,3,5,2,4,6 is an order.
Now read the message in a columnar manner using the decided order. – cadreeorotgpbri
cadreeorotgpbri is a cipher text.
Let’s perform step 1 to step 3 one more time.
Program:
import java.util.*;
class simpleColumnar{
public static void main(String sap[]){
Scanner sc = new Scanner(System.in);
/*Encryption Process*/
System.out.print("\n-----Encryption-----\n");
cipherText = encrypt(plainText, cipherText, message, rowCount, columnCount, key);
/*Decryption Process*/
System.out.print("\n\n\n-----Decryption-----\n");
static int[][] encrypt(int plainText[][], int cipherText[][], String message, int rowCount,
int columnCount, String
key){
int i,j;
int k=0;
return cipherText;
}
static int[][] decrypt(int plainText[][], int cipherText[][], String message, int rowCount, int
columnCount, String key){
int i,j;
int k=0;
return plainText;
}
}
Output: