Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to come up with an Android app using Android studio that that encrypts messages using a simple substitution cipher. Entry Text: message to

I need to come up with an Android app using Android studio that that encrypts messages using a simple substitution cipher.
Entry Text: message to be encoded.
This input should be a non-empty string and must contain at least one letter or number.
This input should be provided to the app through an EditText widget, initially blank.
Case 1: first encryption parameter.
This input should be an integer coprime to 62 between 0 and 62: 1,3,5,7,9,11,13,15,...61
This input should be provided to the app through an EditText widget, initially set to '1'.
Statement2: second encryption parameter.
This input should be an integer >=1 and 62.
This input should be provided to the app through an EditText widget, initially set to '1'.
Example:
Text Encrypted, the text resulting from applying the following cipher:
Each character in the alphabet is assigned a numeric value between 0 and 61 based on its position in the alphabet (i.e.,"0"=0,"1"=1,...,"9"=9,"A"=10,"B"=11,...,"Z"=35,"a"=36,"b"=37,...,"z"=61). Note that the alphabet contains letters and numbers.
For each character in the alphabet, where the numeric value is x, the encoded value of the letter is defined as E(x)=(ax + b)%62 where a and b are the values of Arg Input 1 and Arg Input 2 respectively, as in an Affine Cipher.
The encoded character for the input character is calculated by taking the encoded number, which is a value between 0 and 61, and translating it back into a character (again, where "0"=0,"1"=1,...,"9"=9,"A"=10,"B"=11,...,"Z"=35,"a"=36,"b"=37,...,"z"=61).
All non-alphanumeric characters must remain unchanged.
The output should be shown using a non-editable TextView that is initially blank and (re)computed when the "Encrypt Entry Text" button is pressed. If any input is invalid when the button is pressed, the output should then be set to ""(i.e., the empty string), and all applicable error messages should be generated (see below).
The sample is included below
image text in transcribed

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

Master The Art Of Data Storytelling With Visualizations

Authors: Alexander N Donovan

1st Edition

B0CNMD9QRD, 979-8867864248

More Books

Students also viewed these Databases questions