Registry / security / arc4
library0.5.0pypypi✓ verified 84d ago

A small and insanely fast ARCFOUR (RC4) cipher implementation of Python. Version 0.5.0. Maintenance releases as needed.

pip install arc4
INSTALL
IMPORT
SIG · ARC4
A
arc4
securitypythonv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ARC4
from arc4 import ARC4
import arc4
arc4 is a module, not the class. Use 'from arc4 import ARC4'.

Encrypt and decrypt bytes with ARC4. Must re-initialize ARC4 for decryption to reset the state.

from arc4 import ARC4 key = b'secret' arc4 = ARC4(key) ciphertext = arc4.encrypt(b'plaintext') print(ciphertext.hex()) arc4 = ARC4(key) plaintext = arc4.decrypt(ciphertext) print(plaintext.decode())
Debug
Known issues
gotchaARC4 is a stream cipher; the same key must be reinitialized for decryption (state is mutated).
fix
Create a new ARC4 instance with the same key before decrypting.
affects: all
gotchaARC4 is considered broken; do not use for new encryption. Use modern ciphers like AES.
fix
Use cryptography library's AES-GCM instead.
affects: all
Errors
Common errors & fixes
AttributeError: module 'arc4' has no attribute 'ARC4'
Using 'import arc4' and then 'arc4.ARC4'.
fix
Use 'from arc4 import ARC4'.
TypeError: key must be a bytes-like object
Passing a string instead of bytes for key or data.
fix
Encode strings: b'mykey' or 'mykey'.encode()
Upgrade
Version history
0.5.0latest on PyPI · released Apr 5, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
38
Resources
arc4 — pip install arc4 · libregistry