摘要:此代码不涉及ECB和CBC等关联加密 #include #include #include #include #include #pragma comment(lib, "libeay32.lib") #pragma comment(lib, "ssleay32.lib...
阅读全文
摘要:准备工作 命令行加密解密,用与比对代码中的算法和命令行的算法是否一致 C:\openssl_test>openssl rsautl -encrypt -in data.txt -inkey public.pem -pubin -out data.en C:\openssl_test>opens...
阅读全文
摘要:准备工作 生成私钥文件(里面已包含公钥) openssl genrsa -out private.pem 1024 从私钥文件中提取公钥 openssl rsa -in private.pem -pubout -out public.pem 如果用 openssl rsa -in pr...
阅读全文
摘要:#include #include #include #include #include #include int main(int argc, char *argv[]){ // 产生RSA密钥对 RSA *rsaKey = RSA_generate_key(1024, 65537, NU...
阅读全文
摘要:作为非对称加密算法,有两对密钥 一般用法 加密结果=RSA_EN(数据,公钥); 解密结果=RSA_DE(数据,私钥); RSA填充 (RSA_public_encrypt和RSA_private_decrypt自动完成,不用操心,这里只做些说明) RSA也是对数据分块处理,一般有...
阅读全文
摘要:centos平台 md5.c #include #include #include //#include "../e_os.h"#include #include static char *hex2str(unsigned char *md){ int i; static c...
阅读全文
摘要:arm平台 ubuntu Linux xxxxxx 3.0.62 #2 PREEMPT Tue Apr 2 20:14:12 CST 2013 armv7l armv7l armv7l GNU/Linux 下载最新版openssl-1.1.0b编译不过 后来下载 openssl-1.0.2g才行 .
阅读全文