org.relique.io
Class XORCipher

java.lang.Object
  extended by org.relique.io.XORCipher
All Implemented Interfaces:
CryptoFilter

public class XORCipher
extends Object
implements CryptoFilter

Example encryption filter that XOR's the all data with a secret seed value.


Constructor Summary
XORCipher(String seed)
           
 
Method Summary
 int read(InputStream in)
           
 int read(InputStream in, byte[] b)
           
 int read(InputStream in, byte[] b, int off, int len)
           
 void reset()
           
 String toString()
           
 void write(OutputStream out, int ch)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XORCipher

public XORCipher(String seed)
Method Detail

read

public int read(InputStream in)
         throws IOException
Specified by:
read in interface CryptoFilter
Throws:
IOException

read

public int read(InputStream in,
                byte[] b)
         throws IOException
Specified by:
read in interface CryptoFilter
Throws:
IOException

read

public int read(InputStream in,
                byte[] b,
                int off,
                int len)
         throws IOException
Specified by:
read in interface CryptoFilter
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

write

public void write(OutputStream out,
                  int ch)
           throws IOException
Specified by:
write in interface CryptoFilter
Throws:
IOException

reset

public void reset()
Specified by:
reset in interface CryptoFilter


Copyright © 2016. All rights reserved.