Home > Back-end > Strives for the guidance, the inside of the C program run openssl functions have no reaction
Strives for the guidance, the inside of the C program run openssl functions have no reaction
Time:04-09
Just installed openssl - 1.1.1 f, want to run a hash function, the code is as follows:
#include #include #include
Int main (int arg c, char * * argv) { Printf (" hello world \ n "); Unsigned char hash [SHA_DIGEST_LENGTH]; Unsigned char content [4096]={' \ x41 '}; Unsigned int len=4096; Unsigned char * res=SHA1 (content, len, hash); Printf (" digest=% s ", hash); return 0; }
Under the Windows CMD compiled using GCC, command GCC -o test test. The c - llibssl - llibcrypto
Results running exe program only print the hello world, exe window automatically shut down after a few seconds, try the SHA256 function is the same situation, can you tell me what's the problem?