易语言RSA加解密源码
系统结构:DLL调用生成RSA秘钥对,读整数,libeay32dll内存清理,是否质数,libeay_rsa加密解密,十六转字节集,字节集_十六进制_优化,写整数,子程序1,子程序2,CoInitialize,CoUninitialize,RSA_free,RSA_generate_key,BN_bn2hex,RSA_new,CRYPTO_cleanup_all_ex_data,Copy_rsa_Memory,BN_new,BN_hex2bn,RSA_size,RSA_public_encrypt,RSA_private_encrypt,RSA_public_decrypt,RSA_private_decrypt,CreateThread,创建许可证api,删除许可证api,进入许可区api,CloseHandle,退出许可区api,BN_free,SSL_library_int,
======程序集1
| |
| |------ _启动子程序
| |
| |------ _临时子程序
| |
| |
======DLLRSA程序集
| |
| |------ DLL调用生成RSA秘钥对
| |
| |------ 读整数
| |
| |------ libeay32dll内存清理
| |
| |------ 是否质数
| |
| |
======libeayrsa加解密程序集
| |
| |------ libeay_rsa加密解密
| |
| |------ 十六转字节集
| |
| |------ 字节集_十六进制_优化
| |
| |------ 写整数
| |
| |
======窗口程序集1
| |
| |------ _窗口1_创建完毕
| |
| |------ _按钮1_被单击
| |
| |------ _窗口1_将被销毁
| |
| |------ 子程序1
| |
| |------ _按钮2_被单击
| |
| |------ 子程序2
| |
| |------ _按钮3_被单击
| |
| |
======调用的Dll
| |
| |---[dll]------ CoInitialize
| |
| |---[dll]------ CoUninitialize
| |
| |---[dll]------ RSA_free
| |
| |---[dll]------ RSA_generate_key
| |
| |---[dll]------ BN_bn2hex
| |
| |---[dll]------ RSA_new
| |
| |---[dll]------ CRYPTO_cleanup_all_ex_data
| |
| |---[dll]------ Copy_rsa_Memory
| |
| |---[dll]------ BN_new
| |
| |---[dll]------ BN_hex2bn
| |
| |---[dll]------ RSA_size
| |
| |---[dll]------ RSA_public_encrypt
| |
| |---[dll]------ RSA_private_encrypt
| |
| |---[dll]------ RSA_public_decrypt
| |
| |---[dll]------ RSA_private_decrypt
| |
| |---[dll]------ CreateThread
| |
| |---[dll]------ 创建许可证api
| |
| |---[dll]------ 删除许可证api
| |
| |---[dll]------ 进入许可区api
| |
| |---[dll]------ CloseHandle
| |
| |---[dll]------ 退出许可区api
| |
| |---[dll]------ BN_free
| |
| |---[dll]------ SSL_library_int
调用的DLL命令:
.DLL命令 CoInitialize, , "ole32.dll", "CoInitialize", , ,
.参数 pvReserved, 整数型
.DLL命令 CoUninitialize, , "ole32.dll", "CoUninitialize"
.DLL命令 RSA_free, , ".\libeay32.dll", "@RSA_free"
.参数 rsa, 整数型
.DLL命令 RSA_generate_key, 整数型, ".\libeay32.dll", "@RSA_generate_key", , -------
.参数 num, , , 产生一个模为num位的密钥对
.参数 e, , , e为公开的加密指数
.参数 callback, , , 假如后两个参数不为NULL,将有些调用。在产生密钥对之前,一般需要指定随机数种子
.参数 null2
.DLL命令 BN_bn2hex, 文本型, ".\libeay32.dll", "@BN_bn2hex", , 十六进制文本
.参数 bn
.DLL命令 RSA_new, 整数型, ".\libeay32.dll", "@RSA_new"
.DLL命令 CRYPTO_cleanup_all_ex_data, 整数型, ".\libeay32.dll", "@CRYPTO_cleanup_all_ex_data"
.DLL命令 Copy_rsa_Memory, , , "RtlMoveMemory"
.参数 Destination, RSA, , 要复制内存块的目的地址
.参数 Source, 整数型, , 要复制内存块的源地址
.参数 Length, 整数型, , 指定要复制内存块的大小,单位为字节
.DLL命令 BN_new, 整数型, ".\libeay32.dll", "@BN_new"
.DLL命令 BN_hex2bn, 整数型, ".\libeay32.dll", "@BN_hex2bn", , int BN_hex2bn(BIGNUM **a, const char *str);
.参数 bignum, 整数型, 传址
.参数 str, 文本型, 传址
.DLL命令 RSA_size, 整数型, ".\libeay32.dll", "@RSA_size", , 返回RSA模的位数,他用来判断需要给加密值分配空间的大小
.参数 rsa, RSA, 传址
.DLL命令 RSA_public_encrypt, 整数型, ".\libeay32.dll", "@RSA_public_encrypt", , int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa,int padding);
.参数 flen, 整数型
.参数 from, 字节集, 传址
.参数 to, 字节集, 传址
.参数 rsa, RSA, 传址
.参数 padding, 整数型
.DLL命令 RSA_private_encrypt, 整数型, ".\libeay32.dll", "@RSA_private_encrypt", , int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa,int padding);
.参数 flen, 整数型
.参数 from, 字节集, 传址
.参数 to, 字节集, 传址
.参数 rsa, RSA, 传址
.参数 padding, 整数型
.DLL命令 RSA_public_decrypt, 整数型, ".\libeay32.dll", "@RSA_public_decrypt", , int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa,int padding);
.参数 flen, 整数型
.参数 from, 字节集, 传址
.参数 to, 字节集, 传址
.参数 rsa, RSA, 传址
.参数 padding, 整数型
.DLL命令 RSA_private_decrypt, 整数型, ".\libeay32.dll", "@RSA_private_decrypt", , int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, RSA *rsa,int padding);
.参数 flen, 整数型
.参数 from, 字节集, 传址
.参数 to, 字节集, 传址
.参数 rsa, RSA, 传址
.参数 padding, 整数型
.DLL命令 CreateThread, 整数型, "kernel32.dll", "CreateThread"
.参数 lpThreadAttributes, 整数型
.参数 dwStackSize, 整数型
.参数 lpStartAddress, 子程序指针
.参数 lpParameter, 整数型
.参数 dwCreationFlags, 整数型
.参数 lpThreadId, 整数型, 传址
.DLL命令 创建许可证api, , "kernel32", "InitializeCriticalSection", , 创建许可证
.参数 lpCriticalSection, 许可证数据类型, 传址
.DLL命令 删除许可证api, , "kernel32", "DeleteCriticalSection", , 删除许可证
.参数 lpCriticalSection, 许可证数据类型, 传址
.DLL命令 进入许可区api, , "kernel32", "EnterCriticalSection", , 进入许可区
.参数 lpCriticalSection, 许可证数据类型, 传址
.DLL命令 CloseHandle, 整数型, , "CloseHandle"
.参数 hObject, 整数型
.DLL命令 退出许可区api, , "kernel32", "LeaveCriticalSection", , 退出许可区
.参数 lpCriticalSection, 许可证数据类型, 传址
.DLL命令 BN_free, , ".\libeay32.dll", "@BN_free"
.参数 bignum
.DLL命令 SSL_library_int, 整数型, ".\libeay32.dll", "@SSL_library_int"
注:本站源码主要来源于网络收集。如有侵犯您的利益,请联系我们,我们将及时删除!
部分源码可能含有危险代码,(如关机、格式化磁盘等),请看清代码在运行。
由此产生的一切后果本站均不负责。源码仅用于学习使用,如需运用到商业场景请咨询原作者。
使用本站源码开发的产品均与本站无任何关系,请大家遵守国家相关法律。