0
点赞
收藏
分享

微信扫一扫

openssl(sha)

霸姨 2022-05-20 阅读 20
#include "stdafx.h"

#include <string.h>

#include <openssl/sha.h>

int main(int argc, char* argv[])

{

printf("Hello World!\n");

char buf[]="123456";

unsigned char md[50]={0};

SHA_CTX ctx;

SHA_Init(&ctx);

SHA_Update(&ctx,buf,strlen(buf));

// SHA_Update(&ctx,buf,strlen(buf));

int rs= SHA_Final(md,&ctx);

for (int i=0;i<20;i++)

{

printf("%.2X ",md[i]);

}

return 0;

}
举报

相关推荐

0 条评论