diff --git a/core/src/main/java/org/bouncycastle/crypto/generators/BCrypt.java b/core/src/main/java/org/bouncycastle/crypto/generators/BCrypt.java index f065056b8b..55f1bfcf51 100644 --- a/core/src/main/java/org/bouncycastle/crypto/generators/BCrypt.java +++ b/core/src/main/java/org/bouncycastle/crypto/generators/BCrypt.java @@ -616,10 +616,10 @@ public static byte[] passwordToByteArray(char[] password) /** * Calculates the bcrypt hash of an input - note for processing general passwords you want to - * make sure the password is terminated in a manner similar to what is done by passwordToByteArray(). + * make sure the password is terminated in a manner similar to what is done by {@link #passwordToByteArray(char[])}. *

* This implements the raw bcrypt function as defined in the bcrypt specification, not - * the crypt encoded version implemented in OpenBSD. + * the crypt encoded version implemented in OpenBSD, see {@link OpenBSDBCrypt} for that. *

* @param pwInput the password bytes (up to 72 bytes) to use for this invocation. * @param salt the 128 bit salt to use for this invocation. diff --git a/core/src/main/java/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java b/core/src/main/java/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java index 3667835551..9c8a708c50 100644 --- a/core/src/main/java/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java +++ b/core/src/main/java/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java @@ -12,7 +12,10 @@ * Password hashing scheme BCrypt, * designed by Niels Provos and David Mazières, using the * String format and the Base64 encoding - * of the reference implementation on OpenBSD + * of the reference implementation on OpenBSD. + *

+ * Passwords are encoded using UTF-8. Encoded passwords longer than + * 72 bytes are truncated and all remaining bytes are ignored. */ public class OpenBSDBCrypt { diff --git a/core/src/main/jdk1.4/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java b/core/src/main/jdk1.4/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java index 8edec5c8d4..dc8424c0e2 100644 --- a/core/src/main/jdk1.4/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java +++ b/core/src/main/jdk1.4/org/bouncycastle/crypto/generators/OpenBSDBCrypt.java @@ -12,7 +12,10 @@ * Password hashing scheme BCrypt, * designed by Niels Provos and David Mazières, using the * String format and the Base64 encoding - * of the reference implementation on OpenBSD + * of the reference implementation on OpenBSD. + *

+ * Passwords are encoded using UTF-8. Encoded passwords longer than + * 72 bytes are truncated and all remaining bytes are ignored. */ public class OpenBSDBCrypt {