-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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
user1072898
  • 475
  • 2
  • 7
  • 9
  • The fact that you need a '3rd party tool' in order to 'tell people that our version really works', sounds like you are involved in a company developing some sort of product. In this case either A) The product you are making involves but is not limited to crypto, in which case you should be using an existing, trusted, library (of which there are many available), or B) The product is a crypto product, in which case I think many people would say you emphatically _should not_ use DES. Not only are more modern ciphers more secure, but also faster on modern hardware. –  May 08 '12 at 09:18

2 Answers2

3

I assume that you are using DES as part of 3DES and for 3DES the National Institute of Standards and Technology (NIST) has published a large number of test vectors that can be used for verifying your implementation:

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

Additionally you can test interoperability (encryption/decryption) with other known libraries such as OpenSSL. If the encrypted ciphertext respectively decrypted plaintext is identically the possibility that your implementation is correct is high.

Robert
  • 39,162
  • 17
  • 99
  • 152
-1

Java has a lot of security algorithms implemented: 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);
rik
  • 156
  • 1
  • 7