Fix issue with AES 256 breaking when running in Electron#16
Fix issue with AES 256 breaking when running in Electron#16superical wants to merge 1 commit intoTomFrost:masterfrom
Conversation
|
@TomFrost It would be great if I could have this PR reviewed and merged because this will help many Electron projects to continue using Cryptex. Thanks! |
|
Hi @superical, thanks for this! It looks like the only thing necessary to fix the build is |
|
Actually, circling back, is the issue that electron doesn't include/blocks the If possible, it might make sense to use https://nodejs.org/api/crypto.html#crypto_crypto_getciphers to make the determination, rather than sniffing for signs of electron. |
|
@TomFrost I agree that it makes more sense to use that. I will check on that and probably update the PR again very soon. |
The name used for the AES 256 algorithm will break Cryptex when used in Electron 73. It seems like the fix to this issue is by changing the algorithm name to
aes-256-cbcfor the crypto package to work. Otherwise, an "Unknown Cipher" error message will be thrown.This PR attempts to detect whether the environment is Electron or not. If it is, we will use
aes-256-cbcas the algorithm name. Otherwise, we will useaes256in a regular Node environment.