Question

In: Computer Science

Do the following with OpenSSL: Create a 2048 bit RSA private key. Convert this private key...

Do the following with OpenSSL:

  1. Create a 2048 bit RSA private key.
  2. Convert this private key into a text format so it shows the following information:
  • modulus
  • public exponent (e)
  • private exponent (d)
  • the primes (p and q)

Use the appropriate command that generates this information and saves it in key.txt file.

  1. Save the message "Hello from (your UID)" in a plaintext file message.txt. Using openssl's rsautl option to sign this message with your private key (key.txt). Save this signed message as the file signed.txt. Use this link for reference.
  2. Using openssl's rsautl option encrypt the message.txt file using your private key generated in Step#1 above. Save the encrypted message as encrypted.txt.
  3. Assemble all the files of key.txt, signed.txt, message.txt and encrypted.txt and all procedure screenshots of above work into a single file to upload for submission.

Solutions

Expert Solution

How do I generate an RSA key?
Use the genrsa option.

# default 1024-bit key, sent to standard output
openssl genrsa

# 2048-bit key, saved to file named mykey.pem
openssl genrsa -out mykey.pem 2048

# same as above, but encrypted with a passphrase
openssl genrsa -des3 -out mykey.pem 2048

How do I generate a public RSA key?
Use the rsa option to produce a public version of your private RSA key.

openssl rsa -in mykey.pem -pubout

openssl genrsa -out mykey.pem 1024
will actually produce a public - private key pair. The pair is stored in the generated mykey.pem file.

openssl rsa -in mykey.pem -pubout > mykey.pub
will extract the public key and print that out

To just output the public part of a private key:

openssl rsa -in key.pem -pubout -out pubkey.pem
To get a usable public key for SSH purposes, use ssh-keygen:

ssh-keygen -y -f key.pem > key.pub

RSA private key syntax

An RSA private key should be represented with the ASN.1 type
RSAPrivateKey:

RSAPrivateKey ::= SEQUENCE {
version Version,
modulus INTEGER, -- n
publicExponent INTEGER, -- e
privateExponent INTEGER, -- d
prime1 INTEGER, -- p
prime2 INTEGER, -- q
exponent1 INTEGER, -- d mod (p-1)
exponent2 INTEGER, -- d mod (q-1)
coefficient INTEGER, -- (inverse of q) mod p
otherPrimeInfos OtherPrimeInfos OPTIONAL
}


Related Solutions

In the RSA public-key encryption scheme, each user has a public key, e, and a private...
In the RSA public-key encryption scheme, each user has a public key, e, and a private key, d. Suppose Alice leaks her private key. Rather than generating a new modulus, she decides to generate a new public key and a new private key. Is this safe? why or why not?
RSA: Public and Private Key Encryption im doing this on an ubuntu virtual machine but unsure...
RSA: Public and Private Key Encryption im doing this on an ubuntu virtual machine but unsure how to Create your public and private keys and create and encrypted message using python Then encrypt the message with your private key I need output of a Message you sent (in plain text and encrypted) Message you received (in plain text and encrypted)
RSA: Public and Private Key Encryption im doing this on an ubuntu virtual machine but unsure...
RSA: Public and Private Key Encryption im doing this on an ubuntu virtual machine but unsure how to Create your public and private keys and create and encrypted message using python Then encrypt the message with your private key I need output of a Message you sent (in plain text and encrypted) Message you received (in plain text and encrypted)
I have generated a RSA key and saved the private in PEM format after randomly changing...
I have generated a RSA key and saved the private in PEM format after randomly changing 2 consecutive characters inside it (the characters will only apply to p, q, d, n, u). Now I want to write a program that tries to fix the changed PEM file in Python. Any suggestions on how to write my code?
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit...
Convert the following decimal numbers to 32-bit IEEE floating point: 86.59375 -1.59729 Convert the following 32-bit IEEE floating point numbers to decimal: 0100 1100 1110 0110 1111 1000 0000 0000 1011 0101 1110 0110 1010 0110 0000 0000
Create the Parser module in System Verilog to convert the 8-bit Button Board input into four...
Create the Parser module in System Verilog to convert the 8-bit Button Board input into four 4-bit Binary Coded Decimal numbers. The parser should read in an 8-bit Button Board input as an 8-bit number (0-255). Parse that 8-bit number into four 4-bit numbers (0-9) representing its ones, tens, hundreds, and thousands digit.
Convert 1.67e14 to the 32-bit IEEE 754 Floating Point Standard, with the following layout: first bit...
Convert 1.67e14 to the 32-bit IEEE 754 Floating Point Standard, with the following layout: first bit is sign bit, next 8 bits is exponent field, and remaining 23 bits is mantissa field; result is to be in hexadecimal and not to be rounded up. answer choices 5717E27B 57172EB7 5717E2B7 C717E2B7 5771E2B7
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25...
Convert the following numbers to 8-bit binary and 8-bit hexadecimal: a) 20 b) 78 c) -25 d) -96 Convert the following hexadecimal numbers to binary and decimal assuming two's compliment format: a) 0x56 b) 0x14 c) 0xF8 d) 0xCC MUST DO ALL PROBLEMS AND SHOW ALL WORK!!!!
3) Convert 1.25 decimal to 32 bit floating point format. 4) Convert the following truth table...
3) Convert 1.25 decimal to 32 bit floating point format. 4) Convert the following truth table to a digital circuit consisting of NOT, AND, and OR gates. ABC Out 000 1 001 1 010 0 011 0 100 1 101 0 110 1 111 0 5) Construct a tri-state buffer using transistors 10) What are the advantages of a large page size?
1. Please convert the following decimal numbers to 8-bit binary sign magnitude and to 8-bit 2’s...
1. Please convert the following decimal numbers to 8-bit binary sign magnitude and to 8-bit 2’s complement. Please show your work if there are multiple steps. Sign Magnitude 2’s complement a. +67 b. +40 c. -28 d. -40
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT