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.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03e7cc8974688af0ec71b0aa8826ebf103ad94541eddc35a074ad3cd91aba2e8 |
|
MD5 | 32da9eeb570ffb305b81631755591b58 |
|
BLAKE2b-256 | f5850980ce384cbcc925560b46bf35629831be920fbc7f56922bf5279f754d2c |
Hashes for arc4-0.0.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98029a369369a51996a72089a610794dde2152ac2b4e62edd6945dcd7653099a |
|
MD5 | a0de33940c8ab8fce883ea45f63a5d61 |
|
BLAKE2b-256 | 717e479c971cd9b34c68412ee58bd92f552dc6c2ffb7b017460a0b85a77e0efa |
Hashes for arc4-0.0.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a002cad12573bb85d7555e48bc20c65126a57faa4a241e70dafd34cb01d6c3f |
|
MD5 | e04503843181425e893501ac762ccf3f |
|
BLAKE2b-256 | b269f57f72619b46830c75e3f6fd10a9ef867e1c352a23b06ab9b40e5a756c29 |
Hashes for arc4-0.0.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbdd1bf925200006fd613fff3832ea85ecab9a96132f2169910c0d7def927d7d |
|
MD5 | e3ad5030eb115b7567c89c0ad9f65bba |
|
BLAKE2b-256 | 496b6051e95a727552a8ad521d301a400e6bed196396f208e238c7eef48fea45 |
Hashes for arc4-0.0.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25d73fbfd41c522c2a4f5df256e6edbe5a7faf0e7042c253a2a52175ee9561eb |
|
MD5 | 0e1b088ff6ae813d8a2c17869765fbca |
|
BLAKE2b-256 | b3971370cc67f2253c7c2e85b5a6dbddb5ecddd9eddaa18ada27763517a1a6fa |
Hashes for arc4-0.0.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e041f32d76e8c74e235020a3be15b63a02fc2ae381ada892fbbf9a1bd3a561c7 |
|
MD5 | 48b7b5478aabfb3ecc777c3cd3ecd572 |
|
BLAKE2b-256 | e475552b2e129caba75bc1700a666aa23e3f75570000a3ce17fd809713b4504b |
Hashes for arc4-0.0.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69f25c01918b2a364202638b7111056c06b81f2ff7a52907c1d3a5390ebbbb60 |
|
MD5 | b7abfd2c2e30840549e8009a10d9932e |
|
BLAKE2b-256 | 21e386004dd3c331dced5ac383b16c586059ff84649e12cc35e0e4636af211d4 |
Hashes for arc4-0.0.4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd8ac1d5aa79cf93d9fb3201886d85c4b855e4c087005bd49794204c2f3495f |
|
MD5 | 2389110bcdfb12e111fc6cefcf8e9230 |
|
BLAKE2b-256 | 518f6d1bdd49a454140802a17e3b07bb11c39368b27903badaee37ff35c750a8 |
Hashes for arc4-0.0.4-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b19c2add9617a1002884619c7f5175b16c4f284bbf1a92c36d767f870634fb02 |
|
MD5 | acb77e9a91a494843ce7b32724d46f2f |
|
BLAKE2b-256 | e67408f1321137215eca9f068931ff8a080bb47ec67acfb30728508f83d9ff0c |
Hashes for arc4-0.0.4-cp35-cp35m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ec1436afe129d8a7da63e7e230875ca4a119519926094a6d4e44539ae6f061 |
|
MD5 | b9198ed2b2713fd6b8aba6185321ff4a |
|
BLAKE2b-256 | 0c0f0d2dd9478ae304eabb7bf4aaf99a2eb6ed9efb7af6678b967914f0c27d02 |
Hashes for arc4-0.0.4-cp27-cp27m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 491b7551168e8e95019f5ef9db8d06db978a517aa4924993ecd0dca3126aec53 |
|
MD5 | db21b43b3c26da89b596b23d7cb6d3de |
|
BLAKE2b-256 | fa983ae658d3eaacc91a18f3188ebc0b544fedd8215627c01b7e7f11258fa14e |