开发者

How to implement IDEA?

I have to make an application which c开发者_Go百科an encrypt and decrypt a text file using IDEA (International Data Encryption Algorithm) in Java or C#. I know that in Java there is an inbuilt JCE (Java Cryptography Extension) but how do I proceed further, will anybody please give me some suggestions?


Can't comment for whatever reason, so I am posting this as a reply.

IDEA is a patented algorithm and patents expire only in 2011 and 2012 (depending on the country). Also it's not best-performing at all. So unless you have a requirement to use IDEA, I'd suggest looking at AES or RC4 (ARCFOUR, as RC4 name is a registered trademark) algorithms. RC4 is faster, but heavily depends on quality of the encryption key.


Eugene is right regarding IDEA. If it is under your choice, it would be reasonable to avoid using IDEA and choose some other algorithm. Due to the patent issues, IDEA is used quite rarely and thus it is less investigated by the cryptanalysts. Besides, the length of IDEA key is restricted with 128 bits that is likely to become insufficient relatively soon.

Most of (not to say absolutely all) development frameworks include support for standard cryptographic algorithms. As a matter of fact, it is always good to use standardized algorithms, as they are best-studied by the cryptanalysts. AES128/256 is a preferred choice. The maximal lenth of RC4 key, as well as IDEA key, is 128 bits; besides, it is also a kind of exotic and may be unsupported by some frameworks.


You could try to use BouncyCastle, which is available for Java and C#. However, you'll need to get the right jars (assuming Java) for IDEA support, according to this note:

From release 1.40 the implementation of the IDEA encryption algorithm was removed from the regular jar files at the request of a number of users. Jars with names of the form -ext- still include the IDEA implementation.

EDIT (added pointer to example): I haven't tried, but I think that the DESExample could be adapted to do what you want, probably by replacing the DESedeEngine with am IDEAEngine (and similar for other classes).


By 2012 the IDEA patents have expired.

I have written a clean open-source Java implementation of IDEA.

Names of the files of the source code contents:

Idea.java                 The main IDEA encryption module
IdeaFileEncryption.java   Encrypts or decrypts a file with IDEA
IdeaCmd.java              Command-line interface for encrypting/decrypting files
TestIdeaVectors.java      A test program that verifies this implementation against 
                          the test vectors published in 1999
TestIdeaMath.java         A test program for some of the math functions used in 
                          the IDEA modules

Trust this Algorithm as much as you trust its Author.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜