net.sourceforge.blowfishj
Class BlowfishOutputStream
java.lang.Object
java.io.OutputStream
net.sourceforge.blowfishj.BlowfishOutputStream
- public class BlowfishOutputStream
- extends java.io.OutputStream
An output stream that encrypts data using the Blowfish algorithm in CBC mode,
padded with PCKS7. Provided key material is hashed to a 160bit final key
using SHA-1.
- Author:
- original version by Dale Anson
Constructor Summary |
BlowfishOutputStream(byte[] key,
int nOfs,
int nLen,
java.io.OutputStream os)
Default constructor. |
BlowfishOutputStream(java.lang.String sPassPhrase,
java.io.OutputStream os)
Deprecated. due to the restrictions in usage and the discarding of some
original key material it is highly recommended not to use it anymore |
Methods inherited from class java.io.OutputStream |
write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BlowfishOutputStream
public BlowfishOutputStream(byte[] key,
int nOfs,
int nLen,
java.io.OutputStream os)
throws java.io.IOException
- Default constructor. The key material gets transformed to a final 160bit
key using SHA-1.
- Parameters:
key
- key buffernOfs
- where the key material startsnLen
- size of the key material (in bytes)os
- the output stream to which bytes will be written
- Throws:
java.io.IOException
- if the IV couldn't be written
BlowfishOutputStream
public BlowfishOutputStream(java.lang.String sPassPhrase,
java.io.OutputStream os)
throws java.io.IOException
- Deprecated. due to the restrictions in usage and the discarding of some
original key material it is highly recommended not to use it anymore
- Constructor using a string. The ASCII character values of the string are
hashed with SHA-1, the digest is used as the final key.
- Parameters:
sPassPhrase
- the passphraseos
- the output stream to which bytes will be written
- Throws:
java.io.IOException
- if the IV couldn't be written
write
public void write(int nByte)
throws java.io.IOException
- Throws:
java.io.IOException
- See Also:
OutputStream.write(int)
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
- See Also:
InputStream.close()
flush
public void flush()
throws java.io.IOException
- Throws:
java.io.IOException
- See Also:
OutputStream.flush()
Copyright © 2004-2005 Sourceforge. All Rights Reserved.