public static String crypt(String user, String pw) { return __TYPE + UnixCrypt.crypt(pw, user); } }
long[] KS = des_setkey(keyword); long rsltblock = des_cipher(constdatablock, salt, 25, KS);
salt = to_six_bit(salt); long L = in; long R = L; L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL)); L = perm3264((int) (L >> 32), IE3264); R = perm3264((int) (L & 0xffffffff), IE3264); L = perm6464(L, CF6464);
/** * Returns the key schedule for the given key. */ private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = K & ~0x0303030300000000L; for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[Rotates[i] - 1]); KS[i] = K & ~0x0303030300000000L; } return KS; }
/** * Returns the key schedule for the given key. */ private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = K & ~0x0303030300000000L; for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[Rotates[i] - 1]); KS[i] = K & ~0x0303030300000000L; } return KS; }
salt = to_six_bit(salt); long L = in; long R = L; L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL)); L = perm3264((int) (L >> 32), IE3264); R = perm3264((int) (L & 0xffffffff), IE3264); L = perm6464(L, CF6464);
long[] KS = des_setkey(keyword); long rsltblock = des_cipher(constdatablock, salt, 25, KS);
public static void main(String[] arg) { if (arg.length != 2) { System.err.println("Usage - java org.eclipse.util.UnixCrypt <key> <salt>"); System.exit(1); } System.err.println("Crypt=" + crypt(arg[0], arg[1])); }
/** * Returns the key schedule for the given key. */ private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = K & ~0x0303030300000000L; for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[Rotates[i] - 1]); KS[i] = K & ~0x0303030300000000L; } return KS; }
salt = to_six_bit(salt); long L = in; long R = L; L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL)); L = perm3264((int) (L >> 32), IE3264); R = perm3264((int) (L & 0xffffffff), IE3264); L = perm6464(L, CF6464);
long[] KS = des_setkey(keyword); long rsltblock = des_cipher(constdatablock, salt, 25, KS);
@Override public boolean check(Object credentials) { if (credentials instanceof char[]) credentials = new String((char[])credentials); if (!(credentials instanceof String) && !(credentials instanceof Password)) LOG.warn("Can't check " + credentials.getClass() + " against CRYPT"); return stringEquals(_cooked, UnixCrypt.crypt(credentials.toString(),_cooked)); }
/** * Returns the key schedule for the given key. */ private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = K & ~0x0303030300000000L; for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[Rotates[i] - 1]); KS[i] = K & ~0x0303030300000000L; } return KS; }
salt = to_six_bit(salt); long L = in; long R = L; L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL)); L = perm3264((int) (L >> 32), IE3264); R = perm3264((int) (L & 0xffffffff), IE3264); L = perm6464(L, CF6464);
long[] KS = des_setkey(keyword); long rsltblock = des_cipher(constdatablock, salt, 25, KS);
public static String crypt(String user, String pw) { return "CRYPT:" + UnixCrypt.crypt(pw, user); } }
/** * Returns the key schedule for the given key. */ private static long[] des_setkey(long keyword) { long K = perm6464(keyword, PC1ROT); long[] KS = new long[16]; KS[0] = K & ~0x0303030300000000L; for (int i = 1; i < 16; i++) { KS[i] = K; K = perm6464(K, PC2ROT[Rotates[i] - 1]); KS[i] = K & ~0x0303030300000000L; } return KS; }
salt = to_six_bit(salt); long L = in; long R = L; L = ((((L << 1) | (L << 32)) & 0xffffffff00000000L) | ((R | (R >> 32)) & 0x00000000ffffffffL)); L = perm3264((int) (L >> 32), IE3264); R = perm3264((int) (L & 0xffffffff), IE3264); L = perm6464(L, CF6464);
long[] KS = des_setkey(keyword); long rsltblock = des_cipher(constdatablock, salt, 25, KS);
public static String crypt(String user, String pw) { return "CRYPT:" + UnixCrypt.crypt(pw, user); } }