Question: Using the Big Number library provided by openssl, please provide the C-language code that will compute the following : 3.2 Task 2: Encrypting a Message
Using the Big Number library provided by openssl, please provide the C-language code that will compute the following
:
3.2 Task 2: Encrypting a Message Let (e, n) be the public key. Please encrypt the message "A top secret!" (the quotations are not included). We need to convert this ASCII string to a hex string, and then convert the hex string to a BIGNUM using the hex-to-bn API BN.hex2bn (). The following python command can be used to convert a plain ASCII string to a hex string. SEED Labs-RSA Public-Key Encryption and Signature Lab $python -c'print ("A top secret!".encode ("hex")) 4120746f702073656372657421 The public keys are listed in the followings (hexadecimal). We also provide the private key d to help you verify your encryption result. DCBFFE3E51F62E09CE 70 3 2 E 2 677A7 8 9 4 6A849DC4CDDB3A4D0CB81629242FB1A5 n = e = 010001 (this hex value equals to decimal 65537) d74D806F 9F3A 62BAE331FFE3FOA 68AFE35B3D2E4794148AACBC26AA381CD7D30D 3.2 Task 2: Encrypting a Message Let (e, n) be the public key. Please encrypt the message "A top secret!" (the quotations are not included). We need to convert this ASCII string to a hex string, and then convert the hex string to a BIGNUM using the hex-to-bn API BN.hex2bn (). The following python command can be used to convert a plain ASCII string to a hex string. SEED Labs-RSA Public-Key Encryption and Signature Lab $python -c'print ("A top secret!".encode ("hex")) 4120746f702073656372657421 The public keys are listed in the followings (hexadecimal). We also provide the private key d to help you verify your encryption result. DCBFFE3E51F62E09CE 70 3 2 E 2 677A7 8 9 4 6A849DC4CDDB3A4D0CB81629242FB1A5 n = e = 010001 (this hex value equals to decimal 65537) d74D806F 9F3A 62BAE331FFE3FOA 68AFE35B3D2E4794148AACBC26AA381CD7D30D
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
