zevlee / footprint-otp Goto Github PK
View Code? Open in Web Editor NEWStream cipher encryption program available on Windows, macOS, and Linux
License: MIT License
Stream cipher encryption program available on Windows, macOS, and Linux
License: MIT License
One-time-pad is a bit of an odd bird in the world of cryptography, as it has exact requirements
The pad must be truly random. In other words, you can not use any algorithm to create the one-time pad, but a HWRNG. Your application is using the secrets.token_bytes()
method, which is a wrapper for os.urandom()
which in turn reads from the kernel CSPRNG algorithm. the PR in CSPRNG stand's for pseudo-random, which is not the same.
One-time pad is an optimal cipher among the ciphers that provide perfect secrecy
, as it satisfies the "key must be at least as long as the message" condition with equality. The kernel CSPRNG is usually seeded from the CPU's HWRNG and/or the chaotic events (interrupt events etc.) that happen during the use, but as the kernel CSPRNG expands the computationally secure seed, it does not provide perfect secrecy, only computational security.
XORing plaintext with keystream is what all stream ciphers do. Since the kernel CSPRNG is ChaCha20 stream cipher on Linux and AES on Windows, you're effectively using either ChaCha20 or AES encryption, with pre-shared keystream.
Please strongly consider removing all references to OTP, or change the system to utilize a hardware random number generator.
https://github.com/zevlee/footprint-otp/blob/main/lib/otp.py#L48 shows the software is XORing plaintext with the keystream, without adding message authentication code to the message. This makes the ciphertext vulnerable to known plaintext attacks (KPA), where if the attacker knows the plaintext for any reason, they're able to obtain key with key = ciphertext XOR plaintext
, and they can then substitute message with their own by passing new_ciphertext = new_plaintext XOR key
to the recipient.
Because of the recent change in pyinstaller version 6.0.0 to restructure onedir builds pyinstaller/pyinstaller#7713, the build scripts do not currently work. This will be addressed in an upcoming fix.
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.