Safer xD
This commit is contained in:
parent
408254cf5c
commit
8c33dc43b3
|
@ -8,7 +8,7 @@ import de.Thiesyy.MelcryptJavaAPI.Util.MelcryptDataSet;
|
|||
public class Melcrypt {
|
||||
public static MelcryptDataSet encode(int security, String Text) {
|
||||
System.out.println("Encrypting can take large Calculation power!");
|
||||
String[] Keys = new String[security];
|
||||
String[] Keys = new String[security];
|
||||
for(int x = 0; x != security; x++) {
|
||||
Keys[x] = KeyGenerator.generateKey();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package de.Thiesyy.MelcryptJavaAPI.Util;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -14,7 +15,7 @@ public static String generateKey() {
|
|||
String x = "";
|
||||
for(int y = 0; y != 8; y++) {
|
||||
int z;
|
||||
z = (int) ((new Random().nextInt(10)*4+new SecureRandom().nextInt(10)+System.currentTimeMillis()+new Random().nextInt(10))%10);
|
||||
z = (int) ((new File(".").getUsableSpace() +new SecureRandom().nextInt(24)*4+new SecureRandom().nextInt(10)+System.currentTimeMillis()+new SecureRandom().nextInt())%10);
|
||||
if(z==0)z=3;
|
||||
x+=z;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue