crypto api和.net的rsa互通性分析
来源:互联网 发布:淘宝网苹果版下载安装 编辑:程序博客网 时间:2024/06/01 19:02
crypto api和.net的rsa加密解密不能互通,实在想不通。
最初以为是padding不一致的问题,例如PKCS#1 1.5还是OAEP 。最后微软网站上看到了答案,原来.net自己偷偷对数据进行了翻转!
怪不得rsa不通呢,原来其他接口的数据,到这里数据还需要翻转啊!
.net上的说明:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.rsacryptoserviceprovider.aspx
The RSACryptoServiceProvider supports key lengths from 384 bits to 16384 bits in increments of 8 bits if you have the Microsoft Enhanced Cryptographic Provider installed. It supports key lengths from 384 bits to 512 bits in increments of 8 bits if you have the Microsoft Base Cryptographic Provider installed.
Interoperation with the Microsoft Cryptographic API (CAPI)
Unlike the RSA implementation in unmanaged CAPI, the RSACryptoServiceProvider class reverses the order of an encrypted array of bytes after encryption and before decryption. By default, data encrypted by the RSACryptoServiceProvider class cannot be decrypted by the CAPI CryptDecrypt function and data encrypted by the CAPI CryptEncrypt method cannot be decrypted by the RSACryptoServiceProvider class.
If you do not compensate for the reverse ordering when interoperating between APIs, the RSACryptoServiceProvider class throws a CryptographicException.
To interoperate with CAPI, you must manually reverse the order of encrypted bytes before the encrypted data interoperates with another API. You can easily reverse the order of a managed byte array by calling the Array..::.Reverse method.
- crypto api和.net的rsa互通性分析
- .NET和java的RSA互通,仅此而已
- NET和java的RSA互通,仅此而已
- 和NET互通的RSA加密算法
- Java和.net加密解密互通RSA
- Android 与 .net 互通的RSA加密
- Android 与 .net 互通的RSA加密
- C# RSA和Java RSA互通
- php 和 java RSA 对称加密互通的问题
- 基于crypto++的RSA加密
- 和OpenCV1的互通性
- java和php实现RSA加密互通
- php和java之间rsa加密互通
- Android平台和java平台 DES、3DES、RSA加密解密互通程序及其不能互通的原因
- 自己封装Crypto++的RSA类
- 使用crypto api的签名和验证签名源代码
- C#和Java实现互通的RSA&DES加解密算法(一)
- C#和Java实现互通的RSA&DES加解密算法(二)
- linux最常用的60个命令
- 如何读取JAR包中的资源文件(如XML、TXT等)
- ASP函数库
- javascript form submit的问题
- 矩阵理解
- crypto api和.net的rsa互通性分析
- 优秀程序员的十个习惯
- Meta Data
- 解决Eclipse下使用ANT编译提示OutOfMemory
- Java开发WebService实例--计数器
- 给TabControl的Page添加个关闭按钮
- 芯片封装介绍
- 文件系统FAT32转换为NTFS
- 关于session