manicmaniac / arc4 Goto Github PK
View Code? Open in Web Editor NEWA small and insanely fast ARCFOUR (RC4) cipher implementation of Python
Home Page: https://pypi.org/project/arc4/
License: MIT License
A small and insanely fast ARCFOUR (RC4) cipher implementation of Python
Home Page: https://pypi.org/project/arc4/
License: MIT License
Currently all methods including constructor defined in ARC4
accepts not only bytes
but also unicode str
.
However passing a unicode str
to ARC4
methods requires developers to be very careful like the following example.
>>> from arc4 import ARC4
>>> with open('key-in-utf-8.txt') as f:
... arc4 = ARC4(f.read())
>>> with open('cipher-utf-8.txt') as f:
... print(arc4.decrypt(f.read())) # success
>>> with open('cipher-latin-1.txt') as f:
... print(arc4.decrypt(f.read())) # failure
Traceback (most recent call last):
File "/path/to/script.py", line 7, in <module>
print(arc4.decrypt(f.read()))
File "/path/to/python3.9/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 3: invalid continuation byte
The example is too simple for experienced developers to make a mistake but once someone changed the text file's encoding, or the print
function is called from another module, it could be difficult to find the root cause.
So I will add changes to have ARC4
accept only bytes in future releases.
As a first step, arc4 0.3.0
will warn DeprecationWarning
when users pass unicode str
to any public methods or constructor of ARC4
.
Thereafter maybe in arc4 1.0.0
, it will be officially unsupported.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
This repository currently has no open or pending branches.
.github/workflows/benchmark.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-python v5
actions/upload-artifact v4
exuanbo/actions-deploy-gist v1
ubuntu 22.04
.github/workflows/release.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-python v5
actions/upload-artifact v4
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-python v5
actions/upload-artifact v4
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
actions/upload-artifact v4
actions/setup-python v5
actions/download-artifact v4
ubuntu 22.04
ubuntu 22.04
ubuntu 22.04
.github/workflows/test.yml
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
actions/setup-python v5
actions/upload-artifact v4
actions/download-artifact v4
actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
ubuntu 22.04
ubuntu 22.04
Logs:
Collecting arc4
Using cached arc4-0.0.2.tar.gz (3.7 kB)
Building wheels for collected packages: arc4
Building wheel for arc4 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\alexc\AppData\Local\Temp\pip-wheel-hxscnlko'
cwd: C:\Users\alexc\AppData\Local\Temp\pip-install-_daxeifk\arc4\
Complete output (12 lines):
running bdist_wheel
running build
running build_ext
building 'arc4' extension
creating build
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alexc\appdata\local\programs\python\python38-32\include -Ic:\users\alexc\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcarc4.c /Fobuild\temp.win32-3.8\Release\arc4.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
arc4.c
c:\users\alexc\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for arc4
Running setup.py clean for arc4
Failed to build arc4
DEPRECATION: Could not build wheels for arc4 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: arc4
Running setup.py install for arc4 ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\alexc\AppData\Local\Temp\pip-record-a0ya45_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alexc\appdata\local\programs\python\python38-32\Include\arc4'
cwd: C:\Users\alexc\AppData\Local\Temp\pip-install-_daxeifk\arc4\
Complete output (12 lines):
running install
running build
running build_ext
building 'arc4' extension
creating build
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\alexc\appdata\local\programs\python\python38-32\include -Ic:\users\alexc\appdata\local\programs\python\python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcarc4.c /Fobuild\temp.win32-3.8\Release\arc4.obj -O3
cl : Command line warning D9002 : ignoring unknown option '-O3'
arc4.c
c:\users\alexc\appdata\local\programs\python\python38-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\alexc\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"'; __file__='"'"'C:\\Users\\alexc\\AppData\\Local\\Temp\\pip-install-_daxeifk\\arc4\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\alexc\AppData\Local\Temp\pip-record-a0ya45_6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\alexc\appdata\local\programs\python\python38-32\Include\arc4' Check the logs for full command output.```
The arc4_state.s is only 255 bytes long. It should be 256...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.