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 Distributions
Hashes for arc4-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd20b507d74f4e398dc7cb2688fa33ec356da92819d7db838c330f2c242e7c48 |
|
MD5 | 95c62e67ee8ecc35cfce1c3aec2eb1df |
|
BLAKE2b-256 | 332acf98a66670e24df40112247d44e73d47f04bbc9dadde98804a856ab7db1c |
Hashes for arc4-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac1c0d73eb451c27ed0b77a6c838e30fa562e2589a6344da34b2794a02443854 |
|
MD5 | bf6e0d7a3771ab656f2df31be9aa0798 |
|
BLAKE2b-256 | b3276648964e4115693daaddc5270aad69bc5ee72b4d4a4ddd7187ee98f12c2d |
Hashes for arc4-0.0.3-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53cf2e52169bd6c2ab806801b6050bd1d4b816a8bed2b9c7881a4711cdd1393 |
|
MD5 | 6883515e1bf1e2524afbb72247b1c8e0 |
|
BLAKE2b-256 | 79b6ef585bd2b0275212f2a6bc9cdb832d44beb7e18c1eefde24603de6976c55 |
Hashes for arc4-0.0.3-cp27-cp27m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f50364040d1112617789f47b9a7055c5d438805d3278d3c899c1ef959a40d66 |
|
MD5 | 2e907a4378779253937b27952482661e |
|
BLAKE2b-256 | e7084e85235760e756e37b8f847ace413e554c4232b53e72744f2180d2ef63f8 |