File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes AES encryption algorithm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "AES encryption algorithm" Watch "AES encryption algorithm" New topic
Author

AES encryption algorithm

Nitin D Gaur
Greenhorn

Joined: Jul 04, 2008
Posts: 10
Hi all,

Have been trying to get AES encryption and decryption algorithm, in which I can pass the security password as encryption key.

It can be done using



but the thing in here I can not pass my pwn password as encryption key, instead it uses key generated by keygenerator.



Can any body help to give any AES encryption and decryption algorithm, in which a key can be passed.

Nitin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
If you don't want a generated key, then don't use the KeyGenerator class :-)

Construct a SecretKeySpec instead, and pass that to the Cipher.init method. If the byte[] is of length 16 you'll get AES-128, if its's of length 32 then AES-256 will be used (assuming your JCE provider supports that).


Ping & DNS - my free Android networking tools app
 
wood burning stoves
 
subject: AES encryption algorithm
 
Similar Threads
Crypting text with Java and salt
Blowfish Encryption Using Jakarta Commons Codec 1.2
error coming while decrypting...
need help abt 64 encoder/decoder
How to use AES DECRYPT_MODE?