![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
openssl
加班猿
记录一下生活的点滴,工作上遇到的问题以及学习上的各类笔记
展开
-
C语言openssl aes-128-ecb加解密
openssl aes-128-ecb方式对密码进行md5后的加解密openssl版本:1.0.2g 其他的自行验证编译:gcc aes_128_ecb.c -o aes_128_ecb -lssl -lcrypto执行结果:./aes_128_ecbpasswd: 12345strMd516: A46B755EA8F1B4DDstrBase64Encrypt: cFeeVowosk4cR5gIg7i6ZQ==aes_128_ecb_decrypt OKstrAESDecrypt pass原创 2021-10-16 10:15:16 · 1573 阅读 · 0 评论 -
C++11 ECDSA-withSHA256验签
这里不做签名,只验签使用方法:openssl版本:1.0.2g 其他的自行验证编译:g++ test.cpp -o test -lssl -lcrypto -std=c++11执行:./test签名过程:随机数进行SHA256哈希后再使用私钥对其签名验签过程:用随机数的SHA256和公钥来验证签名以下代码是验证签名#include <iostream>#include <memory>#include <string>#include <sst原创 2021-10-16 09:22:05 · 811 阅读 · 0 评论 -
C++版本ECDSA-with-SHA256签名验证
由于项目需要验证签名,这里不做签名,只验签直接上代码:使用方法:openssl版本:1.0.2g 其他的自行验证编译:g++ x509.cpp -o x509 -lssl -lcrypto执行:./x509#include <openssl/pem.h>#include <openssl/x509.h>#include <openssl/x509v3.h>#include <cstring>#include <iostream>原创 2021-10-15 18:00:47 · 1297 阅读 · 0 评论 -
C语言openssl库的ECDSA-with-sha256签名和验签
1.直接上源码:#include <stdio.h>#include <string.h>#include <openssl/ecdsa.h>#include <openssl/pem.h>#include <openssl/err.h>// base64 编码char *base64_encode(const char *buffer, int length) { BIO *bmem = NULL; BIO *b6原创 2021-10-14 16:54:58 · 1797 阅读 · 0 评论