anvil.core.crypto
Class Crypt

java.lang.Object
  |
  +--anvil.core.crypto.Crypt

public class Crypt
extends java.lang.Object

Crypt is the class, that implements UFC crypt (ultra fast crypt implementation ) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. JAVA version.

Author:
Michael Glad (glad@daimi.aau.dk)
, Pawel Veselov (vps@phoenix.math.spbu.ru)

Constructor Summary
Crypt()
           
 
Method Summary
static java.lang.String crypt(byte[] salt, byte[] original)
          crypt function.
static java.lang.String crypt(byte[] salt, java.lang.String original)
          crypt function
static java.lang.String crypt(java.lang.String salt, java.lang.String original)
          crypt function.
static void initDes()
          Initialze unit - may be invoked directly by user.
static boolean selfTest(boolean show)
          This method test crypt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Crypt

public Crypt()
Method Detail

selfTest

public static boolean selfTest(boolean show)
This method test crypt.

Parameters:
show - if it is true, print test results to err stream
Returns:
true, if test succeeded, false if failed.

crypt

public static java.lang.String crypt(byte[] salt,
                                     byte[] original)
crypt function.

Parameters:
salt - two byte array with salt.
original - array, maximum 8 bytes, string to encrypt

crypt

public static java.lang.String crypt(java.lang.String salt,
                                     java.lang.String original)
crypt function.

Parameters:
salt - String, maximum length is 2 with salt.
original - String, maximum 8 bytes, string to encrypt

crypt

public static java.lang.String crypt(byte[] salt,
                                     java.lang.String original)
crypt function

Parameters:
salt - Two bytes array with salt
original - String, maximum 8 characters, string to encrypt

initDes

public static void initDes()
Initialze unit - may be invoked directly by user. Anyway it is invoked automatically from crypt()