Searched refs:salt (Results 1 - 25 of 33) sorted by relevance

12

/forgerock/openam/openam-shared/src/test/java/org/forgerock/openam/shared/security/crypto/
H A DPBKDF2KeyDerivationTest.java64 byte[] salt = new byte[16];
65 Arrays.fill(salt, (byte) 42);
67 final PBEKey key = keyDerivation.deriveSecretKey(128, salt.clone());
69 assertThat(key.getSalt()).isEqualTo(salt);
81 byte[] salt = new byte[16];
82 Arrays.fill(salt, (byte) 42);
84 final PBEKey key = keyDerivation.deriveSecretKey(128, salt.clone());
86 // Key derived via PBKDF2-HMAC-SHA1 with 10,000 iterations and fixed salt of 16 bytes of the literal 42.
/forgerock/openam/openam-shared/src/main/java/org/forgerock/openam/shared/security/crypto/
H A DPBKDF2KeyDerivation.java48 * (section 5.1.1.2) recommend at least 10,000 iterations of PBKDF2 and a salt of at least 32 bits. The PBKDF2 spec
49 * itself recommends a salt of at least 64 bits. We use a salt of 128 bits as per <a
97 * Derives a secret key of the requested size using a fresh random salt and the configured password and iteration
104 final byte[] salt = new byte[SALT_BYTES];
105 secureRandom.nextBytes(salt);
106 return deriveSecretKey(keySize, salt);
110 * Derives a secret key of the requested using using the given salt and the configured password and iteration count.
113 * @param salt the salt t
116 deriveSecretKey(int keySize, byte[] salt) argument
[all...]
H A DAESWrapEncryption.java51 * unique 128-bit random salt. This provides significantly improved security compared to just using the encryption
90 * {@code org.forgerock.openam.encryption.key.salt}, {@code org.forgerock.openam.encryption.key.iterations} and
91 * {@code org.forgerock.openam.encryption.key.size} to set the salt (no default, must be set), number of
142 DEBUG.error("AESWrapEncryption: invalid salt length {}", saltLen);
145 final byte[] salt = Arrays.copyOfRange(encData, 2, saltLen + 2);
146 final PBEKey encryptionKey = keyDerivation.deriveSecretKey(KEY_SIZE, salt);
164 * <li>A 1-byte salt length field.</li>
165 * <li>An n-byte salt value.</li>
175 final byte[] salt = key.getSalt();
176 if (salt
[all...]
/forgerock/opendj-b2.6/src/server/org/opends/server/util/
H A DBSDMD5Crypt.java79 * a random salt.
92 StringBuilder salt = new StringBuilder();
94 /* Generate some random salt */
95 while (salt.length() < saltLength)
98 salt.append(itoa64.charAt(index));
101 return BSDMD5Crypt.crypt(password, salt.toString());
106 * provided salt.
110 * @param salt A salt string of any size, of which only the first
118 static public String crypt(String password, String salt) argument
[all...]
H A DCrypt.java380 * salt.
383 * @param salt A salt array of any size, of which only the first
388 public byte[] crypt(byte[] pw, byte[] salt) argument
393 r = _crypt(pw, salt);
427 private int[] _crypt(byte[] pw, byte[] salt) argument
453 c = salt[i];
/forgerock/opendj2/src/server/org/opends/server/util/
H A DBSDMD5Crypt.java73 * a random salt.
86 StringBuilder salt = new StringBuilder();
88 /* Generate some random salt */
89 while (salt.length() < saltLength)
92 salt.append(itoa64.charAt(index));
95 return BSDMD5Crypt.crypt(password, salt.toString());
100 * provided salt.
104 * @param salt A salt string of any size, of which only the first
112 static public String crypt(ByteSequence password, String salt) argument
[all...]
H A DCrypt.java379 * salt.
382 * @param salt A salt array of any size, of which only the first
387 public byte[] crypt(byte[] pw, byte[] salt) argument
392 r = _crypt(pw, salt);
426 private int[] _crypt(byte[] pw, byte[] salt) argument
452 c = salt[i];
/forgerock/opendj2.6.2/src/server/org/opends/server/util/
H A DBSDMD5Crypt.java79 * a random salt.
92 StringBuilder salt = new StringBuilder();
94 /* Generate some random salt */
95 while (salt.length() < saltLength)
98 salt.append(itoa64.charAt(index));
101 return BSDMD5Crypt.crypt(password, salt.toString());
106 * provided salt.
110 * @param salt A salt string of any size, of which only the first
118 static public String crypt(String password, String salt) argument
[all...]
H A DCrypt.java380 * salt.
383 * @param salt A salt array of any size, of which only the first
388 public byte[] crypt(byte[] pw, byte[] salt) argument
393 r = _crypt(pw, salt);
427 private int[] _crypt(byte[] pw, byte[] salt) argument
453 c = salt[i];
/forgerock/opendj2-jel-hg/src/server/org/opends/server/util/
H A DBSDMD5Crypt.java79 * a random salt.
92 StringBuilder salt = new StringBuilder();
94 /* Generate some random salt */
95 while (salt.length() < saltLength)
98 salt.append(itoa64.charAt(index));
101 return BSDMD5Crypt.crypt(password, salt.toString());
106 * provided salt.
110 * @param salt A salt string of any size, of which only the first
118 static public String crypt(String password, String salt) argument
[all...]
H A DCrypt.java380 * salt.
383 * @param salt A salt array of any size, of which only the first
388 public byte[] crypt(byte[] pw, byte[] salt) argument
393 r = _crypt(pw, salt);
427 private int[] _crypt(byte[] pw, byte[] salt) argument
453 c = salt[i];
/forgerock/opendj2-hg/src/server/org/opends/server/util/
H A DBSDMD5Crypt.java73 * a random salt.
86 StringBuilder salt = new StringBuilder();
88 /* Generate some random salt */
89 while (salt.length() < saltLength)
92 salt.append(itoa64.charAt(index));
95 return BSDMD5Crypt.crypt(password, salt.toString());
100 * provided salt.
104 * @param salt A salt string of any size, of which only the first
112 static public String crypt(ByteSequence password, String salt) argument
[all...]
H A DCrypt.java379 * salt.
382 * @param salt A salt array of any size, of which only the first
387 public byte[] crypt(byte[] pw, byte[] salt) argument
392 r = _crypt(pw, salt);
426 private int[] _crypt(byte[] pw, byte[] salt) argument
452 c = salt[i];
/forgerock/opendj-v3/opendj-server-legacy/src/main/java/org/opends/server/util/
H A DBSDMD5Crypt.java73 * a random salt.
86 StringBuilder salt = new StringBuilder();
88 /* Generate some random salt */
89 while (salt.length() < saltLength)
92 salt.append(itoa64.charAt(index));
95 return BSDMD5Crypt.crypt(password, salt.toString());
100 * provided salt.
104 * @param salt A salt string of any size, of which only the first
112 public static String crypt(ByteSequence password, String salt) argument
[all...]
H A DCrypt.java386 * salt.
389 * @param salt A salt array of any size, of which only the first
393 public byte[] crypt(byte[] pw, byte[] salt) argument
398 r = _crypt(pw, salt);
427 private int[] _crypt(byte[] pw, byte[] salt) argument
451 int c = salt[i];
/forgerock/opendj2-jel-hg/src/server/org/opends/server/extensions/
H A DSunMd5Crypt.java125 private static int getrounds(byte[] salt) argument
127 if (salt == null || salt.length < ROUNDS.length())
131 String s = new String(salt);
141 byte c = salt[p];
183 // the old salt use that, otherwise keep what was in the old salt.
210 private static byte[] crypt_genhash_impl(byte[] plaintext, byte[] salt) argument
213 if (salt == null || plaintext == null)
231 // Extract the puresalt (if it exists) from the existing salt strin
391 encode(byte[] keyBytes, byte[] salt) argument
[all...]
H A DSha2Crypt.java214 * Generates a libc crypt() compatible "$5$" hash value with random salt.
234 * @param salt
235 * The real salt value without prefix or "rounds=".
239 public static String sha256Crypt(byte[] keyBytes, String salt) argument
241 if (salt == null) {
242 salt = SHA256_PREFIX + B64.getRandomSalt(8);
244 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
260 * The real salt value without prefix or "rounds=".
268 * @return The complete hash value including prefix and salt.
270 private static String sha2Crypt(byte[] keyBytes, String salt, argument
670 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]
H A DCryptPasswordStorageScheme.java83 * An array of values that can be used to create salt characters
157 * Return a random 2-byte salt.
159 * @return a random 2-byte salt
164 byte[] salt = new byte[2];
167 salt[0] = SALT_CHARS[sb1];
168 salt[1] = SALT_CHARS[sb2];
170 return salt;
310 // The salt is stored as the first two bytes of the storedPassword
313 byte[] salt = storedPassword.copyTo(new byte[2]);
315 ByteString.wrap(crypt.crypt(plaintextPasswordBytes, salt));
[all...]
/forgerock/opendj-b2.6/src/server/org/opends/server/extensions/
H A DSha2Crypt.java214 * Generates a libc crypt() compatible "$5$" hash value with random salt.
234 * @param salt
235 * The real salt value without prefix or "rounds=".
239 public static String sha256Crypt(byte[] keyBytes, String salt) argument
241 if (salt == null) {
242 salt = SHA256_PREFIX + B64.getRandomSalt(8);
244 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
260 * The real salt value without prefix or "rounds=".
268 * @return The complete hash value including prefix and salt.
270 private static String sha2Crypt(byte[] keyBytes, String salt, argument
670 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]
H A DCryptPasswordStorageScheme.java80 * An array of values that can be used to create salt characters
155 * Return a random 2-byte salt.
157 * @return a random 2-byte salt
162 byte[] salt = new byte[2];
165 salt[0] = SALT_CHARS[sb1];
166 salt[1] = SALT_CHARS[sb2];
168 return salt;
281 // The salt is stored as the first two bytes of the storedPassword
284 byte[] salt = storedPassword.copyTo(new byte[2]);
286 ByteString.wrap(crypt.crypt(plaintextPasswordBytes, salt));
[all...]
/forgerock/opendj2/src/server/org/opends/server/extensions/
H A DSha2Crypt.java213 * Generates a libc crypt() compatible "$5$" hash value with random salt.
233 * @param salt
234 * The real salt value without prefix or "rounds=".
238 public static String sha256Crypt(byte[] keyBytes, String salt) argument
240 if (salt == null) {
241 salt = SHA256_PREFIX + B64.getRandomSalt(8);
243 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
259 * The real salt value without prefix or "rounds=".
267 * @return The complete hash value including prefix and salt.
269 private static String sha2Crypt(byte[] keyBytes, String salt, argument
669 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]
/forgerock/opendj2.6.2/src/server/org/opends/server/extensions/
H A DSha2Crypt.java214 * Generates a libc crypt() compatible "$5$" hash value with random salt.
234 * @param salt
235 * The real salt value without prefix or "rounds=".
239 public static String sha256Crypt(byte[] keyBytes, String salt) argument
241 if (salt == null) {
242 salt = SHA256_PREFIX + B64.getRandomSalt(8);
244 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
260 * The real salt value without prefix or "rounds=".
268 * @return The complete hash value including prefix and salt.
270 private static String sha2Crypt(byte[] keyBytes, String salt, argument
670 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]
H A DCryptPasswordStorageScheme.java80 * An array of values that can be used to create salt characters
155 * Return a random 2-byte salt.
157 * @return a random 2-byte salt
162 byte[] salt = new byte[2];
165 salt[0] = SALT_CHARS[sb1];
166 salt[1] = SALT_CHARS[sb2];
168 return salt;
281 // The salt is stored as the first two bytes of the storedPassword
284 byte[] salt = storedPassword.copyTo(new byte[2]);
286 ByteString.wrap(crypt.crypt(plaintextPasswordBytes, salt));
[all...]
/forgerock/opendj2-hg/src/server/org/opends/server/extensions/
H A DSha2Crypt.java213 * Generates a libc crypt() compatible "$5$" hash value with random salt.
233 * @param salt
234 * The real salt value without prefix or "rounds=".
238 public static String sha256Crypt(byte[] keyBytes, String salt) argument
240 if (salt == null) {
241 salt = SHA256_PREFIX + B64.getRandomSalt(8);
243 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
259 * The real salt value without prefix or "rounds=".
267 * @return The complete hash value including prefix and salt.
269 private static String sha2Crypt(byte[] keyBytes, String salt, argument
669 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]
/forgerock/opendj-v3/opendj-server-legacy/src/main/java/org/opends/server/extensions/
H A DSha2Crypt.java213 * Generates a libc crypt() compatible "$5$" hash value with random salt.
233 * @param salt
234 * The real salt value without prefix or "rounds=".
238 public static String sha256Crypt(byte[] keyBytes, String salt) argument
240 if (salt == null) {
241 salt = SHA256_PREFIX + B64.getRandomSalt(8);
243 return sha2Crypt(keyBytes, salt, SHA256_PREFIX, SHA256_BLOCKSIZE,
259 * The real salt value without prefix or "rounds=".
267 * @return The complete hash value including prefix and salt.
269 private static String sha2Crypt(byte[] keyBytes, String salt, argument
669 sha512Crypt(byte[] keyBytes, String salt) argument
[all...]

Completed in 118 milliseconds

12