Question: Problem 1 . ( Reverse ) Implement the function _ reverse ( ) in reverse.py that reverses the one - dimensional list a in place,

Problem 1.(Reverse) Implement the function _reverse() in
reverse.py that reverses the one-dimensional list a in place, ie, without creating a new list.
Problem 2.(Euclidean Distance) Implement the function _distance() in
distance.py that returns the Euclidean distance between the vectors x and y represented as one-dimensional lists of floats. The Euclidean distance is calculated as the square root of the sums of the squares of the differences between the corresponding entries. You may assume that x and y have the same length.Problem 3.(Transpose) Implement the function _transpose() in transpose.py that creates and returns a new matrix that is the transpose of the matrix represented by the argument a. Note that a need not have the same number rows and columns. Recall that the transpose of an m-by- n matrix A is an n-by- m matrix B such that B_(ij)=A_(ji), where 0= i n and 0= j m.
Problem 4.(Palindrome) Implement the function _isPalindrome() in
palindrome.py that returns True if the argument s is a palindrome (ie, reads the same forwards and backwards), and False otherwise. You may assume that s is all lower case and doesn't contain any whitespace characters.1//4
Assignment 4(RSA Crpytosystem)
Problem 5.(Sine Function) Implement the function _sin() in
sin.py that calculates the sine of the argument x(in radians), using the formula
sin(x)=x-x33!+x55!-x77!+cdots.Part II: RSA CryptosystemBackground: RSA (Rivest-Shamir-Adleman) cryptosystem is widely used for secure communication in browsers, bank ATM machines, credit card machines, mobile phones, smart cards, and operating systems. It works by manipulating integers. To thwart eavesdroppers, the RSA cryptosystem must manipulate huge integers (hundreds of digits), which is naturally supported by the int data type in Python. Your task is to implement a library that supports core functions needed for developing the RSA cryptosystem, and implement programs for encrypting and decrypting messages using RSA.
The Math Behind: The RSA cryptosystem involves three integers n,e, and d that satisfy certain mathematical properties. The public key (n,e) is made public on the Internet, while the private key (n,d) is only known to Bob. If Alice wants to send Bob a message xin[0,n), she encrypts it using the function
E(x)=xemodn,
where n=pq for two distinct large prime numbers p and q chosen at random, and e is a random prime number less than m=(p-1)(q-1) such that e does not divide m.
For example, suppose p=47 and q=79. Then n=3713 and m=3588. Further suppose e=7. If Alice wants to send the message x=2020 to Bob, she encrypts it as
E(2020)=20207mod3713=516.
When Bob receives the encrypted message y, he decrypts it using the function
D(y)=ydmodn,
where din[1,m) is the multiplicative inverse of emodm, ie,d is an integer that satisfies the equation edmodm=1.
Continuing the example above, if d=2563, then when Bob receives the encrypted message y=516 from Alice, he decrypts it to recover the original message as
D(516)=5162563mod3713=2020
Problem 1 . ( Reverse ) Implement the function _

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!