Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRITE IN PYTHON USING JUPYTER NOTEBOOK Create a function affineEncrypt(text, a,b ) that returns the cipher text encrypted using key (a,b). You must verify

image text in transcribedimage text in transcribed

PLEASE WRITE IN PYTHON

USING JUPYTER NOTEBOOK

Create a function affineEncrypt(text, a,b ) that returns the cipher text encrypted using key (a,b). You must verify that the gcd(a,26)=1 before making the encryption. If this is not the case, the function must raise a ValueError with message "The given key is invalid. The gcd(a,26) must be 1.". You may NOT use any built-in functions as part of your implementation, but you may use any functions you implemented in previous coding assignments. Please make sure to copy and paste them into this file, so that they are uploaded to CodePost when you submit your pa3.py file. def affineEncrypt (text, a,b) : "" "encrypts the plaintext 'text', using an affine transformation key (a, b) INPUT: text - plaintext as a string of letters a-integersatisfyinggcd(a,26)=1.Raiseserrorifsuchisnotthecasb-integer OUTPUT: The encrypted message as a string of characters "N" pass

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_2

Step: 3

blur-text-image_3

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

=+How many children do you have?

Answered: 1 week ago