public static void encryptChallenge(byte[] challenge, String passwd) {
    byte[] key = new byte[8];
    for (int i = 0; i < 8 && i < passwd.length(); i++) {
      key[i] = (byte)passwd.charAt(i);
    }

    DesCipher des = new DesCipher(key);

    for (int j = 0; j < CHALLENGE_SIZE; j += 8)
      des.encrypt(challenge, j, challenge, j);
  }