Package org.relique.io
Class XORCipher
- java.lang.Object
-
- org.relique.io.XORCipher
-
- All Implemented Interfaces:
CryptoFilter
public class XORCipher extends java.lang.Object implements CryptoFilter
Example encryption filter that XOR's the all data with a secret seed value.
-
-
Constructor Summary
Constructors Constructor Description XORCipher(java.lang.String seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intread(java.io.InputStream in)intread(java.io.InputStream in, byte[] b)intread(java.io.InputStream in, byte[] b, int off, int len)voidreset()java.lang.StringtoString()voidwrite(java.io.OutputStream out, int ch)
-
-
-
Method Detail
-
read
public int read(java.io.InputStream in) throws java.io.IOException- Specified by:
readin interfaceCryptoFilter- Throws:
java.io.IOException
-
read
public int read(java.io.InputStream in, byte[] b) throws java.io.IOException- Specified by:
readin interfaceCryptoFilter- Throws:
java.io.IOException
-
read
public int read(java.io.InputStream in, byte[] b, int off, int len) throws java.io.IOException- Specified by:
readin interfaceCryptoFilter- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
write
public void write(java.io.OutputStream out, int ch) throws java.io.IOException- Specified by:
writein interfaceCryptoFilter- Throws:
java.io.IOException
-
reset
public void reset()
- Specified by:
resetin interfaceCryptoFilter
-
-