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

SodiumLibraryException: invalid key length 184 bytes #6

Open
raymondtiongco opened this issue Mar 20, 2019 · 2 comments
Open

SodiumLibraryException: invalid key length 184 bytes #6

raymondtiongco opened this issue Mar 20, 2019 · 2 comments

Comments

@raymondtiongco
Copy link

Issue when im decrypting a key of 184 bytes. the allowed is 32 bytes. how can we change the constant NativeLong crypto_box_secretkeybytes() into 184

@raymondtiongco
Copy link
Author

Exception in thread "main" com.muquit.libsodiumjna.exceptions.SodiumLibraryException: invalid key length 184 bytes
at com.muquit.libsodiumjna.SodiumLibrary.cryptoSecretBoxOpenEasy(SodiumLibrary.java:792)
at test.com.muquit.libsodiumjna.TestSodiumLibrary.testCryptoSecretBoxEasyEcryptDecrypt(TestSodiumLibrary.java:203)
at test.com.muquit.libsodiumjna.TestSodiumLibrary.main(TestSodiumLibrary.java:222)

@muquit
Copy link
Owner

muquit commented Mar 21, 2019

This constant is defined in crypto_box.h of libsodium C library. If you want to change it, you have to change it in the libsodium C library. I am not a cryptographer, so I prefer to use default constants and settings of libsodium C library set by the people who understand it more than I do. libsodium-jna is a thin wrapper around libsodium C library.
Thanks.

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

2 participants