摘要: 1.直接上源码: #include <stdio.h> #include <string.h> #include <openssl/ecdsa.h> #include <openssl/pem.h> #include <openssl/err.h> // base64 编码 char *base64 阅读全文
posted @ 2021-10-18 18:01 hackettt 阅读(537) 评论(0) 推荐(0) 编辑
摘要: 这里不做签名,只验签 使用方法: openssl版本:1.0.2g 其他的自行验证 编译:g++ test.cpp -o test -lssl -lcrypto -std=c++11 执行:./test 签名过程:随机数进行SHA256哈希后再使用私钥对其签名 验签过程:用随机数的SHA256和公钥 阅读全文
posted @ 2021-10-18 18:00 hackettt 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 由于项目需要验证签名,这里不做签名,只验签 直接上代码: 使用方法: openssl版本:1.0.2g 其他的自行验证 编译:g++ x509.cpp -o x509 -lssl -lcrypto 执行:./x509 #include <openssl/pem.h> #include <openss 阅读全文
posted @ 2021-10-18 18:00 hackettt 阅读(101) 评论(0) 推荐(0) 编辑
摘要: openssl aes-128-ecb方式对密码进行md5后的加解密 openssl版本:1.0.2g 其他的自行验证 编译:gcc aes_128_ecb.c -o aes_128_ecb -lssl -lcrypto 执行结果: ./aes_128_ecb passwd: 12345 strMd 阅读全文
posted @ 2021-10-18 17:59 hackettt 阅读(704) 评论(0) 推荐(0) 编辑