Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB. Step-by-step solution with NEAT handwriting and supplementary explanations please. Thank you so much. Create a function called encrypt that accepts a string as input,

MATLAB. Step-by-step solution with NEAT handwriting and supplementary explanations please. Thank you so much.

Create a function called encrypt that accepts a string as input, & returns the encrypted string & the key as outputs.

The encryption algorithm is as follows:

- Generate a random integer between 1-127. This is the key (e.g. key= 10)

- Shift the ASCII code value of all characters in the string by an amount equal to the key plus the

index # of the character in the string (so the code of the 1st char in the string will be shifted by key + 1,

the second by key + 2, and so on).

- Before converting the code values back to char, use a -modulo arithmetic approach to ensure that all the

adjusted values are in the ASCII code range (1 to 127)if the new ASCII value is >=127, -127 to get the new value.

(Note: a standard clock is a modulo-12 device w respect to hrs.) The built-in mod func may be used to accomplish this.

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

2. What is the impact of information systems on organizations?

Answered: 1 week ago

Question

Evaluate the impact of technology on HR employee services.

Answered: 1 week ago