exceptionfactory commented on code in PR #6939:
URL: https://github.com/apache/nifi/pull/6939#discussion_r1119424370


##########
nifi-commons/nifi-property-encryptor/src/main/java/org/apache/nifi/encrypt/KeyedCipherPropertyEncryptor.java:
##########
@@ -16,47 +16,36 @@
  */
 package org.apache.nifi.encrypt;
 
-import org.apache.nifi.security.util.EncryptionMethod;
-import org.apache.nifi.security.util.crypto.KeyedCipherProvider;
-
 import javax.crypto.Cipher;
 import javax.crypto.SecretKey;
+import javax.crypto.spec.GCMParameterSpec;
 import java.security.SecureRandom;
 import java.util.Arrays;
 import java.util.Objects;
 
 /**
- * Property Encryptor implementation using Keyed Cipher Provider
+ * Property Encryptor implementation using AES-GCM
  */
 class KeyedCipherPropertyEncryptor extends CipherPropertyEncryptor {
     private static final int INITIALIZATION_VECTOR_LENGTH = 16;
 
-    private static final int ARRAY_START = 0;
-
-    private static final boolean ENCRYPT = true;
+    private static final int GCM_TAG_LENGTH_BITS = 128;
 
-    private static final boolean DECRYPT = false;
-
-    private final KeyedCipherProvider cipherProvider;
+    private static final int ARRAY_START = 0;
 
-    private final EncryptionMethod encryptionMethod;
+    private static final String CIPHER_ALGORITHM = "AES/GCM/NoPadding";
 
     private final SecretKey secretKey;
 
     private final SecureRandom secureRandom;
 
     private final String description;
 
-    protected KeyedCipherPropertyEncryptor(final KeyedCipherProvider 
cipherProvider,
-                                           final EncryptionMethod 
encryptionMethod,
-                                           final SecretKey secretKey) {
-        this.cipherProvider = cipherProvider;
-        this.encryptionMethod = encryptionMethod;
+    protected KeyedCipherPropertyEncryptor(final SecretKey secretKey) {

Review Comment:
   Yes, `AES/GCM/NoPadding` is the current value for all instances of the 
`KeyedCipherProvider`, so this change does not impact compatibility with 
existing AES-GCM sensitive property algorithms.



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