[SEEDLAB] CRYPTOGRAPHY WRITEUP (RSA) #3


The example source code has been provided by the task. What I need to do is that I need to
calculate the private key d by using the BIGNUM APIs and (e,n) as the public key and (d, n) as the private
key. By filling out the lines of the given code, I can solve the task. I wrote the code as follows:




What I need to do is encrypt the message “A top secret!” which is the same as
“4120746f702073656372657421 (== M)”. I need to use (e, n) as the public key, and (d, n) as the
private key. Since the example code is given, I need to fill out the rest to complete the task. I wrote
the code as follows:




What I need to do is decrypt ciphertext C which is:
“8C0F971DF2F3672B28811407E2DABBE1DA0FEBBBDFC7DCB67396567EA1E2493F”
by using the private key (d, n).
Since the example code is given, I wrote code as follows:


