Skip to main content

A small and insanely fast ARCFOUR (RC4) cipher implementation of Python

Project description

A small and insanely fast ARCFOUR (RC4) cipher implementation of Python.

  • Strongly focused on performance; entire source code is written in C.
  • Easily installable; single file with no dependency.


Below is benchmark metrics against 3 major RC4 implementations.

arc4 is 67 % faster than the de facto PyCrypto library. Also, 1889 % faster than pure-Python rc4 library.

arc4 0.332659006119
PyCrypto 0.544879198074
rc4 6.60579204559

The whole benchmark code is in ./


Clone the repo and do install:

git clone
cd arc4
python install


from arc4 import ARC4

arc4 = ARC4('key')
cipher = arc4.encrypt('some plain text to encrypt')

Because RC4 is a stream cipher, you must initialize RC4 object in the beginning of each operations.

arc4 = ARC4('key')


python -m unittest discover


This software is under the MIT License.

Project details

Release history Release notifications

This version
History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
arc4-0.0.1-cp27-cp27mu-macosx_10_12_x86_64.whl (4.8 kB) Copy SHA256 hash SHA256 Wheel cp27

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page