-2

We have to implement the DES algorithm. We want to code some functions, but we don't know how to test our DES algorithm.

Are there any well-known tools/libraries that we can use to test our encrypting and decrypting functions? We need a 3rd party tool to tell people that our version really works.

4

2 回答 2

3

我假设您将 DES 用作 3DES 的一部分,对于 3DES,美国国家标准与技术研究院 (NIST) 发布了大量可用于验证您的实现的测试向量:

http://csrc.nist.gov/groups/STM/cavp/index.html

此外,您可以测试与其他已知库(例如 OpenSSL)的互操作性(加密/解密)。如果加密的密文和解密的明文相同,则您的实现正确的可能性很高。

于 2012-05-08T07:54:33.937 回答
-1

Java 实现了很多安全算法: http ://www.oracle.com/technetwork/java/javase/tech/index-jsp-136007.html

Cipher desCipher = Cipher.getInstance("DES/CBC/NoPadding");
DESKeySpec desSpec = new DESKeySpec(desKey);
SecretKey des = SecretKeyFactory.getInstance("DES").generateSecret(desSpec);
desCipher.init(Cipher.ENCRYPT_MODE, des , ivSpec);
于 2012-05-08T13:37:53.243 回答