Comments (7)
Not sure, it seems to work fine for me on Python 3.6.3. What version of beefish?
from beefish.
Latest is 0.2.0
from beefish.
Maybe your pycrypto is out-of-date, also? This seems illustrative of a similar problem:
from beefish.
pycrypto 2.6.1
beefish 0.2.0
The issue was that beefish produces different output (credentials.yml.enc) every time with the same IV. Yesterday I have to use AES directly to work around this issue.
from beefish import encrypt_file, CIPHER_AES
__master_key = "aaa"
encrypt_file('credentials.yml', 'credentials.yml.enc', __master_key, cipher_type=CIPHER_AES)
from beefish.
Weird... On my machine (Python 3.6.5, PyCrypto 2.6.1 'final' and beefish 0.2.0) all the tests are passing.
I see from the StackOverflow link that someone else is running into a similar problem with Anaconda.
The issue was that beefish produces different output (credentials.yml.enc) every time with the same IV.
The IV is randomly chosen by beefish when encrypting a file (regardless of which cipher you use). The generate_iv()
function returns a series of random bytes. So encrypting a file twice, even with the same passphrase, will return different output because the IV will presumably be different.
from beefish.
I added a new test in 42ccee7 that shows that beefish produces the same ciphertext when given 1) same input, 2) same passphrase and 3) same IV. The tests are passing for both blowfish and aes modes.
I'm not sure what to do as I can't replicate your issue or the error you initially reported.
from beefish.
Oh I see. The IV is written to the file. Sorry about this.
from beefish.
Related Issues (7)
- Replace pycrypto with pycryptodome
- Is support for Python 3 on the roadmap? HOT 2
- python 3.4 exceptions when concatenating bytes to str HOT 2
- Python3.8 AttributeError: module 'time' has no attribute 'clock' HOT 1
- Object type <class 'str'> cannot be passed to C code HOT 2
- Well it doesn't work anymore https://github.blog/2021-09-01-improving-git-protocol-security-github/ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beefish.