Question: #include #include int main ( ) { SHA 2 5 6 _ CTX c; unsigned char buffer [ SHA 2 5 6 _ DIGEST _

#include
#include
int main ()
{
SHA256_CTX c;
unsigned char buffer[SHA256_DIGEST_LENGTH];
int i;
SHA256_Init(&c);
SHA256_Update(&c,
"secretkey:Launch a missile towards Target A."
"\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x01\x60"
"Launch a missile towards the headquarter.",
64+41);
SHA256_Final(buffer, &c);
for (i=0;i<32;i++){
printf("%02x", buffer[i]);
}
printf("
");
return 0;
}
[08/09/22] seed@VM: ~/Share$ sudo gcc sha256_padding.c -lcrypto
[08/09/22] seed@VM: ~/Share$ a.out
4ad0ea09a1954d6c4d1b41d650dece070a009963d21f08504c07af723d8e854f
The hash value shown in the last line above is the hash of (K:M||P||T)
What is ?
K:
M:
P:
T:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!