I am using a Cipher for encryption/decryption. It has always been fine, but now I am having problem when dealing with large array bytes.
This is my implementation:
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
cipher.init(Cipher.ENCRYPT_MODE, getSecretKey())
val encryptedData = cipher.doFinal(textToEncrypt.toByteArray(StandardCharsets.UTF_8))
As said the problem happens only if the input text is too big. For example, if I pass as input of the doFinal a byte array of length 168036, it will give me back an array of byte, of length 65652.
Is this related with a limitation of the Cipher? If so, is there a way for increasing the input buffer?
