i need to create an application in java that would convert text strings into codes based on 128bit AES encryption.. ideally i would prefer that i only need to create a gui and the AES encryption part is already written. the application is need to be run in both linux and windows . kindly advice me on existing libraries and anything related. i am not an expert programmer so im asking this advice to gain confidence on the subject.
+2
A:
This should get your started... http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html
TofuBeer
2009-11-18 07:32:55
A:
In case it's useful, I put some stuff on the web about AES encryption in Java, including example encryption/decryption code (actually, the code is essentially similar for other algorithms).
Things that typically trip people up:
- if you're generating random keys (well, actually in any case, random or not), you need to do it appropriately (see the SecureRandom class, for example)
- the basic encryption works on arrays of bytes; when converting strings to and from bytes (the String.getBytes() method and the String constructor that takes a byte array), you need to pick a character encoding that will preserve all the characters you will use (if you're not sure, probably start with "UTF-8")
- by default, the AES Cipher actually runs in a mode that is insecure (though if this is a homework project it might not matter); read up on block modes for more informtation.
Neil Coffey
2009-11-18 08:55:13