Below is an example of how I am encrypting text in java, although the encryption works. I can't seem to figure out how I can modify the level of encryption i.e 128, 256, 512 etc.
Code:
byte keySelectedByUser[] = selectedKey.getBytes();
SecretKeySpec secretKey = new SecretKeySpec(keySelectedByUser, "AES");
Cipher cipher;
cipher = Cipher.getInstance("AES/CBC/PKCS7PADDING");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
byte[] encrypted = cipher.doFinal(stringToEncrypt.getBytes());
How can I do this in java?