Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java program that uses the idea of ROT 13 to encrypt and decrypt O LIKE YOU TO MEET ME IN THE NORTHERN, NOT

image text in transcribed
Write a java program that uses the idea of ROT 13 to encrypt and decrypt O LIKE YOU TO MEET ME IN THE NORTHERN, NOT SOUTHERN, COURTYARD! the conversion (with 6-character grouping) would become if you were to take the plaintext phrase MEET ME IN THE NORTHERN COURTYARD So the phrase above might be broken into five or six-letter chanks like this, making it more difficult to identify If you were then to apply the ROT13 aipher kry to the encrypted text, it would convert to IDLIKE YOUTOM EETMEI NTHENO RTHERN NOTSOU THERNC OURTYA RD, This is MEET ME IN THE NORTHERN COURTYARD original text, and even though the punctuation s missine in the decrypted message you can still understand RTTWRT COWITO LZWITZ OVLDEW GYZS To decrypt a substitution cipher, the person needs the cipher text key and simply applies the key to the encrypted text to obtain the plaintext, unencrypted source text. Use the new data type String to read in a sentence from the user what the original message was Your program wit encrypt a single sentence that is entered by the user into &- character chunks usng the convert character data utilizing a selection scture to perform Ron3 encryption of a plaintext character to a cipher text value. Utilize a looping structure to process an entire String. What kind of loop would work best to do the ROT13 oipher. So, for instance, f you entered MEET ME IN THE NORTHERN COURTYARD, your program would output of the string? Here are some lava tools that might be useful ZRRGZR VAGURA BEGURE APBHEG INEC, with lertevs in the aphertest being grouped by variableName.length) will be uveful to get the number of characters in the String All converted characters (the ROT13 ophertextj should be of input cane. variableName.charAtp), where x is a postion in the String variableName uppercase regardiess will be useful to get an individual character in the String variableName.toupperCase0 will generate an all-uppercase version of the String stored in variable You may have encountered this before in lab or elsewhere, but we can now officialily introdace the string data type, as you'l need this in order to store an entie sentence of text variableName, and could be used like thi: for in case you wart to use vanableName.toupperCase The String data type will be dscussed in greater depth later this semester variatieNarne output, Se is the format specifier for a char value in a System.out printt statement other variables, but uning it for input and to got A string varlable is declared lke particular characters is a ltle different. To read an entie sentence from the keyboard into a String varlable, you would use the The nice thing about ROT17 encryption is that you can use the plantext opher key to do both encryption and decryption, In cipher conversions, you typicahy gnore any punctuation and just move on to the next character to process. of you Scanner. This reads multple wordu/chunks of text from the unbl the ENTER or the 8STURN bey n sned So if the input was

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

Students also viewed these Databases questions