@Override public double readDouble() { return Double.longBitsToDouble(readLong()); }
@Override @SuppressWarnings("resource") public ChunkedCipherInputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); length = dis.readLong(); return new BinaryRC4CipherInputStream(dis, length); }
@Override public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); _length = dis.readLong(); return new AgileCipherInputStream(dis, _length); }
@Override @SuppressWarnings("resource") public InputStream getDataStream(DirectoryNode dir) throws IOException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); _length = dis.readLong(); if(getSecretKey() == null) { verifyPassword(null); } // limit wrong calculated ole entries - (bug #57080) // standard encryption always uses aes encoding, so blockSize is always 16 // http://stackoverflow.com/questions/3283787/size-of-data-after-aes-encryption int blockSize = getEncryptionInfo().getHeader().getCipherAlgorithm().blockSize; long cipherLen = (_length/blockSize + 1) * blockSize; Cipher cipher = getCipher(getSecretKey()); InputStream boundedDis = new BoundedInputStream(dis, cipherLen); return new BoundedInputStream(new CipherInputStream(boundedDis, cipher), _length); }
public long readLong() { return delegate.readLong(); }
public long readLong() { return delegate.readLong(); }
@Override public double readDouble() { return Double.longBitsToDouble(readLong()); }
public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream("EncryptedPackage"); _length = dis.readLong(); return new CipherInputStream(dis, getCipher()); }
public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream("EncryptedPackage"); _length = dis.readLong(); return new CipherInputStream(dis, getCipher()); }
@Override public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); _length = dis.readLong(); return new AgileCipherInputStream(dis, _length); }
@Override @SuppressWarnings("resource") public ChunkedCipherInputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); length = dis.readLong(); return new BinaryRC4CipherInputStream(dis, length); }
public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream("EncryptedPackage"); _length = dis.readLong(); return new ChunkedCipherInputStream(dis, _length); }
public InputStream getDataStream(DirectoryNode dir) throws IOException, GeneralSecurityException { DocumentInputStream dis = dir.createDocumentInputStream("EncryptedPackage"); _length = dis.readLong(); return new ChunkedCipherInputStream(dis, _length); }
public EncryptionHeader(DocumentInputStream is) throws IOException { flags = is.readInt(); sizeExtra = is.readInt(); algorithm = is.readInt(); hashAlgorithm = is.readInt(); keySize = is.readInt(); providerType = is.readInt(); is.readLong(); // skip reserved StringBuilder builder = new StringBuilder(); while (true) { char c = (char) is.readShort(); if (c == 0) { break; } builder.append(c); } cspName = builder.toString(); cipherMode = MODE_ECB; keySalt = null; }
public EncryptionHeader(DocumentInputStream is) throws IOException { flags = is.readInt(); sizeExtra = is.readInt(); algorithm = is.readInt(); hashAlgorithm = is.readInt(); keySize = is.readInt(); providerType = is.readInt(); is.readLong(); // skip reserved StringBuilder builder = new StringBuilder(); while (true) { char c = (char) is.readShort(); if (c == 0) { break; } builder.append(c); } cspName = builder.toString(); cipherMode = MODE_ECB; keySalt = null; }
@Override @SuppressWarnings("resource") public InputStream getDataStream(DirectoryNode dir) throws IOException { DocumentInputStream dis = dir.createDocumentInputStream(DEFAULT_POIFS_ENTRY); _length = dis.readLong(); if(getSecretKey() == null) { verifyPassword(null); } // limit wrong calculated ole entries - (bug #57080) // standard encryption always uses aes encoding, so blockSize is always 16 // http://stackoverflow.com/questions/3283787/size-of-data-after-aes-encryption int blockSize = getEncryptionInfo().getHeader().getCipherAlgorithm().blockSize; long cipherLen = (_length/blockSize + 1) * blockSize; Cipher cipher = getCipher(getSecretKey()); InputStream boundedDis = new BoundedInputStream(dis, cipherLen); return new BoundedInputStream(new CipherInputStream(boundedDis, cipher), _length); }