Package net.lingala.zip4j.crypto
Class AESEncrypter
- java.lang.Object
-
- net.lingala.zip4j.crypto.AESEncrypter
-
-
Field Summary
Fields Modifier and Type Field Description private AESEngine
aesEngine
private byte[]
counterBlock
private byte[]
derivedPasswordVerifier
private boolean
finished
private byte[]
iv
private int
loopCount
private MacBasedPRF
mac
private int
nonce
private java.security.SecureRandom
random
private byte[]
saltBytes
-
Constructor Summary
Constructors Constructor Description AESEncrypter(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
encryptData(byte[] buff)
int
encryptData(byte[] buff, int start, int len)
private byte[]
generateSalt(int size)
byte[]
getDerivedPasswordVerifier()
byte[]
getFinalMac()
byte[]
getSaltBytes()
private void
init(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword)
-
-
-
Field Detail
-
aesEngine
private AESEngine aesEngine
-
mac
private MacBasedPRF mac
-
random
private final java.security.SecureRandom 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 Detail
-
AESEncrypter
public AESEncrypter(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword) throws ZipException
- Throws:
ZipException
-
-
Method Detail
-
init
private void init(char[] password, AesKeyStrength aesKeyStrength, boolean useUtf8ForPassword) throws ZipException
- Throws:
ZipException
-
encryptData
public int encryptData(byte[] buff) throws ZipException
- Specified by:
encryptData
in interfaceEncrypter
- Throws:
ZipException
-
encryptData
public int encryptData(byte[] buff, int start, int len) throws ZipException
- Specified by:
encryptData
in interfaceEncrypter
- Throws:
ZipException
-
generateSalt
private byte[] generateSalt(int size) throws ZipException
- Throws:
ZipException
-
getFinalMac
public byte[] getFinalMac()
-
getDerivedPasswordVerifier
public byte[] getDerivedPasswordVerifier()
-
getSaltBytes
public byte[] getSaltBytes()
-
-