Class RC4Encryption

java.lang.Object
org.verapdf.tools.RC4Encryption

public class RC4Encryption extends Object
Implements RC4 encryption algorithm.
Author:
Sergey Shemyakov
  • Constructor Summary

    Constructors
    Constructor
    Description
    RC4Encryption(byte[] key)
    Constructor from encryption key.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    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.
    void
    Resets inner state of encryptor to default.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.