Hi Experts,
I am using following Groovy script in Integration Suite to encrypt the payload but getting numeric output in bytes.
Could you please advise or review the code ?
def Message processData(Message message) { def body = message.getBody(String); String ALGORITHM = "AES/CBC/PKCS5Padding"; String key ="86dh577a8h0a402eed195f7f1798850d"; Cipher cipher = Cipher.getInstance(ALGORITHM); byte[] messageArr = body.getBytes(); byte[] keyparam=key.getBytes(); SecretKeySpec keySpec = new SecretKeySpec(keyparam, "AES"); byte[] ivParams = new byte[16]; byte[] encoded = new byte[messageArr.length + 16]; System.arraycopy(ivParams,0,encoded,0,16); System.arraycopy(messageArr, 0, encoded, 16, messageArr.length); cipher.init(Cipher.ENCRYPT_MODE, keySpec, new IvParameterSpec(ivParams)); byte[] encryptedBytes = cipher.doFinal(encoded); encryptedB = Base64.getEncoder().encode(encryptedBytes); def encryptString = encryptedB.toString(); message.setBody(encryptString); return message;