The formula if he copies correctly if not plain numbers
Here's the complete question below that clarifies what you need to do
<u>Explanation</u>:
"In this task, we will study the performance of public-key algorithms. Please prepare a file ( message.txt) that contains a 16-byte message. Please also generate an 1024-bit RSA public/private key pair. Then, do the following:
1)Encrypt message.txt using the public key; save the the output in message_enc.txt.
2)Decrypt message_enc.txt using the private key.
3)Encrypt message.txt using a 128-bit AES key.
<em><u>Compare the time spent on each of the above operations, and describe your observations. If an operation is too fast, you may want to repeat it for many times, i.e., 5000 times, and then take an average.</u></em>
<em><u> After you finish the above exercise, you can now use OpenSSL's speed command to do such a benchmarking. Please describe whether your observations are similar to those from the outputs of the speed command?</u></em>
Answer:
#include <math.h>
#include <stdio.h>
#include <string.h>
#define BASE 3
#define NRQUESTIONS 15
void toABC(int n, char* buf, int base, int size) {
memset(buf, 'A', size);
buf[size] = 0;
while (n && size) {
buf[--size] = 'A' + (n % base);
n /= base;
}
}
int main()
{
char buf[16];
for (int i = 0; i < pow(BASE, NRQUESTIONS); i++) {
toABC(i, buf, BASE, NRQUESTIONS);
printf("%s\n", buf);
}
}
Explanation:
Assuming 3 is the number of possible answers to choose from for each question.
I tackled this by having an integer counter enumerate all values from 0 to 3^15, and then convert each integer to a base-3 representation, using ABC in stead of 012.
If you're talking about MATLAB, the simplify command performs an algebraic simplification within the given parameters in the parenthesis. You can use the command simplify on polynomials, expressions with trigonometric, logarithmic, and special functions. For example the following expression simplify(cos(0)) would return 1.
The sample recursive Python Function is given below. See the definition of a Recursive Python Function.
<h3>
What is a R
ecursive Python Function?</h3>
A recursive function is one that defines itself in terms of itself using self-referential phrases.
This signifies that the function will keep calling itself and repeating its action until some condition is fulfilled and a result is returned.
Sample Recursive Python Function is:
def remove_all0(x,s):
while s!=[]:
if x == s[0]:
ss = [s[1]] + remove_all0(x,s[2:])
return ss
else:
s1 = [s[0]] + remove_all0(x, s[1:])
return s1
if s==[]:
return s
print(remove_all0(3,[4,3,5,6,3,2,1]))
Learn more about Recursive Python Functions at;
brainly.com/question/14208577
#SPJ1