Package net.lingala.zip4j.crypto
Class AESEncrypter
java.lang.Object
net.lingala.zip4j.crypto.AESEncrypter
- All Implemented Interfaces:
Encrypter
AES Encrypter supports AE-1 and AE-2 encryption using AES-CTR with either 128 or 256 Key Strength
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AESEngine
private final byte[]
private byte[]
private boolean
private final byte[]
private int
private MacBasedPRF
private int
private final SecureRandom
private byte[]
-
Constructor Summary
ConstructorsConstructorDescriptionAESEncrypter
(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword) -
Method Summary
Modifier and TypeMethodDescriptionint
encryptData
(byte[] buff) int
encryptData
(byte[] buff, int start, int len) private byte[]
generateSalt
(int size) byte[]
byte[]
byte[]
private void
init
(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword)
-
Field Details
-
aesEngine
-
mac
-
random
-
finished
private boolean finished -
nonce
private int nonce -
loopCount
private int loopCount -
iv
private final byte[] iv -
counterBlock
private final byte[] counterBlock -
derivedPasswordVerifier
private byte[] derivedPasswordVerifier -
saltBytes
private byte[] saltBytes
-
-
Constructor Details
-
AESEncrypter
public AESEncrypter(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword) throws ZipException - Throws:
ZipException
-
-
Method Details
-
init
private void init(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword) throws ZipException - Throws:
ZipException
-
encryptData
- Specified by:
encryptData
in interfaceEncrypter
- Throws:
ZipException
-
encryptData
- Specified by:
encryptData
in interfaceEncrypter
- Throws:
ZipException
-
generateSalt
- Throws:
ZipException
-
getFinalMac
public byte[] getFinalMac() -
getDerivedPasswordVerifier
public byte[] getDerivedPasswordVerifier() -
getSaltBytes
public byte[] getSaltBytes()
-