Rc4

object Rc4

Pure-Kotlin RC4 stream cipher (RSA Data Security, Inc., 1987).

Used by PDF Standard Security Handler V1 (40-bit) and V2 (40–128-bit). RC4 is symmetric: same routine for encrypt + decrypt. Don't use this anywhere else — RC4 has well-known weaknesses; PDF kept it for back-compat.

Functions

Link copied to clipboard

Returns the data XOR-ed with the RC4 keystream derived from key.