Showing posts with label triple des. Show all posts
Showing posts with label triple des. Show all posts

Wednesday, April 9, 2008

Triple DES : JAVA coding

As my final year project are done, i would like to share some coding that i use. Before this i have post on DES, now i am sharing with you all on triple DES. In the name of open source..

Triple DES is also known as TDES or, more standard, TDEA (Triple Data Encryption Algorithm). The convention to use DES (the standard) when DEA (the algorithm) is intended is so widespread that in order to avoid confusion the term DES is used throughout this article. On the other hand, since there are variations of TDES which use two different keys (2TDES, officially 2TDEA) and three different keys (3TDES, officially 3TDEA) the non-standard abbreviation 3DES is confusing and should be avoided. [source : wikipedia]

3DES are just like DES but it used two or three different keys. The key size is at least 56 times two equal 112 bits. The DES algorithm use 56 bits as for 3DES, it use 112 bits (56 + 56) or 168 bits(56 +56 +56).
byte[] salt = {
(byte)0xc7, (byte)0x73, (byte)0x21, (byte)0x8c,
(byte)0x7e, (byte)0xc8, (byte)0xee, (byte)0x99

};

IvParameterSpec iv = new IvParameterSpec(salt);

byte[] raw = pass.getBytes(); //get byte of the password
SecretKeySpec skeySpec = new SecretKeySpec(raw, "DESede");

Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec , iv );

Take note that the pass is the variable for password. If you got something to ask, feel free to post a comment.

Peace upon you all

Monday, February 18, 2008

JAVA : Triple DES or DESede Algorithm

3DES3DES or Triple DES or DESede are well known encryption algorithm which are the "child" of DES(Data Encryption Standard). Although it was replace by AES (Advance Encryption Standard) still there are some people like me studies this old thing.

Triple DES is part of my final year project. I asked my lecturer if i perform DES three times, is it same like Triple DES. The answer is NO because Triple DES use different keys.

The keys use is 56 bit. I just finished a simple JAVA application on Triple DES. The application receive input and password from user. Then display the output which the user can choose between encrypt or decrypt.

If you want to try my newly developed JAVA application, you can download it here. If you want the sample of the code?!Please contact me at n a w u z a at g m a i l . c o m.


sample DES




Above is the screen shot of my JAVA application.