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

Bug report: DES Decrypt/Encrypt not wokring with 24 bytes key #1843

Open
Sabadon opened this issue Jun 18, 2024 · 1 comment
Open

Bug report: DES Decrypt/Encrypt not wokring with 24 bytes key #1843

Sabadon opened this issue Jun 18, 2024 · 1 comment
Labels

Comments

@Sabadon
Copy link

Sabadon commented Jun 18, 2024

Describe the bug
Trying to use a triple-length key I get the error:
Invalid key length: 24 bytes

DES uses a key length of 8 bytes (64 bits).
Triple DES uses a key length of 24 bytes (192 bits).

To Reproduce
Link to recipe

Expected behaviour
No error, and an attempt to decrypt/encrypt the input

Additional context
I looked at the code and it only checks for length 8 bytes

if (key.length !== 8) {
            throw new OperationError(`Invalid key length: ${key.length} bytes

DES uses a key length of 8 bytes (64 bits).
Triple DES uses a key length of 24 bytes (192 bits).`);
}
@Sabadon Sabadon added the bug label Jun 18, 2024
@Sabadon
Copy link
Author

Sabadon commented Jun 18, 2024

I found a recipe for Triple DES Decrypt, then in DES Decrypt you need to at least change the error message, which is misleading.

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

No branches or pull requests

1 participant