Skip to main content

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

Project description

https://travis-ci.org/manicmaniac/arc4.svg?branch=master

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

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

arc4-0.0.1-cp27-cp27mu-macosx_10_12_x86_64.whl (4.8 kB view details)

Uploaded CPython 2.7mu macOS 10.12+ x86-64

File details

Details for the file arc4-0.0.1-cp27-cp27mu-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: arc4-0.0.1-cp27-cp27mu-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: CPython 2.7mu, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.12

File hashes

Hashes for arc4-0.0.1-cp27-cp27mu-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3a1ff5189f8d4a7148dd67c963c40e5898bdf6ecc5371cc178687d06a48074ae
MD5 82bf610f79302ac76dbed1886c593837
BLAKE2b-256 af38895efbb62dbefcb7cc75475d2337478e091c4aab97fc6f701baa8d1387b0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page