
net.java.truevfs.comp.zip.WinZipAesUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truevfs-comp-zip Show documentation
Show all versions of truevfs-comp-zip Show documentation
Provides basic functionality for reading and writing ZIP files.
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truevfs.comp.zip;
import net.java.truecommons.key.spec.common.AesKeyStrength;
/**
* Static utility methods for WinZip AES encryption.
*
* @author Christian Schlichtherle
*/
final class WinZipAesUtils {
/** You cannot instantiate this class. */
private WinZipAesUtils() {
}
/**
* Returns the overhead in bytes which is added to each WinZip AES
* encrypted entry.
*
* @param keyStrength The AES key strength.
* @return the overhead in bytes which is added to each WinZip AES
* encrypted entry.
*/
static int overhead(AesKeyStrength keyStrength) {
return keyStrength.getBytes() / 2 // salt value
+ 2 // password verification value
+ 10; // authentication code
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy