Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an encryption function in python that takes in a string and a key and returns ciphertext and a decryption function that can take a

Write an encryption function in python that takes in a string and a key and returns ciphertext and a decryption function that can take a key and ciphertext and return plaintext. Plaintext length is mod 12

Def my_encrypt(plaintext, key):

Def my_decrypt(plaintext, key):

image text in transcribed

image text in transcribed

Code Portion: A Sage/Jupyter notebook named cryptosystem. ipynb that contains the ollowing: A function called my_encrypt (plaintext, key) that takes in a string of capital letters and a key. It returns the ciphertext corresponding to encrypting plaintext using your algorithm with key equal to key .A function called my_decrypt (ciphertext, key) that takes in a string and key. It returns the plaintext corresponding to ciphertext with encryption key equal to key. Because it is decrypting, it must have the property that my_decrypt (my_encrypt (plaintext,key),key) - plaintext, for any valid plaintext and key. . A message to be encrypted consists of a string containing only the characters A,B,...,Z. A message of any length that is a multiple of 12 can be encrypted. The encrypted message must be a string of characters (but not necessarily just capital letters) Page 1 of 5 Spring 2019 Project 1 MAT 331 The key can havc a varicty of forms, but you must cxplicitly spccify which kcys arc allowablc. There can be at most 261295428956661682176 valid choices of key. The key must be describable with a string (but not necessarily just capital letters). So, for instance, one example of the set of valid possible choices of key is s: s is a string consisting of capital letters of length 12) Another example is (s: s is a binary (0,1) string of length 56 Code Portion: A Sage/Jupyter notebook named cryptosystem. ipynb that contains the ollowing: A function called my_encrypt (plaintext, key) that takes in a string of capital letters and a key. It returns the ciphertext corresponding to encrypting plaintext using your algorithm with key equal to key .A function called my_decrypt (ciphertext, key) that takes in a string and key. It returns the plaintext corresponding to ciphertext with encryption key equal to key. Because it is decrypting, it must have the property that my_decrypt (my_encrypt (plaintext,key),key) - plaintext, for any valid plaintext and key. . A message to be encrypted consists of a string containing only the characters A,B,...,Z. A message of any length that is a multiple of 12 can be encrypted. The encrypted message must be a string of characters (but not necessarily just capital letters) Page 1 of 5 Spring 2019 Project 1 MAT 331 The key can havc a varicty of forms, but you must cxplicitly spccify which kcys arc allowablc. There can be at most 261295428956661682176 valid choices of key. The key must be describable with a string (but not necessarily just capital letters). So, for instance, one example of the set of valid possible choices of key is s: s is a string consisting of capital letters of length 12) Another example is (s: s is a binary (0,1) string of length 56

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

Students also viewed these Databases questions