Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TripleDes / Des encrypt & decrypt result are not same as crypto-js #22

Closed
tonyfung99 opened this issue Sep 13, 2021 · 3 comments
Closed

Comments

@tonyfung99
Copy link

CryptoES.TripleDES.encrypt(DATA, CryptoES.enc.Utf8.parse(KEY), { mode: CryptoES.mode.ECB, format: CryptoES.format.OpenSSL });

As title, seems crypto-es is unable to produce the same output in both encrypt and decrypt as crypto-js. The output seems incorrect.

@brownsugar
Copy link

Same here.
DES decryption got different results, in CryptoJS I got the correct result, in CryptoES I need to split the encrypted HEX string to get the correct result.

With CryptoJS
https://codepen.io/brownsugar/pres/OJjJPYY?editors=0012

With CryptoES
https://codesandbox.io/s/cryptoes-des-decryption-zt4cs

@akashraj9828
Copy link

@entronad is there any update on this?

@entronad
Copy link
Owner

This issue has been fixed in v2.0.0;

The blockSize should be an instance field not a static field so that it can be correctly overridden and called. this matters in ES6 class so the definition should differ from CryptoJS.

This issue only affected TripleDes / Des.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants