• 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

Pseudo Random Function for J2ME

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I think this is really tough question, but lets try.

I'm implementing small software in J2ME environment. Part of that software is to encrypt a small txt-file using a password based encryption. I'm using SATSA (Security And Trusted Services API, JSR177) for actual encryption. However, I need to generate a key for that encryption process. Key generation must be done using so called "slow funcktion". I have decided to use PBKDF2 algorithm for that purpose (see: http://www.ietf.org/rfc/rfc2898.txt)

At the moment I have started to implement PBKDF2 for J2ME. I can do everything else, but I have a problem creating PRF (Pseudo Random Function), that is used in key generation process. I can' use Mac and SecretKeySpec classes, that are part of JavaSE:

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

Those classes are not in J2ME unfortunately.

Could somebody give me any hint, how I could create my own PRF for J2ME? Which algorithm to use? Are there anything ready for J2ME.

Br
Koot
 
Saloon Keeper
Posts: 25481
180
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Donald Knuth defines a PRF algorithm in his seminal work "The Art of Computer Programming". Basically, it chops the preceeding number in the series into 2 parts, then merges the parts using simple arithmetic.

You should be able to google for Random Number Generator Algorithm and find lots of code.
 
Acetylsalicylic acid is aspirin. This could be handy too:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic