WeakKeyException using jsendnsca

17 views
Skip to first unread message

Jonathan W

unread,
Jul 9, 2010, 8:42:09 AM7/9/10
to jsend-nsca
Hi,

I'm trying to use jsendnsca to send a message to a Nagios server using
triple des encryption but I have this error :

com.googlecode.jsendnsca.NagiosException: Error occurred while sending
passive alert
at
com.googlecode.jsendnsca.NagiosPassiveCheckSender.send(NagiosPassiveCheckSender.java:
89)
at Main.main(Main.java:16)
Caused by: java.lang.RuntimeException:
gnu.javax.crypto.cipher.WeakKeyException
at
com.googlecode.jsendnsca.encryption.TripleDESEncryptor.encrypt(TripleDESEncryptor.java:
57)
at
com.googlecode.jsendnsca.PassiveCheckBytesBuilder.encrypt(PassiveCheckBytesBuilder.java:
83)
at
com.googlecode.jsendnsca.NagiosPassiveCheckSender.send(NagiosPassiveCheckSender.java:
80)
...2 more
Caused by: gnu.javax.crypto.cipher.WeakKeyException
at gnu.javax.crypto.cipher.DES.makeKey(libgcj.so.7rh)
at gnu.javax.crypto.cipher.TripleDES.makeKey(libgcj.so.7rh)
at gnu.javax.crypto.cipher.BaseCipher.init(libgcj.so.7rh)
at gnu.javax.crypto.mode.BaseMode.init(libgcj.so.7rh)
at gnu.javax.crypto.jce.cipher.CipherAdapter.reset(libgcj.so.7rh)
at
gnu.javax.crypto.jce.cipher.CipherAdapter.engineInitHandler(libgcj.so.
7rh)
at gnu.javax.crypto.jce.cipher.CipherAdapter.engineInit(libgcj.so.
7rh)
at javax.crypto.Cipher.init(libgcj.so.7rh)
at javax.crypto.Cipher.init(libgcj.so.7rh)
at
com.googlecode.jsendnsca.encryption.TripleDESEncryptor.encrypt(TripleDESEncryptor.java:
50)
...4 more

Can you tell me if this error is due to the weakness of my password or
is it something else ?

Regards,

Jonathan

Raj Patel

unread,
Jul 9, 2010, 8:59:02 AM7/9/10
to jsend-nsca
Hi

Seems like you need to configure GNU Crypto to not check for weak keys

see http://www.gnu.org/software/gnu-crypto/#configuration, property
gnu.crypto.with.check.for.weak.keys

"Default value: true

true: Indicates that an additional check for so-called weak keys will
be carried out when generating the cipher sub-keys from user-defined
initial key material. Such checks may cause a
gnu.crypto.cipher.WeakKeyException (a subclass of
java.security.InvalidKeyException) to be thrown."

Hope that helps

Regards

Raj

Raj Patel

unread,
Jul 9, 2010, 10:07:24 AM7/9/10
to jsend-nsca, Raj Patel
To disable the check, see

http://www.gnu.org/software/gnu-crypto/manual/api/gnu/crypto/Properties.html#setCheckForWeakKeys%28boolean%29

On Jul 9, 1:59 pm, Raj Patel <rajnee...@gmail.com> wrote:
> Hi
>
> Seems like you need to configure GNU Crypto to not check for weak keys
>
> seehttp://www.gnu.org/software/gnu-crypto/#configuration, property

Jonathan W

unread,
Jul 12, 2010, 5:54:12 AM7/12/10
to jsend-nsca
Thank you very much, that's exactly what I was looking for.
I'm trying to use it to solve my problem.

On 9 juil, 16:07, Raj Patel <rajneeshpa...@gmail.com> wrote:
> To disable the check, see
>
> http://www.gnu.org/software/gnu-crypto/manual/api/gnu/crypto/Properti...
Reply all
Reply to author
Forward
0 new messages