-2

I've never used encryption algorithms before and i don't know how to do so. I have a hex string of length=32 that i want to encrypt and then decrypt with 3des or aes256.I also have the key to use, that is in hex format too, but it's length varies. Is someone familiar with this and/or has code for this implementation? I've found some codes here, but i don't exactly understand the implementation and the difference when hex values are used.

Jerry9912
  • 5
  • 3
  • possible duplicate of [Java 256-bit AES Password-Based Encryption](http://stackoverflow.com/questions/992019/java-256-bit-aes-password-based-encryption) – JFPicard Aug 05 '15 at 15:12

1 Answers1

0

Firstly AES does not encrypt using a 256 bit keyspace, they downsized it to 128 bit, but rijndahl does. If you do go with rijndahl, remember to use a 32 byte key (32 characters) and a 32 byte blockcipher. I would recommend using the GNU implementation which can be found here: http://www.gnu.org/software/gnu-crypto/

I hope this helps.

Anders
  • 1
  • 2
  • (1) AES works on a fixed blocksize of 128-bit, but accepts keys of 128, 192 or 256-bit. (2) If you recommend a library, you should show how it can be used. It would be better if you would add a proper answer to the [linked question](http://stackoverflow.com/questions/992019/java-256-bit-aes-password-based-encryption) instead of this one. – Artjom B. Aug 05 '15 at 15:37