Package net.lingala.zip4j.crypto
Class AESEncrypter
- java.lang.Object
-
- net.lingala.zip4j.crypto.AESEncrypter
-
-
Field Summary
Fields Modifier and Type Field Description private AESEngineaesEngineprivate byte[]counterBlockprivate byte[]derivedPasswordVerifierprivate booleanfinishedprivate byte[]ivprivate intloopCountprivate MacBasedPRFmacprivate intnonceprivate java.security.SecureRandomrandomprivate 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 intencryptData(byte[] buff)intencryptData(byte[] buff, int start, int len)private byte[]generateSalt(int size)byte[]getDerivedPasswordVerifier()byte[]getFinalMac()byte[]getSaltBytes()private voidinit(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:
encryptDatain interfaceEncrypter- Throws:
ZipException
-
encryptData
public int encryptData(byte[] buff, int start, int len) throws ZipException- Specified by:
encryptDatain 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()
-
-