davsclaus opened a new pull request, #3247: URL: https://github.com/apache/camel-kamelets/pull/3247
Fixes #3246. With `algorithm: AES` the crypto actions encrypt in ECB mode (the Java default for the name alone), and a full transformation such as `AES/CBC/PKCS5Padding` fails because the same value also names the secret key. So the same text always gave the same bytes, and there was no way to pick another mode. ## Changes - A new optional `mode` option on `crypto-encrypt-action` and `crypto-decrypt-action`. With `mode: CBC` the transformation is `<algorithm>/CBC/PKCS5Padding`, and the crypto data format puts a new random initialization vector in front of each message (`inline: true`), which the decrypt action reads back. - Without `mode` the actions work as before, so data encrypted by earlier versions still decrypts. The descriptions say that `AES` alone is ECB and recommend `mode: CBC`, set on both actions at the same time. - GCM is not offered: the crypto data format passes the vector as an `IvParameterSpec`, which GCM does not take. ## Tests - `CryptoKameletsTest`: with `mode=CBC` (AES and DESede) two encryptions of the same text differ and both decrypt; without `mode` the output is the same as before (ECB) and decrypts. - `./mvnw clean install` passes. _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
