Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, so I have used online resources to create a code in C that will Decrypt a message but I don't understand what each line
Hi, so I have used online resources to create a code in C that will Decrypt a message but I don't understand what each line of code does, could someone annotate and comment explaining line by line for me? Please make sure its the actual code I have provided, please.
X X *Encrypt.c *Decrypt.c #define NBITS 256 void printBN(char*msg, BIGNUM *a) { char *number_str = BN_bn2hex(a); printf("%s %5 ", msg, number_str); OPENSSL_free(number_str); } int main() { BN_CTX *ctx = BN_CTX_new(); BIGNUM *e = BN_new(); BIGNUM *n = BN_new(); BIGNUM *m BN_new(); BIGNUM *d BN_new(); BIGNUM *C = BN_new(); BN_hex2bn(&n, "DCBFFE3E51F62E09CE7032E2677478946A849DC4CDDE3A4DOCB81629242FB1A5"); BN_hex2bn(&d, "740806F9F3A62BAE331FFE3F0A68AFE35B3D2E4794148AACBC26AA381CD7D300"); BN_hex 2bn(&e, "010001"); BN_hex2bn(&c, "8C0F971DF2F3672B28811407E2DABBE1DAOFEBBBDFC7DCB67396567EA1E2493F"); BN_mod_exp(m,c,d, n,ctx); printBN("m= ",m); BN_CTX_free(ctx); return 0; } C Tab Width: 8 Ln 23, Col 18 INS
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started