• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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: 28401
210
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.
 
I want my playground back. Here, I'll give you this tiny ad for it:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic