java.io.Closeable, java.lang.AutoCloseable, Configurable@Private public class JceAesCtrCryptoCodec extends JceCtrCryptoCodec
JceCtrCryptoCodec.JceCtrCipher| Constructor | Description |
|---|---|
JceAesCtrCryptoCodec() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
calculateIV(byte[] initIV,
long counter,
byte[] iv) |
This interface is only for Counter (CTR) mode.
|
Decryptor |
createDecryptor() |
Create a
Decryptor. |
Encryptor |
createEncryptor() |
Create a
Encryptor. |
CipherSuite |
getCipherSuite() |
|
org.slf4j.Logger |
getLogger() |
calculateIV, close, generateSecureRandom, getConf, getProvider, setConf, setProvidergetInstance, getInstancepublic org.slf4j.Logger getLogger()
getLogger in class JceCtrCryptoCodecpublic CipherSuite getCipherSuite()
getCipherSuite in class CryptoCodecpublic void calculateIV(byte[] initIV,
long counter,
byte[] iv)
CryptoCodecCipher will maintain its encryption
context internally when we do encryption/decryption using the
Cipher#update interface.
Encryption/Decryption is not always on the entire file. For example, in Hadoop, a node may only decrypt a portion of a file (i.e. a split). In these situations, the counter is derived from the file position.
The IV can be calculated by combining the initial IV and the counter with a lossless operation (concatenation, addition, or XOR). See http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_ .28CTR.29
calculateIV in class CryptoCodecinitIV - initial IVcounter - counter for input stream positioniv - the IV for input stream positionpublic Encryptor createEncryptor() throws java.security.GeneralSecurityException
CryptoCodecEncryptor.createEncryptor in class CryptoCodecjava.security.GeneralSecurityException - thrown if create encryptor error.public Decryptor createDecryptor() throws java.security.GeneralSecurityException
CryptoCodecDecryptor.createDecryptor in class CryptoCodecjava.security.GeneralSecurityException - thrown if create decryptor error.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.