In an android project I am using
import javax.crypto.Cipher;
ecipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
I would like to ask: Whether AES128 or AES256 is used, is defined by the key that is used? For example key="012345678901234567890123456789012"; would have as a result AES256 to be used?
thanks
Thomas
Yes whether AES128 or AES256 is used is defined by the key that is in use.
However it’s not the
Stringlength but thebyte[]length that determines it. At some point in your code you should be convertingStringtobyte[]. The size of resulting thatbyte[]is your key size. Without knowing how you convert"012345678901234567890123456789012", it’s not possible to know your encryption strength.Alternatively you can use
KeyGenerator: