public class UnixCrypt
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static byte[] |
A64TOI |
private static long[][] |
CF6464 |
private static byte[] |
CIFP |
private static byte[] |
ExpandTr |
private static long[][] |
IE3264 |
private static byte[] |
IP |
private static byte[] |
ITOA64 |
private static byte[] |
P32Tr |
private static byte[] |
PC1 |
private static long[][] |
PC1ROT |
private static byte[] |
PC2 |
private static long[][][] |
PC2ROT |
private static byte[] |
Rotates |
private static byte[][] |
S |
private static long[][] |
SPE |
Modifier | Constructor and Description |
---|---|
private |
UnixCrypt()
You can't call the constructer.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
crypt(java.lang.String key,
java.lang.String setting)
Encrypts String into crypt (Unix) code.
|
private static long |
des_cipher(long in,
int salt,
int num_iter,
long[] KS)
Returns the DES encrypted code of the given word with the specified
environment.
|
private static long[] |
des_setkey(long keyword)
Returns the key schedule for the given key.
|
private static void |
init_perm(long[][] perm,
byte[] p,
int chars_out)
Initializes the given permutation table with the mapping table.
|
static void |
main(java.lang.String[] arg) |
private static long |
perm3264(int c,
long[][] p)
Returns the permutation of the given 32-bit code with the specified
permutataion table.
|
private static long |
perm6464(long c,
long[][] p)
Returns the permutation of the given 64-bit code with the specified
permutataion table.
|
private static int |
to_six_bit(int num)
Returns the transposed and split code of a 24-bit code into a 4-byte
code, each having 6 bits.
|
private static long |
to_six_bit(long num)
Returns the transposed and split code of two 24-bit code into two 4-byte
code, each having 6 bits.
|
private static final byte[] IP
private static final byte[] ExpandTr
private static final byte[] PC1
private static final byte[] Rotates
private static final byte[] PC2
private static final byte[][] S
private static final byte[] P32Tr
private static final byte[] CIFP
private static final byte[] ITOA64
private static final byte[] A64TOI
private static final long[][] PC1ROT
private static final long[][][] PC2ROT
private static final long[][] IE3264
private static final long[][] SPE
private static final long[][] CF6464
private static int to_six_bit(int num)
private static long to_six_bit(long num)
private static long perm6464(long c, long[][] p)
private static long perm3264(int c, long[][] p)
private static long[] des_setkey(long keyword)
private static long des_cipher(long in, int salt, int num_iter, long[] KS)
private static void init_perm(long[][] perm, byte[] p, int chars_out)
public static java.lang.String crypt(java.lang.String key, java.lang.String setting)
key
- the key to be encryptedsetting
- the salt to be usedpublic static void main(java.lang.String[] arg)