RSA属于不对称加密算法
特点:
加密和解密使用完全不同又完全匹配的一对公钥和私钥
-- RSA密钥产生
RSA * RSA_generate_key(int bits, unsigned long e, void (*callback) (int,int,void *),void *cb_arg);
-- RSA加密和解密
int RSA_public_encrypt(int flen, const unsigned char *from,unsigned char *to, RSA *rsa,int padding);
int RSA_private_decrypt(int flen, const unsigned char *from,unsigned char *to, RSA *rsa,int padding);
-- RSA签名和验证
RSA签名操作是把被签署消息的散列值编码后用私钥加密
int RSA_sign(int type, const unsigned char *m, unsigned int m_length, unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify(int type, const unsigned char *m, unsigned int m_length, unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
RSA * RSA_generate_key(int bits, unsigned long e, void (*callback) (int,int,void *),void *cb_arg);
-- RSA加密和解密
int RSA_public_encrypt(int flen, const unsigned char *from,unsigned char *to, RSA *rsa,int padding);
int RSA_private_decrypt(int flen, const unsigned char *from,unsigned char *to, RSA *rsa,int padding);
-- RSA签名和验证
RSA签名操作是把被签署消息的散列值编码后用私钥加密
int RSA_sign(int type, const unsigned char *m, unsigned int m_length, unsigned char *sigret, unsigned int *siglen, RSA *rsa);
int RSA_verify(int type, const unsigned char *m, unsigned int m_length, unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
本文介绍RSA非对称加密算法的基本概念,并通过一个具体的C语言实现案例展示如何生成RSA密钥对,进行数据的加密与解密过程。此外,还提供了RSA签名和验证的相关函数说明。
5485

被折叠的 条评论
为什么被折叠?



