inittime
This commit is contained in:
@@ -84,12 +84,51 @@ public class BizKeyUtils {
|
||||
return Integer.parseInt(String.valueOf(new Date().getTime()).substring(0, 4));
|
||||
}
|
||||
|
||||
public static String getCipher(String key) {
|
||||
return md5(key + MIX_STRING + key);
|
||||
public static String getCipher(String key,String initTime) {
|
||||
return md5(key +"#"+ MIX_STRING + "#" + initTime);
|
||||
}
|
||||
|
||||
public static Boolean validateCipher(String key,String initTime,String cipher) {
|
||||
return md5(key +"#"+ MIX_STRING + "#" + initTime).equals(cipher);
|
||||
}
|
||||
|
||||
|
||||
public static String getSecretKey(String key, String password) {
|
||||
return md5(key + md5(MIX_STRING + password));
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
int c = 0;
|
||||
while(true) {
|
||||
c++;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
sb.append(RANGE_STRING.charAt(RandomUtils.nextInt(30)));
|
||||
}
|
||||
|
||||
Boolean result = validateKey(sb.toString());
|
||||
|
||||
if(c%1000==0) {
|
||||
System.out.println(c);
|
||||
System.out.println(result);
|
||||
System.out.println(sb.toString());
|
||||
}
|
||||
|
||||
if(result) {
|
||||
System.out.println(c);
|
||||
System.out.println(result);
|
||||
System.out.println(sb.toString());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user