gnu.crypto.prng

Class PBKDF2

Implemented Interfaces:
Cloneable, IRandom

public class PBKDF2
extends BasePRNG
implements Cloneable

An implementation of the key derivation function KDF2 from PKCS #5: Password-Based Cryptography (PBE). This KDF is essentially a way to transform a password and a salt into a stream of random bytes, which may then be used to initialize a cipher or a MAC.

This version uses a MAC as its pseudo-random function, and the password is used as the key.

References:

  1. B. Kaliski, RFC 2898: Password-Based Cryptography Specification, Version 2.0

Version:
$Revision: 1.5 $

Field Summary

Fields inherited from class gnu.crypto.prng.BasePRNG

buffer, initialised, name, ndx

Constructor Summary

PBKDF2(IMac mac)
Creates a new PBKDF2 object.

Method Summary

Object
clone()
Returns a clone copy of this instance.
void
fillBlock()
void
setup(Map attributes)

Methods inherited from class gnu.crypto.prng.BasePRNG

clone, fillBlock, init, isInitialised, name, nextByte, nextBytes, setup

Constructor Details

PBKDF2

public PBKDF2(IMac mac)
Creates a new PBKDF2 object. The argument is the MAC that will serve as the pseudo-random function. The MAC does not need to be initialized.

Parameters:
mac - The pseudo-random function.

Method Details

clone

public Object clone()
Returns a clone copy of this instance.
Specified by:
clone in interface IRandom
Overrides:
clone in interface BasePRNG

Returns:
a clone copy of this instance.


fillBlock

public void fillBlock()
            throws LimitReachedException
Overrides:
fillBlock in interface BasePRNG


setup

public void setup(Map attributes)
Overrides:
setup in interface BasePRNG


Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.