SodiumLibraryException: invalid key length 184 bytes
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
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)
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.