3) Out of the following, name which kind of attack you carried out in part 1 and part2: a. ciphertext only, b. known plaintext, c. chosen plaintext, d. chosen ciphertext. Explain your answer Problem 3
10 points] A 4-bit long message was encrypted using one-time pad to yield a cipher-text “1010” Assuming the message space consists of all 4-bit long messages, what is the probability that the corresponding plaintext was “1001”? Explain your answer.
Problem 4
Assume we perform a known-plaintext attack on DES with one pair of plaintext and ciphertext. How many keys do we have to test in a worst-case scenario if we apply an exhaustive key search in a straightforward way? How many on average? Explain your answer.
Problem 5 [10*3=30pts] In this case, you are asked to attack an RSA encrypted message. Imagine being the attacker: You obtain the ciphertext C=1141 by eavesdropping on a certain connection. The public key is kpub=(n,e)=(2623,2111). a. Consider the encryption formula, C=Me mod n. All variables except the plaintext M are known. Why can’t you simply solve the equation for M? b. In order to determine the private key d, you have to calculate d=e-1 mod Ø(n).
There is an efficient expression for calculating Ø(n). Can we use this formula here? c. Calculate the plaintext M by computing the private key d through factoring n=p.q. Does this approach remain suitable for number with a length of 1024 bit or more?
Problem 6
1) Use the Euclidian algorithm to compute (Show all of the steps involved)
a. The GCD of 7469 and 2464.
b. The GCD of 198 and 243 (use the Extended form).
2) We also discussed the use of the Extended Euclidian algorithm to calculate modular inverses. Use this algorithm to compute the following values. Show all of the steps involved. a. 9570-1(mod 12935) b. 550-1 (mod 1769) 3) Let n be a product of two large primes p and q (i.e., n=pq). Assume that x, y, and g are relatively prime to n. 1) If x ≡ y (mod n), is gx ≡ gy (mod n)? Show why or why not. 2) If x ≡ y (mod Φ(n)) instead, is gx ≡ gy (mod n)? Show why or why not.
Problem 6:
1.a) GCD of 7469 and 2464
step1 : Divide the larger number by the smaller one: 7469/2464=3+77;
step2 : Divide the smaller number by the above operations remainder: 2464/77=32+0;
As the remainder is 0,we stop the process: 77 is the greatest common factor for the above numbers.
b)GCD of 198 and 243
step1 : Divide the larger number by the smaller one: 243/198=1+45;
step2 : Divide the smaller number by the above operations remainder: 198/45=4+18;
step3 : Divide the remainder from the step1 by the remainder from step2: 45/18=2+9;
step4 : Divide the remainder from step2 by the remainder from step3: 18/9=2+0;
As the remainder is 0,we stop the process. 9 is the GCD of two numbers.
3) Out of the following, name which kind of attack you carried out in part 1...
In C++ or C ONLY PLEASE
1.thefunctionsforRSA:
(a)Mappingfunction from
todecimaldigits(SeetextbFigure9.7.(b)andformapping).willtoausedinRSAencryptionanddecryption.
(b)Keythattheinputsofprimeand,andgeneratetheparameters(n,
?(n), e, d),andtheforRSA.Thesub-routines
GCD function to find e:
gcd(?(n), e) = 1; 1 < e
< ?(n). Since there could be many such e
values, you may use gcd to find the first five such
e values.
Multiplicative inverse: d = e?1(mod
?(n)). You may use extended Euclidean algorithm
to find the first five such d values corresponding to each
of five e values (Note: Your
multiplicative inverse value...
do the following in python idle 3.5 or higher know nothing on
this subject
Eile Edit Yew Hbtory Bookmarks bols Help Microsoft Word-Situatio x S Female coaches: Why are. x a SakaieURI:csc 110 spri.. x O lab7-crypto-s17-labr-cry. x Writer The owing Code. x https sakai. 7-Cryptog rithms -10 28 /lab7-cryp 67k e a Search A Most visited e Getting started To decode an Affine cipher, we need to reverse the process. This is not a simple as reversing a Caesar...
Write code for RSA encryption package rsa; import java.util.ArrayList; import java.util.Random; import java.util.Scanner; public class RSA { private BigInteger phi; private BigInteger e; private BigInteger d; private BigInteger num; public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); System.out.println("Enter the message you would like to encode, using any ASCII characters: "); String input = keyboard.nextLine(); int[] ASCIIvalues = new int[input.length()]; for (int i = 0; i < input.length(); i++) { ASCIIvalues[i] = input.charAt(i); } String ASCIInumbers...
Part 3: Transposition Ciphers #can't use ord or chr functions You must implement three transposition ciphers (the "backwards" cipher, the Rail Fence cipher, and the Column Transposition cipher) where the ciphertext is created via an altered presentation of the plaintext. The algorithm for each is detailed in the function descriptions in this section. (13 points) def backwards_cipher(plaintext, key): • Parameter(s): plaintext ----- a string; the message to be encrypted key ----- an integer; the number to control this cipher •...
Computing RSA by hand. Let p = 13, q = 23, e = 17 be your initial parameters. You may use a calculator for this problem, but you should show all intermediate results. Key generation: Compute N and Phi(N). Compute the private key k_p = d = e^-1 mod Phi(N) using the extended Euclidean algorithm. Show all intermediate results. Encryption: Encrypt the message m = 31 by applying the square and multiply algorithm (first, transform the exponent to binary representation)....
This is the prompt then the question asks, "What is the
ciphertext for the word LODE? (Simplify your answers completely.
Enter your answers as a comma-separated list.)"
Please help I have been stuck for hours.
In public key cryptography, there are two keys created, one for encoding a message (the public key) and one for decoding the message (the private key). One form of this scheme is known as RSA, from the first letters of the last names of Ron...
2. Alice is a student in CSE20. Having learned about the RSA cryptosystem in class, she decides to set-up her own public key as follows. She chooses the primes p=563 and q = 383, so that the modulus is N = 21 5629. She also chooses the encryption key e-49. She posts the num- bers N = 215629 and e-49 to her website. Bob, who is in love with Alice, desires to send her messages every hour. To do so,...
Use C++
forehand e receiver creates a public key and a secret key as follows. Generate two distinct primes, p andq. Since they can be used to generate the secret key, they must be kept hidden. Let n-pg, phi(n) ((p-1)*(q-1) Select an integer e such that gcd(e, (p-100g-1))-1. The public key is the pair (e,n). This should be distributed widely. Compute d such that d-l(mod (p-1)(q-1). This can be done using the pulverizer. The secret key is the pair (d.n)....
Write a javascript program which implements the following two classical cryptosystem which we covered in class: Affine Cipher Vigenere Cipher Your program should consist of at least five functions: Two functions named encrypt, one for each of the two algorithms which accepts a lowercase alphabetical plaintext string and key as input and outputs a corresponding cipher text string. Two functions named decrypt, one for each of the two algorithms which accepts a lowercase alphabetical ciphertext string and a key as...
Write a program in Python implement the RSA algorithm for cryptography. Set up: 1.Choose two large primes, p and q. (There are a number of sites on-line where you can find large primes.) 2.Compute n = p * q, and Φ = (p-1)(q-1). 3.Select an integer e, with 1 < e < Φ , gcd(e, Φ) = 1. 4.Compute the integer d, 1 < d < Φ such that ed ≡ 1 (mod Φ). The numbers e and d are...