Fix the whole Javadoc syntax
This commit is contained in:
@@ -13,56 +13,57 @@
|
||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
package fr.xephi.authme.security.crypts;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.security.crypts.description.HasSalt;
|
||||
import fr.xephi.authme.security.crypts.description.Usage;
|
||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||
import fr.xephi.authme.security.crypts.description.SaltType;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.security.crypts.description.HasSalt;
|
||||
import fr.xephi.authme.security.crypts.description.Recommendation;
|
||||
import fr.xephi.authme.security.crypts.description.SaltType;
|
||||
import fr.xephi.authme.security.crypts.description.Usage;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* BCrypt implements OpenBSD-style Blowfish password hashing using the scheme
|
||||
* described in "A Future-Adaptable Password Scheme" by Niels Provos and David
|
||||
* Mazieres.
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* This password hashing system tries to thwart off-line password cracking using
|
||||
* a computationally-intensive hashing algorithm, based on Bruce Schneier's
|
||||
* Blowfish cipher. The work factor of the algorithm is parameterised, so it can
|
||||
* be increased as computers get faster.
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* Usage is really simple. To hash a password for the first time, call the
|
||||
* hashpw method with a random salt, like this:
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* <code>
|
||||
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); <br />
|
||||
* String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); <br>
|
||||
* </code>
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* To check whether a plaintext password matches one that has been hashed
|
||||
* previously, use the checkpw method:
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* <code>
|
||||
* if (BCrypt.checkpw(candidate_password, stored_hash))<br />
|
||||
* System.out.println("It matches");<br />
|
||||
* else<br />
|
||||
* System.out.println("It does not match");<br />
|
||||
* if (BCrypt.checkpw(candidate_password, stored_hash))<br>
|
||||
* System.out.println("It matches");<br>
|
||||
* else<br>
|
||||
* System.out.println("It does not match");<br>
|
||||
* </code>
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* The gensalt() method takes an optional parameter (log_rounds) that determines
|
||||
* the computational complexity of the hashing:
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* <code>
|
||||
* String strong_salt = BCrypt.gensalt(10)<br />
|
||||
* String stronger_salt = BCrypt.gensalt(12)<br />
|
||||
* String strong_salt = BCrypt.gensalt(10)<br>
|
||||
* String stronger_salt = BCrypt.gensalt(12)<br>
|
||||
* </code>
|
||||
* <p/>
|
||||
* </p><p>
|
||||
* The amount of work increases exponentially (2**log_rounds), so each increment
|
||||
* is twice as much work. The default log_rounds is 10, and the valid range is 4
|
||||
* to 31.
|
||||
*
|
||||
* </p>
|
||||
* @author Damien Miller
|
||||
* @version 0.2
|
||||
*/
|
||||
|
||||
@@ -241,8 +241,9 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
||||
*
|
||||
* @param source plaintext data to hash.
|
||||
* @param sourceBits how many bits of plaintext to process.
|
||||
* <p/>
|
||||
* This method maintains the invariant: bufferBits < 512
|
||||
* <p>
|
||||
* This method maintains the invariant: bufferBits < 512
|
||||
* </p>
|
||||
*/
|
||||
public void NESSIEadd(byte[] source, long sourceBits) {
|
||||
/*
|
||||
@@ -322,10 +323,12 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Get the hash value from the hashing state.
|
||||
* <p/>
|
||||
* This method uses the invariant: bufferBits < 512
|
||||
*
|
||||
* </p>
|
||||
* <p>
|
||||
* This method uses the invariant: bufferBits < 512
|
||||
* </p>
|
||||
* @param digest byte[]
|
||||
*/
|
||||
public void NESSIEfinalize(byte[] digest) {
|
||||
@@ -367,7 +370,7 @@ public class WHIRLPOOL extends UnsaltedMethod {
|
||||
* Delivers string input data to the hashing algorithm.
|
||||
*
|
||||
* @param source plaintext data to hash (ASCII text string).
|
||||
* This method maintains the invariant: bufferBits < 512
|
||||
* This method maintains the invariant: bufferBits < 512
|
||||
*/
|
||||
public void NESSIEadd(String source) {
|
||||
if (source.length() > 0) {
|
||||
|
||||
@@ -13,10 +13,14 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface HasSalt {
|
||||
|
||||
/** The type of the salt. */
|
||||
/** The type of the salt.
|
||||
* @return salttype The SaltType
|
||||
*/
|
||||
SaltType value();
|
||||
|
||||
/** For text salts, the length of the salt. */
|
||||
/** For text salts, the length of the salt.
|
||||
* @return int Integer
|
||||
*/
|
||||
int length() default 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ import java.lang.annotation.Target;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Recommendation {
|
||||
|
||||
/** The recommendation for using the hash algorithm. */
|
||||
/** The recommendation for using the hash algorithm.
|
||||
* @return Usage The Usage
|
||||
*/
|
||||
Usage value();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user