Java AES encryption similar to aesCryptoServiceProvider -


well want generate aes key using java , mentioned specification based on ".net" utility need follow while generating key in java program

specification: "generate aes key using aescryptoserviceprovider mode = ecb, padding = pkcs7, keysize = 256 & blocksize = 128."

i researched lot didn't similar things can used in java generate aes key.

can please guide me how move ahead same create aes key above specification mentioned?

for aes key either use random bytes obtained csprng or derive key passphrase pbkfd2.

do not use ecb mode in new work , update legacy work asap, not secure, see ecb mode, scroll down penguin. instead use cbc mode random iv, prefix encrypted data iv use in decryption, not need secret.

notes:

the java base implementation limits key size 128-bits (which secure), in order use larger key need have use java cryptography extension:
java 6 jre, java 7 jre, java 8 jre
(thanks robert versions info , links!)

aes has 1 block size: 128-bits.

for java see documentation java cryptography architecture reference guide , in particular the cipher class.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -