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 int
read(java.io.InputStream in)
int
read(java.io.InputStream in, byte[] b)
int
read(java.io.InputStream in, byte[] b, int off, int len)
void
reset()
java.lang.String
toString()
void
write(java.io.OutputStream out, int ch)
-
-
-
Method Detail
-
read
public int read(java.io.InputStream in) throws java.io.IOException
- Specified by:
read
in interfaceCryptoFilter
- Throws:
java.io.IOException
-
read
public int read(java.io.InputStream in, byte[] b) throws java.io.IOException
- Specified by:
read
in 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:
read
in interfaceCryptoFilter
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
write
public void write(java.io.OutputStream out, int ch) throws java.io.IOException
- Specified by:
write
in interfaceCryptoFilter
- Throws:
java.io.IOException
-
reset
public void reset()
- Specified by:
reset
in interfaceCryptoFilter
-
-