private SkippingStreamCipher setup(OutputStream os) throws GeneralSecurityException, IOException {
this.headerEncIV = KeyGenUtils.genIV(type.encryptType.ivSize).getIV();
this.unencryptedBaseKey = KeyGenUtils.genSecretKey(type.encryptKey);
writeHeader(os);
setupKeys();
SkippingStreamCipher cipherWrite = this.type.get();
cipherWrite.init(true, cipherParams);
return cipherWrite;
}