1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Zanzabum
4 years ago
7

We are working on Public Key Crypto, RSA, Extended Euclidean algoLet n = 2419 = 41 ∗ 59 and e = 7. (1) Find the private key d. (

2) Encrypt the message 6. (3) Sign the message 10. Assume RSA is used. Use the egcd.py program at the lecture attachments folder, described in section 10.3.3, to compute d. For parts 2 and 3, you only need to show the formula; there is no need to calculate the final results.egcd.py#!/usr/bin/python3def egcd(a, b):if a == 0:return (b, 0, 1)else:g, x, y = egcd(b % a, a)return (g, y - (b // a) * x, x)print ('This program gets two integers and calculates their gcd')print ('Example: input e=18 phi=24, output gcd(18,24)=6 d=-1 y=1')e = int(input('Input a number for e: '))phi = int(input('Input a number for phi: '))g, x, y = egcd(e, phi)print ('gcd = ', g)print ('d = ', x)print ('y = ', y)
Computers and Technology
1 answer:
Bas_tet [7]4 years ago
6 0

Answer:

Explanation:

  • Generate the RSA modulus (n)

  • Select two large primes, p and q.

  • Calculate n=p*q. For strong unbreakable encryption, let n be a large number, typically a minimum of 512 bits.

  • Find Derived Number (e)

  • Number e must be greater than 1 and less than (p − 1)(q − 1).

  • There must be no common factor for e and (p − 1)(q − 1) except for 1. In other words two numbers e and (p – 1)(q – 1) are coprime.

  • Form the public key

  • The pair of numbers (n, e) form the RSA public key and is made public.

  • Interestingly, though n is part of the public key, difficulty in factorizing a large prime number ensures that attacker cannot find in finite time the two primes (p & q) used to obtain n. This is strength of RSA.

  • Generate the private key

  • Private Key d is calculated from p, q, and e. For given n and e, there is unique number d.

  • Number d is the inverse of e modulo (p - 1)(q – 1). This means that d is the number less than (p - 1)(q - 1) such that when multiplied by e, it is equal to 1 modulo (p - 1)(q - 1).

  • This relationship is written mathematically as follows −

ed = 1 mod (p − 1)(q − 1)

The Extended Euclidean Algorithm takes p, q, and e as input and gives d as output.

Example

An example of generating RSA Key pair is given below. (For ease of understanding, the primes p & q taken here are small values. Practically, these values are very high).

  • Let two primes be p = 7 and q = 13. Thus, modulus n = pq = 7 x 13 = 91.

  • Select e = 5, which is a valid choice since there is no number that is common factor of 5 and (p − 1)(q − 1) = 6 × 12 = 72, except for 1.

  • The pair of numbers (n, e) = (91, 5) forms the public key and can be made available to anyone whom we wish to be able to send us encrypted messages.

  • Input p = 7, q = 13, and e = 5 to the Extended Euclidean Algorithm. The output will be d = 29.

  • Check that the d calculated is correct by computing −

de = 29 × 5 = 145 = 1 mod 72

  • Hence, public key is (91, 5) and private keys is (91, 29).

You might be interested in
By itself, the human eye cannot see anything in three dimensions. What does the passage say enables us to see the world in 3-D?
algol13

Answer:

he miracle of our depth perception comes from our brain's ability to put together two 2D images in such a way as to extrapolate depth. This is called stereoscopic vision.

Explanation:

4 0
3 years ago
Read 2 more answers
As you will solve more complex problems, you will find that searching for values in arrays becomes a crucial operation. In this
sergeinik [125]

Answer:

#include<iostream>

using namespace std;

int main() {

cout<<"Enter The Size Of Array: ";

int size;

bool isBestCase=false;

cin>>size;

if(size<=0){

cout<<"Error: You entered an incorrect value of the array size!"<<endl;

return(0);

}

int array[size], key;

cout<<"Enter the numbers in the array, separated by a space, and press enter:";

// Taking Input In Array

for(int j=0;j<size;j++){

cin>>array[j];

}

//Your Entered Array Is

for(int a=0;a<size;a++){

cout<<"array[ "<<a<<" ] = ";

cout<<array[a]<<endl;

}

cout<<"Enter a number to search for in the array:";

cin>>key;

for(i=0;i<size;i++){

 if(key==array[i]){

   if(i==0){

     isBestCase=true; // best case scenario when key found in 1st iteration

     break;

   }

 }

}

if(i != size){

 cout<<"Found value "<<key<<" at index "<<i<<", which took " <<++i<<" checks."<<endl;

}  else{

 cout<<"The value "<<key<<" was not found in array!"<<endl;

 cout<<"We ran into the worst-case scenario!"; // worst-case scenario when key not found

}

if(isBestCase){

cout<<"We ran into the best case scenario!";

}

return 0;

}

Explanation:

The C++ source dynamically generates an array by prompting the user for the size of the array and fills the array with inputs from the user. A search term is used to determine the best and worst-case scenario of the created array and the index and search time is displayed.

5 0
3 years ago
HIPAA protects which of the following kinds of data?
Gelneren [198K]
The answer is a i looked up the question and it says a
5 0
3 years ago
Read 2 more answers
Plz help code practice for python
laila [671]

Answer:umm

Explanation:

6 0
3 years ago
Read 2 more answers
Select the correct answer,
bazaltina [42]

Answer:

b gyhffhhhgghhhhhhhhhhh

3 0
4 years ago
Other questions:
  • Folders are containers used to organize the documents into manageable groups on a designated storage device. true or false
    10·1 answer
  • Windows domain policy to disable windows 10 update
    7·1 answer
  • What is an allocation unit?
    10·1 answer
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • What is the size of the program counter for an avr that has a 1 kbyte rom capacity?
    9·1 answer
  • Explicit knowledge can be documented and codified, whereas tacit knowledge encompasses insights, judgment, creative processes, a
    9·1 answer
  • 2. How do upgrading and retraining help you cope with change?
    5·1 answer
  • _______is a network of physical objects embedded with sensors, processors, software and network connectivity capability to enabl
    6·1 answer
  • A weighted GPA counts__more highly.
    12·1 answer
  • For which tasks would Excel be useful? Check all that apply.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!