English 中文(简体)
NET与Java之间的模拟加密
原标题:Symmetric Encryption between .NET and Java

我正在利用第3个政党平台建立一个着陆页,这是我使用这一特定平台的商业要求。

在其网页上,我可以加密数据,在把资源放在我的网站上时通过请求参数将其发送到我的服务器。 这是通过AES测量加密进行的。

我需要具体说明密码、盐类(必须具有超值)和初始化病媒(但为16种特性)。

他们的支持是一个网络平台。 我知道这一点,因为如果我具体说明比预期的例外情况更长的四级是:

System.Security.Cryptography.CryptographicException: Specified initialization vector (IV) does not match the block size for this algorithm. Source: mscorlib

例如,在结束发言时,我具体指出:

EncodeSymmet(“Hello World”,AES”,“P4sw0rD”,“0001020304050607090A0B0C0D0E0F”

如果投入是:平原案文、算法、通行短语、盐和四。

页: 1

如果我最后利用JCE或BouncyCastle提供商I(同algo, 绕行语,盐和安放;四,有1,000个座标):2rrRdHwpKGRenw8HKG1dsA= 这完全不同。

我在网上研究了许多不同的 Java例子,说明如何加密AES。 其中一个例子是:

How can I decrypt a AES Symmetric Encryption that uses a pass phrase, salt and IV, which was generated by the .NET framework on a Java platform?

如果我能够在java一侧产生同样的签字并进行比较,我不一定需要能够使加密中的内容脱颖(如果它转而这里实际产生的东西是一 has)。

I m using JDK 1.5 in production so I need to use 1.5 to do this.

作为附带说明, Java的许多例子需要具体说明 j方的重复计算,但不包括 。 NET一面。 是否有标准数量的频率,我需要在 j瓦方面说明与违约相符的情况。 NET输出。

最佳回答

所有这些都取决于如何使用加密的不同部分/标记。

AES被用于加密。 因此,你需要将体力转换成一个星体。 因此,你们需要知道用来改变雕像的编码。 (UTF7, UTF8, ......)。

AES的关键部分是固定面积。 因此,你们需要知道,如何从斜体到正确轨道的AES钥匙。

由于你提供食盐和四类,因此我食用的盐不是四类。 网上没有处理盐类的标准方法。 就我所知,盐类主要用来保护人们免受雨果表和 has的影响。 我不了解阿片礁中盐碱的必要性。

Maybe the passphrase is hashed (you did not provide the method for that) with the salt to get an AES key.

第四部分并非秘密。 最容易的方法是将加密数据与四分五裂。 参看加密数据长度,情况并非如此。

I don t think your unfamiliarity of .Net is the problem here. You need to know what decisions the implementer of the encryption made, to come from your parameters to the encrypted string.

问题回答

As far as I can see, it is the iteration count which is causing the issue. With all things the same (salt,IV,iterations), the .Net implementation generates the same output as the Java implementation. I think you may need to ask the 3rd party what iterations they are using





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签