Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions