/** * perform pseudo "in-place" encryption */ public void encrypt( byte[] in, int length ) { int pos = 0; while( pos<in.length && pos<length ) { encryptBlock( in, pos, length ); pos += blockSize; } }
public EncryptedZIPExportWriter(String zipFileName, String password) { try { this.zipFile = new File(zipFileName); if (zipFile.exists()) { throw new IllegalStateException("File " + zipFileName + " already exists"); } this.objectMapper = JsonSerialization.mapper; AESEncrypter encrypter = new AESEncrypterBC(); this.encrypter = new AesZipFileEncrypter(this.zipFile, encrypter); this.password = password; } catch (IOException ioe) { throw new RuntimeException(ioe); } }
byte[] pwBytes = pwStr.getBytes(); PBEParametersGenerator generator = new PKCS5S2ParametersGenerator(); this.saltBytes = createSalt(); generator.init( pwBytes, saltBytes, ITERATION_COUNT );
zfe = new AesZipFileEncrypter(filePath, new AESEncrypterBC()); } catch (IOException e) { failedException = e;
byte[] pwBytes = pwStr.getBytes(); PBEParametersGenerator generator = new PKCS5S2ParametersGenerator(); this.saltBytes = createSalt(); generator.init( pwBytes, saltBytes, ITERATION_COUNT );
/** * perform pseudo "in-place" encryption */ public void encrypt( byte[] in, int length ) { int pos = 0; while( pos<in.length && pos<length ) { encryptBlock( in, pos, length ); pos += blockSize; } }