Package org.verapdf.tools
Class RC4Encryption
java.lang.Object
org.verapdf.tools.RC4Encryption
Implements RC4 encryption algorithm.
- Author:
- Sergey Shemyakov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]process(byte[] data) Encrypts or decrypts passed data with use of current inner state of encryptor.byte[]process(byte[] data, int offset, int size) Encrypts or decrypts passed data with use of current inner state of encryptor.voidreset()Resets inner state of encryptor to default.
-
Constructor Details
-
RC4Encryption
public RC4Encryption(byte[] key) Constructor from encryption key.- Parameters:
key- is encryption key.
-
-
Method Details
-
process
public byte[] process(byte[] data) Encrypts or decrypts passed data with use of current inner state of encryptor.- Parameters:
data- is data to process.- Returns:
- processed data.
-
process
public byte[] process(byte[] data, int offset, int size) Encrypts or decrypts passed data with use of current inner state of encryptor.- Parameters:
data- is data to process.offset- is offset of beginning of data to process.size- is amount of bytes to process.- Returns:
- processed data.
-
reset
public void reset()Resets inner state of encryptor to default.
-