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.
Benchmark
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 ./benchmark.py.
Install
Install from PyPI:
pip install arc4
Or clone the repo and do install:
git clone https://github.com/manicmaniac/arc4.git cd arc4 python setup.py install
Usage
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)
Testing
python -m unittest discover
License
This software is under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arc4-0.0.2.tar.gz.
File metadata
- Download URL: arc4-0.0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3917c7df7692a14009e1bc113395ceac14b54047dcee418efde49d6423daecf2
|
|
| MD5 |
19c95386f3940be4c1026ae562a11649
|
|
| BLAKE2b-256 |
0896b8c5d361042dac4fdb5cd0e13ae41d2028ea379b434827bc052e8f3688d1
|
File details
Details for the file arc4-0.0.2-cp36-cp36m-macosx_10_14_x86_64.whl.
File metadata
- Download URL: arc4-0.0.2-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 5.4 kB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf019286f2c0e99c6fa02a9d1dff3f0d2aba31477bfc3f1d11ed9cee600c4955
|
|
| MD5 |
2d7d80c90749659cd8b2c9159a1346b5
|
|
| BLAKE2b-256 |
386ec1beb828e2529b581e18f4c02cae2939537ad7067107d813d8edb723804e
|