Question: In simple columnar transposition cipher, the plaintext is written horizontally onto a piece of graph paper with fixed width. The cipher text is then read

In simple columnar transposition cipher, the plaintext is written horizontally onto a piece of graph paper with fixed width. The cipher text is then read vertically. For example, the sentence of "THE WEATHER IS SO NICE THAT WE WANT TO PLAY" is written as the following using a graph paper width of six:

T

H

E

W

E

A

T

H

E

R

I

S

S

O

N

I

C

E

T

H

A

T

W

E

W

A

N

T

T

O

P

L

A

Y

The resulting output from above would be: TTSTWPHHOHALEENANAWRITTYEICWTASEEO

Write a Java program given a string (all caps) and a positive integer width, outputs the cipher text. Refer to the sample output below.

Sample Run:

Enter the width size: 6

Enter the string: THE WEATHER IS SO NICE THAT WE WANT TO PLAY

Cipher Text: TTSTWPHHOHALEENANAWRITTYEICWTASEEO

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!