Skip to main content

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

Project description

Build Status Documentation Status

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


Download files

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

Source Distribution

arc4-0.0.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distributions

arc4-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl (5.7 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

arc4-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl (5.8 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

arc4-0.0.3-cp36-cp36m-macosx_10_15_x86_64.whl (5.7 kB view details)

Uploaded CPython 3.6m macOS 10.15+ x86-64

arc4-0.0.3-cp27-cp27m-macosx_10_15_x86_64.whl (5.7 kB view details)

Uploaded CPython 2.7m macOS 10.15+ x86-64

File details

Details for the file arc4-0.0.3.tar.gz.

File metadata

  • Download URL: arc4-0.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

File hashes

Hashes for arc4-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d627a21807f9e5e4afe55d55ea148c9fa3ce1e8afa28b8a2b446db5bb6a36cf9
MD5 1d88917d311d59abaa6cbc1fbce548d8
BLAKE2b-256 33750f101d3acb7b1fff5c9ee39c7dc272eb81408603010f0ed44cc2fa403280

See more details on using hashes here.

File details

Details for the file arc4-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: arc4-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

File hashes

Hashes for arc4-0.0.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 dd20b507d74f4e398dc7cb2688fa33ec356da92819d7db838c330f2c242e7c48
MD5 95c62e67ee8ecc35cfce1c3aec2eb1df
BLAKE2b-256 332acf98a66670e24df40112247d44e73d47f04bbc9dadde98804a856ab7db1c

See more details on using hashes here.

File details

Details for the file arc4-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: arc4-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

File hashes

Hashes for arc4-0.0.3-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ac1c0d73eb451c27ed0b77a6c838e30fa562e2589a6344da34b2794a02443854
MD5 bf6e0d7a3771ab656f2df31be9aa0798
BLAKE2b-256 b3276648964e4115693daaddc5270aad69bc5ee72b4d4a4ddd7187ee98f12c2d

See more details on using hashes here.

File details

Details for the file arc4-0.0.3-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: arc4-0.0.3-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

File hashes

Hashes for arc4-0.0.3-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 a53cf2e52169bd6c2ab806801b6050bd1d4b816a8bed2b9c7881a4711cdd1393
MD5 6883515e1bf1e2524afbb72247b1c8e0
BLAKE2b-256 79b6ef585bd2b0275212f2a6bc9cdb832d44beb7e18c1eefde24603de6976c55

See more details on using hashes here.

File details

Details for the file arc4-0.0.3-cp27-cp27m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: arc4-0.0.3-cp27-cp27m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: CPython 2.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.3

File hashes

Hashes for arc4-0.0.3-cp27-cp27m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6f50364040d1112617789f47b9a7055c5d438805d3278d3c899c1ef959a40d66
MD5 2e907a4378779253937b27952482661e
BLAKE2b-256 e7084e85235760e756e37b8f847ace413e554c4232b53e72744f2180d2ef63f8

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