Answered step by step
Verified Expert Solution
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
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) aboveStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started