Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Invalid key length: exception

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 23925
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the security forum...

Henry
 
Rubal Sidhu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic