java.lang.Object
org.sejda.sambox.encryption.ARC4Engine
- All Implemented Interfaces:
EncryptionAlgorithmEngine
ARC4 implementation of a
EncryptionAlgorithmEngine-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encryptBytes(byte[] data, byte[] key) encryptStream(InputStream data, byte[] key) private voidinit(byte[] key)
-
Field Details
-
cipher
private final org.bouncycastle.crypto.StreamCipher cipher
-
-
Constructor Details
-
ARC4Engine
public ARC4Engine()
-
-
Method Details
-
encryptStream
- Specified by:
encryptStreamin interfaceEncryptionAlgorithmEngine- Parameters:
data- data to encrypt- Returns:
- a stream where encrypted data can be read from
-
encryptBytes
public byte[] encryptBytes(byte[] data, byte[] key) - Specified by:
encryptBytesin interfaceEncryptionAlgorithmEngine- Parameters:
data- data to encrypt- Returns:
- the encrypted data
-
init
private void init(byte[] key)
-