org.mindrot.jbcrypt.BCrypt.streamtoword()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.mindrot.jbcrypt.BCrypt.streamtoword()方法的一些代码示例,展示了BCrypt.streamtoword()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BCrypt.streamtoword()方法的具体详情如下:
包路径:org.mindrot.jbcrypt.BCrypt
类名称:BCrypt
方法名:streamtoword

BCrypt.streamtoword介绍

[英]Cycically extract a word of key material
[中]循环提取关键材料的单词

代码示例

代码示例来源:origin: hierynomus/sshj

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: hierynomus/sshj

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: de.svenkubiak/jBCrypt

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.actframework/act

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: actframework/actframework

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.mindrot/jbcrypt

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: com.hierynomus/sshj

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.connectbot.jbcrypt/jbcrypt

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data    salt information
 * @param key    password information
 */
private void ekskey(byte data[], byte key[]) {
  int i;
  int koffp[] = { 0 }, doffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    lr[0] ^= streamtoword(data, doffp);
    lr[1] ^= streamtoword(data, doffp);
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: rogerta/secrets-for-android

/**
 * Perform the "enhanced key schedule" step described by
 * Provos and Mazieres in "A Future-Adaptable Password Scheme"
 * http://www.openbsd.org/papers/bcrypt-paper.ps
 * @param data  salt information
 * @param key password information
 */
private void ekskey(byte data[], byte key[]) {
 int i;
 int koffp[] = { 0 }, doffp[] = { 0 };
 int lr[] = { 0, 0 };
 int plen = P.length, slen = S.length;
 for (i = 0; i < plen; i++)
  P[i] = P[i] ^ streamtoword(key, koffp);
 for (i = 0; i < plen; i += 2) {
  lr[0] ^= streamtoword(data, doffp);
  lr[1] ^= streamtoword(data, doffp);
  encipher(lr, 0);
  P[i] = lr[0];
  P[i + 1] = lr[1];
 }
 for (i = 0; i < slen; i += 2) {
  lr[0] ^= streamtoword(data, doffp);
  lr[1] ^= streamtoword(data, doffp);
  encipher(lr, 0);
  S[i] = lr[0];
  S[i + 1] = lr[1];
 }
}

代码示例来源:origin: rogerta/secrets-for-android

/**
 * Key the Blowfish cipher
 * @param key an array containing the key
 */
private void key(byte key[]) {
 int i;
 int koffp[] = { 0 };
 int lr[] = { 0, 0 };
 int plen = P.length, slen = S.length;
 for (i = 0; i < plen; i++)
  P[i] = P[i] ^ streamtoword(key, koffp);
 for (i = 0; i < plen; i += 2) {
  encipher(lr, 0);
  P[i] = lr[0];
  P[i + 1] = lr[1];
 }
 for (i = 0; i < slen; i += 2) {
  encipher(lr, 0);
  S[i] = lr[0];
  S[i + 1] = lr[1];
 }
}

代码示例来源:origin: actframework/actframework

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.mindrot/jbcrypt

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: com.hierynomus/sshj

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: de.svenkubiak/jBCrypt

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.actframework/act

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

代码示例来源:origin: org.connectbot.jbcrypt/jbcrypt

/**
 * Key the Blowfish cipher
 * @param key    an array containing the key
 */
private void key(byte key[]) {
  int i;
  int koffp[] = { 0 };
  int lr[] = { 0, 0 };
  int plen = P.length, slen = S.length;
  for (i = 0; i < plen; i++)
    P[i] = P[i] ^ streamtoword(key, koffp);
  for (i = 0; i < plen; i += 2) {
    encipher(lr, 0);
    P[i] = lr[0];
    P[i + 1] = lr[1];
  }
  for (i = 0; i < slen; i += 2) {
    encipher(lr, 0);
    S[i] = lr[0];
    S[i + 1] = lr[1];
  }
}

相关文章