java.lang.Object
org.codelibs.jcifs.smb1.util.RC4
Implementation of the RC4 (ARCFOUR) stream cipher algorithm.
This class provides RC4 encryption/decryption functionality used in SMB1 protocol operations.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RC4
public RC4()Default constructor for RC4 cipher. Call init() to initialize with a key before use. -
RC4
public RC4(byte[] key) Constructs and initializes an RC4 cipher with the specified key.- Parameters:
key- the encryption key
-
-
Method Details
-
init
public void init(byte[] key, int ki, int klen) Initializes the RC4 cipher with a key. This method sets up the RC4 state array using the key scheduling algorithm.- Parameters:
key- the key arrayki- the starting offset in the key arrayklen- the length of the key to use
-
update
public void update(byte[] src, int soff, int slen, byte[] dst, int doff) Encrypts or decrypts data using the RC4 stream cipher. Since RC4 is a stream cipher, the same operation is used for both encryption and decryption.- Parameters:
src- the source data arraysoff- the offset in the source arrayslen- the length of data to processdst- the destination array for the resultdoff- the offset in the destination array
-