Modifier and Type | Field and Description |
---|---|
private static int[] |
con_salt |
private static int[] |
cov_2char |
private static int |
ITERATIONS |
private static char[] |
saltChars |
private static boolean[] |
shifts2 |
private static int[][] |
skb |
private static int[][] |
SPtrans |
Constructor and Description |
---|
DESCrypt() |
Modifier and Type | Method and Description |
---|---|
private static int[] |
body(int[] schedule,
int Eswap0,
int Eswap1) |
private static int |
byteToUnsigned(byte b) |
java.lang.String |
crypt(java.lang.String original)
Encrypt a password given the cleartext password.
|
java.lang.String |
crypt(java.lang.String original,
java.lang.String salt)
Creates a UNIX/BSD/Linux-compatible hash value from a password String and a salt value.
|
private static int |
D_ENCRYPT(int L,
int R,
int S,
int E0,
int E1,
int[] s) |
private static int[] |
des_set_key(byte[] key) |
private static int |
fourBytesToInt(byte[] b,
int offset) |
private static int |
HPERM_OP(int a,
int n,
int m) |
private static void |
intToFourBytes(int iValue,
byte[] b,
int offset) |
private static void |
PERM_OP(int a,
int b,
int n,
int m,
int[] results) |
private static final int ITERATIONS
private static final char[] saltChars
private static final int[] con_salt
private static final boolean[] shifts2
private static final int[][] skb
private static final int[][] SPtrans
private static final int[] cov_2char
private static final int byteToUnsigned(byte b)
private static int fourBytesToInt(byte[] b, int offset)
private static final void intToFourBytes(int iValue, byte[] b, int offset)
private static final void PERM_OP(int a, int b, int n, int m, int[] results)
private static final int HPERM_OP(int a, int n, int m)
private static int[] des_set_key(byte[] key)
private static final int D_ENCRYPT(int L, int R, int S, int E0, int E1, int[] s)
private static final int[] body(int[] schedule, int Eswap0, int Eswap1)
public final java.lang.String crypt(java.lang.String original)
Encrypt a password given the cleartext password. This method generates a random salt using the 'java.security.SecureRandom' class.
crypt
in interface ICrypt
original
- The password to be encrypted.See John Dumas's Java Crypt page for the original source.
public final java.lang.String crypt(java.lang.String original, java.lang.String salt)
ICrypt
Copyright © 2023. All rights reserved.