• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid key length: exception  RSS feed

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I will really appreciate if someone can help me on this.
I created a keystore using below tool



I am using following code to encrypt the data.



But I get following error everytime,




I will appreciate if who can advice me on this issue.

Thanks,
Rouble
 
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are generating a DSA key and then trying to use it for DES encryption.

What are you trying to do?
 
author
Sheriff
Posts: 23306
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the security forum...

Henry
 
Rubal Sidhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,I am new to Security & I think I am not generating keystore correctly.Can you tell me how to generate correct keystore for my code to work.
Thanks,
Rouble
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Rubal Sidhu:
Hello,I am new to Security & I think I am not generating keystore correctly.Can you tell me how to generate correct keystore for my code to work.
Thanks,
Rouble



Until you say what you are trying to do it is difficult so say what is wrong. In your original code you were creating a key that is normally used for digital signatures and then trying to use it for DES encryption.

So, again, what are you trying to do?
 
Rubal Sidhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi James,
Sorry for not clarifying this in previous reply.Anyway the problem is solved.You were right I was using keytool to create key in keystore.I created the key using below code & it worked.

Thanks for your help & patience.
Rouble



[ August 09, 2006: Message edited by: Rubal Sidhu ]
[ August 09, 2006: Message edited by: Rubal Sidhu ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!