enapps-enorman opened a new pull request, #21:
URL: https://github.com/apache/sling-org-apache-sling-discovery-base/pull/21

   The issue with SonarQube's "Encryption algorithms should be used with secure 
mode and padding scheme" warning is actually about using insecure cipher modes 
and padding.
   
   Here is the proposed changes (as proposed by copilot):
   
   1. Switch from AES/CBC to AES/GCM - GCM (Galois/Counter Mode) is 
authenticated encryption that provides both confidentiality and integrity 
protection in a single operation, eliminating padding oracle vulnerabilities.
   2. Removed PKCS5Padding - PKCS5Padding is vulnerable to padding oracle 
attacks. GCM uses "NoPadding" since it's a stream cipher mode.
   3. Increased key size to 256-bit - Stronger cryptographic key for AES.
   4. Updated nonce handling - GCM uses a 12-byte nonce (IV) instead of a salt, 
which is the standard practice.
   5. Simplified payload structure - GCM automatically handles the 
authentication tag, so we only need to transmit the nonce and ciphertext.
   
   This approach satisfies SonarQube's requirements by using a secure cipher 
mode (GCM) with proper cryptographic standards, while eliminating the padding 
scheme vulnerability that was causing the warning.


-- 
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]

Reply via email to