AXL Software

com.theorem.radserver3.radutil
Class Boojum

Object
  extended byBoojum

public final class Boojum
extends Object

A Boojum for keeping secrets. (Boojum - possibly a metaphor for transforming) from the poem "The Hunting of the Snark" by Lewis Carroll.

This is described in "Practical Cryptography" by Niels Ferguson and Bruce Schneier. It doesn't hold the secret value but the mask and XOR'd value of the secret. Each few times the getSecret() is called the boojum is recalculated. Intermediate values are cleared before being released to the garbage collector.

The idea is to keep computer memory from imprinting secret values in memory. While this boojum half adheres to that idea it's job is to make a secret a little hard to find by scanning for it's plain text value.


Constructor Summary
Boojum(byte[] secret)
          Constructor.
 
Method Summary
 void clear()
          Clear the boojum value.
 byte[] getSecret()
          Get the secret bytes.
 char[] getSecretChars()
          Get the secret as an array of characters.
static void main(String[] a)
          Test of the Boojum.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Boojum

public Boojum(byte[] secret)
Constructor.

Parameters:
secret - Secret.
Method Detail

clear

public void clear()
Clear the boojum value.


getSecret

public byte[] getSecret()
Get the secret bytes.

Returns:
the secret.

getSecretChars

public char[] getSecretChars()
Get the secret as an array of characters.

Returns:
the secret.

main

public static void main(String[] a)
Test of the Boojum. Provide a secret to Boojem. The boojum will be created and then be processed twice. The values printed should be identical to the original secret.


AXL Software

Submit a bug report or feature request

Copyright 1998-2010 AXL Software PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.