diff --git a/build.gradle b/build.gradle index 4a9a08a..651d150 100644 --- a/build.gradle +++ b/build.gradle @@ -39,14 +39,6 @@ javadoc { new URL("https://raw.githubusercontent.com/TudbuT/tools/master/dark_javadoc.css").newInputStream(). readLines().join("\n").getBytes() ); f.close() - } -} - -jar { - doLast { - File jar = new File("build/libs/tuddylib.jar") - File loc = new File("TuddyLIB.jar") - jar.renameTo(loc) ZipOutputStream out = new ZipOutputStream(new FileOutputStream("TuddyLIB-javadoc.zip")) new File("build/docs/javadoc").eachFileRecurse(groovy.io.FileType.FILES) { @@ -60,6 +52,14 @@ jar { } } +jar { + doLast { + File jar = new File("build/libs/tuddylib.jar") + File loc = new File("TuddyLIB.jar") + jar.renameTo(loc) + } +} + //jar.dependsOn("javadoc") publishing { diff --git a/src/main/java/de/tudbut/tools/encryption/Key.java b/src/main/java/de/tudbut/tools/encryption/Key.java index 414bd8e..c98ea80 100644 --- a/src/main/java/de/tudbut/tools/encryption/Key.java +++ b/src/main/java/de/tudbut/tools/encryption/Key.java @@ -5,6 +5,8 @@ import de.tudbut.tools.Hasher; import de.tudbut.tools.ObjectSerializerTCN; import de.tudbut.tools.Tools; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; import java.util.Objects; /** @@ -18,7 +20,7 @@ public class Key implements Cloneable { * Generates a random Key */ public Key() { - string = Tools.randomAlphanumericString(1024); + this(SecureRandom.getSeed(1024)); } /** @@ -34,7 +36,7 @@ public class Key implements Cloneable { * @param bytes Key as byte[] */ public Key(byte[] bytes) { - string = new String(bytes); + string = new String(bytes, StandardCharsets.ISO_8859_1); } /**