• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

javax.crypto with sun AND ibm...

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello together,

this is my first post here and hopefully my last ;-)
I hope anyone can help me a little bit with javas crypto stuff.

I am going to use a Password based encryption for normal strings. I like to use an AES algorithm to encrypt my data. Therefore i use a PBKDF2 Algorithm to genereate a suitable secret key. That results in the following code:



So far so good. Works amazing on my local machine with sun java 1.5.0_13. But running on a server which uses ibm java i get a java.security.NoSuchAlgorithmException: Algorithm PBKDF2WithHmacSHA1 not available.

I figured out the on ibm there is just a PBKDF1 and PBKDF2 available. So now i can make my code intelligent enough to decide which algorithm it has tu use, but depending on the fact that some data my encrypted on a sun, stored in the database, and will be encrypted on an ibm, i am not sure if i can mix this up.

I really like to use this AES with this length and salt, so i can only change the algorithm to generate the key. Any ideas?

Thanks in advance.

 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This has nothing to do with the problem at hand, but "string.getBytes()" is bound to fail if you move code or data across machines, since it relies on the platform default encoding. Better to use a specific encoding explicitly.
 
Martin Herfurth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This works fine... no problems in this step. In prodictive code, i use encoding. I just dont want to have too much overhead in my example code.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic