Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

develop a simple Android app, SDPEncryptor , that encrypts messages using a simple substitution cipher. INPUTS: Entry Text: message to be encoded. This input should

develop a simple Android app,SDPEncryptor, that encrypts messages using a simple substitution cipher.

INPUTS:

  1. Entry Text: message to be encoded.
  • This input should be anon-empty stringand must containat least one letter or number.
  • This input should be provided to the app through anEditText widget, initially blank.
  1. Arg Input 1: first encryption parameter.
  • This input should be anintegercoprime to 36 between 0 and 36: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, or 35.
  • This input should be provided to the app through an EditText widget, initially set to '1'.
  1. Arg Input 2: second encryption parameter.
  • This input should be aninteger >= 1 and < 36.
  • This input should be provided to the app through an EditText widget, initially set to '1'.

OUTPUT:

  1. Text Encrypted, the text resulting from applying the following cipher:
  • Each character in the alphabet is assigned a numeric value between 0 and 35 based on its position in the alphabet (i.e., "A"=0, "a"=0, "B"=1, "b"=1, ..., "Z"=25, "z"=25, "0"=26, "1"=27, ..., "9"=35). Note that the alphabet contains letters and numbers.
  • For each character in the alphabet, where the numeric value isx, the encoded value of the letter is defined asE(x) =(ax+b) % 36whereaandbare the values of Arg Input 1 and Arg Input 2 respectively, as in anAffine Cipher.
  • The encoded character for the input character is calculated by taking the encoded number, which is a value between 0 and 35, and translating it back into a character (again, where "A"=0, "a"=0, "B"=1, "b"=1, ..., "Z"=25, "z"=25, "0"=26, "1"=27, ..., "9"=35).
  • Capitalization of alphabetic characters must be inverted (i.e., all lowercase characters are transformed into upper case characters and vice versa). Numbers encoded to alphabetic characters must be lowercase.
  • All non-alphanumeric characters must remain unchanged.

The output should be shown using anon-editableTextView 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).

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago