Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Decrypting with AES

843811Jan 25 2010 — edited Jan 27 2010
Hi!!
I have to decrypt a PIN code to be able to print it. I'm receiving a file which contains the encrypted file and I suppose that it will also contain the key used to encrypt/decrypt.
Will it work with the following code?
Cipher cip = Cipher.getInstance("AES") ;
cip.init(Cipher.DECRYPT_MODE,KEY_FOR_ENCRYPTING/DECRYPTING);
decryptMessage = cip.doFinal(ENCRYPTED_PIN_CODE);
decryptString = decryptMessage.toString(); 
decryptString will contain the decrypted PIN CODE???

Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 24 2010
Added on Jan 25 2010
6 comments
341 views