A small and insanely fast ARCFOUR (RC4) cipher implementation of Python
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.
The whole benchmark code is in ./benchmark.py.
Clone the repo and do install:
git clone https://github.com/manicmaniac/arc4.git cd arc4 python setup.py 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') arc4.decrypt(cipher)
python -m unittest discover
This software is under the MIT License.