GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Full discussion can be found here;
Seems that using subprocess.Popen causes some threading problems... Might be worth mentioning on the README that this library uses subprocess
Replaced this is a pure python implementation, and it seems to work fine now.
Might be worth refactoring SimpleAES to use this instead, as it won't rely on subprocess then??
My main reason for using the openssl command is have its output remain compatible with CryptoJS and openssl itself. Is the output from that blog you linked to decryptable using the openssl command line?
FYI: the openssl output when encrypting does not only contain the ciphertext itself, but also a few other pieces of data necessary for the decryption: what padding method is used, what the IV was, what the salt was, what the block size is, etc. This makes it easy to use different encryption parameters, since all metadata is included in the actual encryption result. In other words: this is more than only the raw ciphertext itself.
CryptoJS knows about this format, so it can decode the string easily. Instead of figuring out what the exact format is for the keys, I decided to "just use the openssl commandline". I do share your objections to this solution, but the time investment to implement it all myself was just too much for now.
I'm happy to accept a better solution, though, as long as it remains 100% compatible with the openssl command line.
@nvie Thanks for the feedback, I will put some time aside to take a look at this!
That would be awesome!