当前位置: 首页 > news >正文

网站程序语言那个好做网站哪

网站程序语言那个好,做网站哪,微企帮做网站,盐山做网站价格文章目录 openssl3.2 - 官方demo学习 - digest - EVP_MD_stdin.c概述笔记END openssl3.2 - 官方demo学习 - digest - EVP_MD_stdin.c 概述 使用 SHA3-512 对stdin输入做摘要, 并输出摘要值. 笔记 /*! \file EVP_MD_stdin.c \note openssl3.2 - 官方demo学习 - digest - EVP… 文章目录 openssl3.2 - 官方demo学习 - digest - EVP_MD_stdin.c概述笔记END openssl3.2 - 官方demo学习 - digest - EVP_MD_stdin.c 概述 使用 SHA3-512 对stdin输入做摘要, 并输出摘要值. 笔记 /*! \file EVP_MD_stdin.c \note openssl3.2 - 官方demo学习 - digest - EVP_MD_stdin.c 使用 SHA3-512 对stdin输入做摘要, 并输出摘要值. *//*-* Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.** Licensed under the Apache License 2.0 (the License). You may not use* this file except in compliance with the License. You can obtain a copy* in the file LICENSE in the source distribution or at* https://www.openssl.org/source/license.html*//*-* Example of using EVP_MD_fetch and EVP_Digest* methods to calculate* a digest of static buffers* You can find SHA3 test vectors from NIST here:* https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/sha3/sha-3bytetestvectors.zip* For example, contains these lines:Len 80Msg 1ca984dcc913344370cfMD 6915ea0eeffb99b9b246a0e34daf3947852684c3d618260119a22835659e4f23d4eb66a15d0affb8e93771578f5e8f25b7a5f2a55f511fb8b96325ba2cd14816* use xxd convert the hex message string to binary input for EVP_MD_stdin:* echo 1ca984dcc913344370cf | xxd -r -p | ./EVP_MD_stdin* and then verify the output matches MD above.*/#include string.h #include stdio.h #include openssl/err.h #include openssl/evp.h#include my_openSSL_lib.h/*-* This demonstration will show how to digest data using* a BIO created to read from stdin*/int demonstrate_digest(BIO* bio_input) {OSSL_LIB_CTX* _ossl_lib_ctx NULL;int ret 0;const char* _psz_option_properties NULL;EVP_MD* _evp_md_message_digest NULL;EVP_MD_CTX* _evp_md_ctx_digest_context NULL;unsigned int digest_length;unsigned char* _psz_digest_value NULL;unsigned char buffer[512];int i;_ossl_lib_ctx OSSL_LIB_CTX_new();if (_ossl_lib_ctx NULL) {fprintf(stderr, OSSL_LIB_CTX_new() returned NULL\n);goto cleanup;}/** Fetch a message digest by name* The algorithm name is case insensitive.* See providers(7) for details about algorithm fetching*/_evp_md_message_digest EVP_MD_fetch(_ossl_lib_ctx,SHA3-512, _psz_option_properties);if (_evp_md_message_digest NULL) {fprintf(stderr, EVP_MD_fetch could not find SHA3-512.);ERR_print_errors_fp(stderr);OSSL_LIB_CTX_free(_ossl_lib_ctx);return 0;}/* Determine the length of the fetched digest type */digest_length EVP_MD_get_size(_evp_md_message_digest);if (digest_length 0) {fprintf(stderr, EVP_MD_get_size returned invalid size.\n);goto cleanup;}_psz_digest_value OPENSSL_malloc(digest_length);if (_psz_digest_value NULL) {fprintf(stderr, No memory.\n);goto cleanup;}/** Make a message digest context to hold temporary state* during digest creation*/_evp_md_ctx_digest_context EVP_MD_CTX_new();if (_evp_md_ctx_digest_context NULL) {fprintf(stderr, EVP_MD_CTX_new failed.\n);ERR_print_errors_fp(stderr);goto cleanup;}/** Initialize the message digest context to use the fetched* digest provider*/if (EVP_DigestInit(_evp_md_ctx_digest_context, _evp_md_message_digest) ! 1) {fprintf(stderr, EVP_DigestInit failed.\n);ERR_print_errors_fp(stderr);goto cleanup;}while ((i BIO_read(bio_input, buffer, sizeof(buffer))) 0) {if (EVP_DigestUpdate(_evp_md_ctx_digest_context, buffer, i) ! 1) {fprintf(stderr, EVP_DigestUpdate() failed.\n);goto cleanup;}break; /*! 只处理一次用户输入就拉到了, 实际应用中可以多次调用EVP_DigestUpdate */}if (EVP_DigestFinal(_evp_md_ctx_digest_context, _psz_digest_value, digest_length) ! 1) {fprintf(stderr, EVP_DigestFinal() failed.\n);goto cleanup;}ret 1;for (i 0; i (int)digest_length; i) {fprintf(stdout, %02x, _psz_digest_value[i]);}fprintf(stdout, \n);cleanup:if (ret ! 1)ERR_print_errors_fp(stderr);/* OpenSSL free functions will ignore NULL arguments */EVP_MD_CTX_free(_evp_md_ctx_digest_context);OPENSSL_free(_psz_digest_value);EVP_MD_free(_evp_md_message_digest);OSSL_LIB_CTX_free(_ossl_lib_ctx);return ret; }int main(void) {int ret EXIT_FAILURE;BIO* input BIO_new_fd(fileno(stdin), 1);if (input ! NULL) {ret (demonstrate_digest(input) ? EXIT_SUCCESS : EXIT_FAILURE);BIO_free(input);}if (ret ! EXIT_SUCCESS)ERR_print_errors_fp(stderr);return ret; } END
http://www.pierceye.com/news/622316/

相关文章:

  • 假电影网站做注册长春seo代理计费
  • 网站代运营公司怎么做vip电影网站
  • 南京网站南京网站设计制作公司提高工作效率
  • 大连网站制作最好的公司萍乡商城网站建设
  • 做网站有2个前提条件_一个是网站班级优化大师app下载学生版
  • 自己做网站广告法wordpress自带评论表情
  • 苏州市城乡和建设局网站首页在线crm系统价格
  • php企业门户网站陕西高速公路建设网站
  • 网站商城系统建设方案h5页面制作网站易企秀
  • 绍兴网站建设方案报价seo外贸网站
  • 物流网站建设重要性建筑公司网址大全
  • 腾讯云注册域名后怎么做网站郑州网站建设大华伟业
  • 哪个小说网站可以做封面中国软件园排名前十
  • 门户网站建设预算表十大软件免费下载安装手机版
  • 河南省安阳市建设银行网站wordpress会员卡
  • 旅游类网站怎么做网站前端设计
  • 涉县网站设计商城网站建设推荐
  • 网站注册了域名然后怎么做网站运维是做什么的
  • 深圳学校网站建设哪家好企业宣传网
  • 静态网站如何添加关键词xp花生壳做网站
  • 南宁霸屏网站开发国际数据公司idc
  • 百色建设网站广西建设监理协会网站
  • 天河营销型网站建设惠东网站设计
  • 网站建设用什么科目qq腾讯官网登录入口
  • 做网站硬件手表网站哪个最好知乎
  • 网站制作教程及流程网站优化常见的优化技术
  • 漯河网站建设-千弘网络品划网络做网站
  • 专业广州做网站公司简历网站免费
  • 广州h5网站制作公司营销网站的筛选
  • 国内最新新闻热点事件摘抄seo诊断书