Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in PYTHON IDLE 3.5 thank you b) Write a function to check for relatively prime numbers In order for the Affine cipher to work,

Write in PYTHON IDLE 3.5 thank you

image text in transcribed

b) Write a function to check for relatively prime numbers In order for the Affine cipher to work, the multiplier a must be relatively prime with the modulus m. This means that the two integers have no common factors. For example 15 and 26 have no factors in common, so 15 is an acceptable value for a, however 12 and 26 have factors in common (e.g. 2) so 12 cannot be used for a value of a. Write a function that takes as parameters two positive integers (a and m) and returns TRUE if the two numbers are relatively prime and FALSE if they are not relatively prime. Instructor Initials: c) Write a function to compute the Affine cipher. The input parameters for the function will be a, b, m and the plaintext. The function will return the ciphertext. This function should check to make sure that a and m are relatively prime (by calling the function above). If not, it should return a blank string, Test your function using the examples from part b) above

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

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions

Question

Describe the capabilities of online analytical processing (OLAP).

Answered: 1 week ago

Question

Question Who can establish a Keogh retirement plan?

Answered: 1 week ago