standard javadoc

This commit is contained in:
Gabriele C
2015-11-21 01:31:18 +01:00
parent 118c79401a
commit bd1f868c6d
94 changed files with 1176 additions and 1174 deletions
@@ -94,7 +94,8 @@ public class BCRYPT implements EncryptionMethod {
* @param len the number of bytes to encode
* @return base64-encoded string * @throws IllegalArgumentException if the length is invalid */
* @return base64-encoded string * @throws IllegalArgumentException if the length is invalid * @throws IllegalArgumentException
*/
private static String encode_base64(byte d[], int len)
throws IllegalArgumentException {
int off = 0;
@@ -150,7 +151,8 @@ public class BCRYPT implements EncryptionMethod {
* @param maxolen the maximum number of bytes to decode
* @return an array containing the decoded bytes * @throws IllegalArgumentException if maxolen is invalid */
* @return an array containing the decoded bytes * @throws IllegalArgumentException if maxolen is invalid * @throws IllegalArgumentException
*/
private static byte[] decode_base64(String s, int maxolen)
throws IllegalArgumentException {
StringBuffer rs = new StringBuffer();
@@ -474,8 +476,8 @@ public class BCRYPT implements EncryptionMethod {
* @param hashed the previously-hashed password
* @param rounds number of rounds to hash the password
* @return boolean
*/
* @return boolean */
public static boolean checkpw(String text, String hashed, int rounds) {
boolean matched = false;
@@ -499,10 +501,10 @@ public class BCRYPT implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -514,10 +516,10 @@ public class BCRYPT implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -528,8 +530,8 @@ public class BCRYPT implements EncryptionMethod {
* Method getDoubleHash.
* @param text String
* @param salt String
* @return String
*/
* @return String */
public static String getDoubleHash(String text, String salt) {
String hash = hashpw(text, salt);
return hashpw(text, hash);
@@ -11,10 +11,10 @@ public class BCRYPT2Y implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class BCRYPT2Y implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -16,10 +16,10 @@ public class CRAZYCRYPT1 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -36,10 +36,7 @@ public class CRAZYCRYPT1 implements EncryptionMethod {
* Method comparePassword.
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
* @param playerName Stringooleaneptiontring) * @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
@Override
@@ -49,8 +46,7 @@ public class CRAZYCRYPT1 implements EncryptionMethod {
}
/**
* Method byteArrayToHexString.
* @param args byte[]
* @return String
* @param args byte[]String * @return String
*/
public static String byteArrayToHexString(final byte... args) {
@@ -14,10 +14,10 @@ public class CryptPBKDF2 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -33,10 +33,10 @@ public class CryptPBKDF2 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -16,10 +16,10 @@ public class CryptPBKDF2Django implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -35,10 +35,10 @@ public class CryptPBKDF2Django implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -13,10 +13,10 @@ public class DOUBLEMD5 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class DOUBLEMD5 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -41,9 +41,9 @@ public class DOUBLEMD5 implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -26,7 +26,8 @@ public interface EncryptionMethod {
* @param name String
* @return Hashing password * @throws NoSuchAlgorithmException */
* @return Hashing password * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
*/
String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException;
@@ -36,7 +37,8 @@ public interface EncryptionMethod {
* @param playerName
* @return true if password match, false else * @throws NoSuchAlgorithmException */
* @return true if password match, false else * @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
*/
boolean comparePassword(String hash, String password, String playerName)
throws NoSuchAlgorithmException;
@@ -15,10 +15,10 @@ public class IPB3 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -30,10 +30,10 @@ public class IPB3 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -44,9 +44,9 @@ public class IPB3 implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -13,10 +13,10 @@ public class JOOMLA implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class JOOMLA implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -42,9 +42,9 @@ public class JOOMLA implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -13,10 +13,10 @@ public class MD5 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class MD5 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -41,9 +41,9 @@ public class MD5 implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -13,10 +13,10 @@ public class MD5VB implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class MD5VB implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -42,9 +42,9 @@ public class MD5VB implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -15,10 +15,10 @@ public class MYBB implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -30,10 +30,10 @@ public class MYBB implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -44,9 +44,9 @@ public class MYBB implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -21,8 +21,8 @@ public class PHPBB implements EncryptionMethod {
* Method phpbb_hash.
* @param password String
* @param salt String
* @return String
*/
* @return String */
public String phpbb_hash(String password, String salt) {
String random_state = salt;
StringBuilder random = new StringBuilder();
@@ -42,8 +42,8 @@ public class PHPBB implements EncryptionMethod {
* Method _hash_gensalt_private.
* @param input String
* @param itoa64 String
* @return String
*/
* @return String */
private String _hash_gensalt_private(String input, String itoa64) {
return _hash_gensalt_private(input, itoa64, 6);
}
@@ -53,8 +53,8 @@ public class PHPBB implements EncryptionMethod {
* @param input String
* @param itoa64 String
* @param iteration_count_log2 int
* @return String
*/
* @return String */
private String _hash_gensalt_private(String input, String itoa64,
int iteration_count_log2) {
if (iteration_count_log2 < 4 || iteration_count_log2 > 31) {
@@ -70,8 +70,8 @@ public class PHPBB implements EncryptionMethod {
* Encode hash
* @param input String
* @param count int
* @return String
*/
* @return String */
private String _hash_encode64(String input, int count) {
StringBuilder output = new StringBuilder();
int i = 0;
@@ -97,8 +97,8 @@ public class PHPBB implements EncryptionMethod {
* Method _hash_crypt_private.
* @param password String
* @param setting String
* @return String
*/
* @return String */
String _hash_crypt_private(String password, String setting) {
String output = "*";
if (!setting.substring(0, 3).equals("$H$"))
@@ -124,8 +124,8 @@ public class PHPBB implements EncryptionMethod {
* Method phpbb_check_hash.
* @param password String
* @param hash String
* @return boolean
*/
* @return boolean */
public boolean phpbb_check_hash(String password, String hash) {
if (hash.length() == 34)
return _hash_crypt_private(password, hash).equals(hash);
@@ -135,8 +135,8 @@ public class PHPBB implements EncryptionMethod {
/**
* Method md5.
* @param data String
* @return String
*/
* @return String */
public static String md5(String data) {
try {
byte[] bytes = data.getBytes("ISO-8859-1");
@@ -151,8 +151,8 @@ public class PHPBB implements EncryptionMethod {
/**
* Method hexToInt.
* @param ch char
* @return int
*/
* @return int */
static int hexToInt(char ch) {
if (ch >= '0' && ch <= '9')
return ch - '0';
@@ -165,8 +165,8 @@ public class PHPBB implements EncryptionMethod {
/**
* Method bytes2hex.
* @param bytes byte[]
* @return String
*/
* @return String */
private static String bytes2hex(byte[] bytes) {
StringBuilder r = new StringBuilder(32);
for (byte b : bytes) {
@@ -181,8 +181,8 @@ public class PHPBB implements EncryptionMethod {
/**
* Method pack.
* @param hex String
* @return String
*/
* @return String */
static String pack(String hex) {
StringBuilder buf = new StringBuilder();
for (int i = 0; i < hex.length(); i += 2) {
@@ -199,10 +199,10 @@ public class PHPBB implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -214,10 +214,10 @@ public class PHPBB implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -20,10 +20,10 @@ public class PHPFUSION implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -56,10 +56,10 @@ public class PHPFUSION implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -70,9 +70,9 @@ public class PHPFUSION implements EncryptionMethod {
/**
* Method getSHA1.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA1(String message)
throws NoSuchAlgorithmException {
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
@@ -11,10 +11,10 @@ public class PLAINTEXT implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -26,10 +26,10 @@ public class PLAINTEXT implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -12,10 +12,10 @@ public class ROYALAUTH implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,9 +28,9 @@ public class ROYALAUTH implements EncryptionMethod {
* Method hash.
* @param password String
* @param salt String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
public String hash(String password, String salt)
throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-512");
@@ -47,10 +47,10 @@ public class ROYALAUTH implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -15,10 +15,10 @@ public class SALTED2MD5 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -30,10 +30,10 @@ public class SALTED2MD5 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -44,9 +44,9 @@ public class SALTED2MD5 implements EncryptionMethod {
/**
* Method getMD5.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getMD5(String message)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -15,10 +15,10 @@ public class SALTEDSHA512 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -30,10 +30,10 @@ public class SALTEDSHA512 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -44,9 +44,9 @@ public class SALTEDSHA512 implements EncryptionMethod {
/**
* Method getSHA512.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA512(String message)
throws NoSuchAlgorithmException {
MessageDigest sha512 = MessageDigest.getInstance("SHA-512");
@@ -13,10 +13,10 @@ public class SHA1 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class SHA1 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -41,9 +41,9 @@ public class SHA1 implements EncryptionMethod {
/**
* Method getSHA1.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA1(String message)
throws NoSuchAlgorithmException {
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
@@ -13,10 +13,10 @@ public class SHA256 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class SHA256 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -42,9 +42,9 @@ public class SHA256 implements EncryptionMethod {
/**
* Method getSHA256.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA256(String message)
throws NoSuchAlgorithmException {
MessageDigest sha256 = MessageDigest.getInstance("SHA-256");
@@ -13,10 +13,10 @@ public class SHA512 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class SHA512 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -41,9 +41,9 @@ public class SHA512 implements EncryptionMethod {
/**
* Method getSHA512.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA512(String message)
throws NoSuchAlgorithmException {
MessageDigest sha512 = MessageDigest.getInstance("SHA-512");
@@ -13,10 +13,10 @@ public class SMF implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class SMF implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -41,9 +41,9 @@ public class SMF implements EncryptionMethod {
/**
* Method getSHA1.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA1(String message)
throws NoSuchAlgorithmException {
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
@@ -15,10 +15,10 @@ public class WBB3 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -30,10 +30,10 @@ public class WBB3 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -44,9 +44,9 @@ public class WBB3 implements EncryptionMethod {
/**
* Method getSHA1.
* @param message String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
private static String getSHA1(String message)
throws NoSuchAlgorithmException {
MessageDigest sha1 = MessageDigest.getInstance("SHA1");
@@ -11,10 +11,10 @@ public class WBB4 implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -26,10 +26,10 @@ public class WBB4 implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -379,8 +379,8 @@ public class WHIRLPOOL implements EncryptionMethod {
/**
* Method display.
* @param array byte[]
* @return String
*/
* @return String */
protected static String display(byte[] array) {
char[] val = new char[2 * array.length];
String hex = "0123456789ABCDEF";
@@ -397,10 +397,10 @@ public class WHIRLPOOL implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -416,10 +416,10 @@ public class WHIRLPOOL implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -17,8 +17,8 @@ public class WORDPRESS implements EncryptionMethod {
* Method encode64.
* @param src byte[]
* @param count int
* @return String
*/
* @return String */
private String encode64(byte[] src, int count) {
int i, value;
StringBuilder output = new StringBuilder();
@@ -57,8 +57,8 @@ public class WORDPRESS implements EncryptionMethod {
* Method crypt.
* @param password String
* @param setting String
* @return String
*/
* @return String */
private String crypt(String password, String setting) {
String output = "*0";
if (((setting.length() < 2) ? setting : setting.substring(0, 2)).equalsIgnoreCase(output)) {
@@ -100,8 +100,8 @@ public class WORDPRESS implements EncryptionMethod {
/**
* Method gensaltPrivate.
* @param input byte[]
* @return String
*/
* @return String */
private String gensaltPrivate(byte[] input) {
String output = "$P$";
int iterationCountLog2 = 8;
@@ -113,8 +113,8 @@ public class WORDPRESS implements EncryptionMethod {
/**
* Method stringToUtf8.
* @param string String
* @return byte[]
*/
* @return byte[] */
private byte[] stringToUtf8(String string) {
try {
return string.getBytes("UTF-8");
@@ -128,10 +128,10 @@ public class WORDPRESS implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -145,10 +145,10 @@ public class WORDPRESS implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -11,10 +11,10 @@ public class XAUTH implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -28,10 +28,10 @@ public class XAUTH implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -43,8 +43,8 @@ public class XAUTH implements EncryptionMethod {
/**
* Method getWhirlpool.
* @param message String
* @return String
*/
* @return String */
public static String getWhirlpool(String message) {
WHIRLPOOL w = new WHIRLPOOL();
byte[] digest = new byte[WHIRLPOOL.DIGESTBYTES];
@@ -18,10 +18,10 @@ public class XF implements EncryptionMethod {
* @param password String
* @param salt String
* @param name String
* @return String
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String)
*/
* @return String * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#getHash(String, String, String) */
@Override
public String getHash(String password, String salt, String name)
throws NoSuchAlgorithmException {
@@ -33,10 +33,10 @@ public class XF implements EncryptionMethod {
* @param hash String
* @param password String
* @param playerName String
* @return boolean
* @throws NoSuchAlgorithmException
* @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String) */
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
@@ -47,9 +47,9 @@ public class XF implements EncryptionMethod {
/**
* Method getSHA256.
* @param password String
* @return String
* @throws NoSuchAlgorithmException
*/
* @return String * @throws NoSuchAlgorithmException */
public String getSHA256(String password) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(password.getBytes());
@@ -73,8 +73,8 @@ public class XF implements EncryptionMethod {
* Method regmatch.
* @param pattern String
* @param line String
* @return String
*/
* @return String */
public String regmatch(String pattern, String line) {
List<String> allMatches = new ArrayList<>();
Matcher m = Pattern.compile(pattern).matcher(line);