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)0×73, (byte)0×21, (byte)0×8c,
(byte)0×7e, (byte)0xc8, (byte)0xee, (byte)0×99};
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
Thank you for reading this post. You can now Read Comments (2) or Leave A Trackback.
Post Info
This entry was posted on Wednesday, April 9th, 2008 and is filed under Computer Science, Life.You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.
Previous Post: My Brand New Shoe »
Next Post: Bleach 106 Manga »












April 14th, 2008 16:12
interesting..
April 15th, 2008 09:09
thanks..