tribble.security
Class KeyMaker

java.lang.Object
  extended bytribble.security.KeyMaker

public class KeyMaker
extends java.lang.Object

Methods for generating an encryption/decryption key.

Since:
2002-04-13
Version:
$Revision: 1.2 $ $Date: 2003/03/19 04:32:47 $
Author:
David R. Tribble, david@tribble.com.
Copyright 2002 by David R. Tribble, all rights reserved.
Permission is granted to freely use and distribute this source code provided that the original copyright and authorship notices remain intact.

Method Summary
static void main(java.lang.String[] args)
          Test driver.
static byte[] makeKey(java.lang.String pwd, int n)
          Generate a binary key from a password string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(java.lang.String[] args)
Test driver.

Parameters:
args - Command line arguments. A 256-bit binary key is generated from each argument.
Since:
1.1, 2002-04-13

makeKey

public static byte[] makeKey(java.lang.String pwd,
                             int n)
Generate a binary key from a password string. The password string is suitably scrambled to produce a binary key exactly n bytes long.

Parameters:
pwd - A string containing a password. This can be null or empty ("").
n - The length (in bytes) of the resulting binary key.
Returns:
An n-byte encryption/decryption key value.
Since:
1.1, 2002-04-13