You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2023/02/27 23:34:07 UTC
[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6939: NIFI-11161 Simplify KeyedCipherPropertyEncryptor
exceptionfactory commented on code in PR #6939:
URL: https://github.com/apache/nifi/pull/6939#discussion_r1119423078
##########
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";
Review Comment:
That's a good question. Theoretically, all the values should be the same across the board, but we would need to implement this in a way that avoid introducing unnecessary dependencies. There is other work to do for removing support for deprecated legacy algorithms. That might be an opportunity for consolidation.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org