aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/elytrium/limboauth
diff options
context:
space:
mode:
authorPetr Ilin <hevav@hevav.dev>2022-04-01 00:27:29 +0300
committerPetr Ilin <hevav@hevav.dev>2022-04-01 00:27:29 +0300
commit0b79ceba393e0b592fa12d0c1be98a5b403965f9 (patch)
tree66df3277d55b944e84556ce483d25aeafc35a221 /src/main/java/net/elytrium/limboauth
parentd8ed7d80a2f2cea05161ff5c027e434d78380807 (diff)
downloadLimboAuth-0b79ceba393e0b592fa12d0c1be98a5b403965f9.tar.gz
LimboAuth-0b79ceba393e0b592fa12d0c1be98a5b403965f9.tar.bz2
LimboAuth-0b79ceba393e0b592fa12d0c1be98a5b403965f9.zip
More migration hashes
Diffstat (limited to 'src/main/java/net/elytrium/limboauth')
-rw-r--r--src/main/java/net/elytrium/limboauth/Settings.java8
-rw-r--r--src/main/java/net/elytrium/limboauth/migration/MigrationHash.java5
2 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/net/elytrium/limboauth/Settings.java b/src/main/java/net/elytrium/limboauth/Settings.java
index bc1bae4..745a6ee 100644
--- a/src/main/java/net/elytrium/limboauth/Settings.java
+++ b/src/main/java/net/elytrium/limboauth/Settings.java
@@ -75,14 +75,16 @@ public class Settings extends Config {
@Comment({
"If you want to migrate your database from another plugin, which is not using BCrypt.",
"You can set an old hash algorithm to migrate from.",
- "AUTHME - AuthMe SHA256(SHA256(password) + salt) that looks like $SHA$salt$hash",
+ "AUTHME - AuthMe SHA256(SHA256(password) + salt) that looks like $SHA$salt$hash (AuthMe, MoonVKAuth, DSKAuth, DBA)",
+ "AUTHME_NP - AuthMe SHA256(SHA256(password) + salt) that looks like SHA$salt$hash (JPremium)",
"SHA256_NP - SHA256(password) that looks like SHA$salt$hash",
"SHA256_P - SHA256(password) that looks like $SHA$salt$hash",
"SHA512_NP - SHA512(password) that looks like SHA$salt$hash",
"SHA512_P - SHA512(password) that looks like $SHA$salt$hash",
- "SHA512_DBA - DBA plugin SHA512(SHA512(password) + salt) that looks like SHA$salt$hash",
+ "SHA512_DBA - DBA plugin SHA512(SHA512(password) + salt) that looks like SHA$salt$hash (DBA, JPremium)",
"MD5 - Basic md5 hash",
- "Argon2 - Argon2 hash that looks like $argon2i$v=1234$m=1234,t=1234,p=1234$hash",
+ "ARGON2 - Argon2 hash that looks like $argon2i$v=1234$m=1234,t=1234,p=1234$hash",
+ "MOON_SHA256 - Moon SHA256(SHA256(password)) that looks like $SHA$hash (no salt)",
})
public String MIGRATION_HASH = "";
@Comment("Available dimensions: OVERWORLD, NETHER, THE_END")
diff --git a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
index 3894507..3110a2a 100644
--- a/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
+++ b/src/main/java/net/elytrium/limboauth/migration/MigrationHash.java
@@ -31,6 +31,11 @@ public enum MigrationHash {
return arr.length == 4
&& arr[3].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-256") + arr[2], "SHA-256"));
}),
+ AUTHME_NP((hash, password) -> {
+ String[] arr = hash.split("\\$"); // SHA$salt$hash
+ return arr.length == 3
+ && arr[2].equals(MigrationHash.getDigest(MigrationHash.getDigest(password, "SHA-256") + arr[1], "SHA-256"));
+ }),
ARGON2(new Argon2Verifier()),
SHA512_DBA((hash, password) -> {
String[] arr = hash.split("\\$"); // SHA$salt$hash