L
lxx2008
Unregistered / Unconfirmed
GUEST, unregistred user!
package com.fysoft.v8.v8tools;
import java.util.Random;
public class Password
{
private static String a[] = {
"ke3wms", "jnx9i8", "dpqzl6", "vyg1bh", "7a4c2f", "u5rto0"
};
private static String _flddo[] = {
"wa6j1c", "fblrk7", "mg9q0s", "vu3zth", "po4xy2", "ni5d8e"
};
private static String _fldif[] = {
"mg9qwc", "vu3zth", "a6j10s", "fbk7lr", "5dpoy2", "4xni8e"
};
private Password()
{
}
public static String encrypt(String s)
{
String s1 = "";
s1 = a(s.toLowerCase(), a);
int i = s1.length();
for(int j = 1; j <= 3; j++)
{
s1 = String.valueOf(i % 6) + s1;
i /= 6;
}
Random random = new Random();
for(; s1.length() < 60; s1 = s1 + String.valueOf(random.nextInt(6)));
return _mthif(s1, _flddo);
}
public static String decrypt(String s)
{
String s1 = "";
s1 = a(s, _flddo);
int i = 0;
for(int j = 0; j < 3; j++)
i = i * 6 + Integer.parseInt(String.valueOf(s1.charAt(j)));
s1 = s1.substring(3, 3 + i);
return _mthif(s1, a);
}
private static String a(String s, String as[])
{
String s1 = "";
String s2 = "";
for(int i = 0; i < s.length(); i++)
{
for(int j = 0; j < 6; j++)
{
int k = as[j].indexOf(s.charAt(i));
if(k <= -1)
continue;
s1 = s1 + String.valueOf(j);
s2 = String.valueOf(k) + s2;
break;
}
}
return s1 + s2;
}
private static String _mthif(String s, String as[])
{
String s1 = "";
int i = s.length();
if(i % 2 == 1)
return null;
for(int j = 0; j < i / 2; j++)
{
String s2 = "";
s2 = as[Integer.parseInt(String.valueOf(s.charAt(j)))];
String s3 = String.valueOf(s.charAt(i - j - 1));
s1 = s1 + s2.charAt(Integer.parseInt(s3));
}
return s1;
}
}
import java.util.Random;
public class Password
{
private static String a[] = {
"ke3wms", "jnx9i8", "dpqzl6", "vyg1bh", "7a4c2f", "u5rto0"
};
private static String _flddo[] = {
"wa6j1c", "fblrk7", "mg9q0s", "vu3zth", "po4xy2", "ni5d8e"
};
private static String _fldif[] = {
"mg9qwc", "vu3zth", "a6j10s", "fbk7lr", "5dpoy2", "4xni8e"
};
private Password()
{
}
public static String encrypt(String s)
{
String s1 = "";
s1 = a(s.toLowerCase(), a);
int i = s1.length();
for(int j = 1; j <= 3; j++)
{
s1 = String.valueOf(i % 6) + s1;
i /= 6;
}
Random random = new Random();
for(; s1.length() < 60; s1 = s1 + String.valueOf(random.nextInt(6)));
return _mthif(s1, _flddo);
}
public static String decrypt(String s)
{
String s1 = "";
s1 = a(s, _flddo);
int i = 0;
for(int j = 0; j < 3; j++)
i = i * 6 + Integer.parseInt(String.valueOf(s1.charAt(j)));
s1 = s1.substring(3, 3 + i);
return _mthif(s1, a);
}
private static String a(String s, String as[])
{
String s1 = "";
String s2 = "";
for(int i = 0; i < s.length(); i++)
{
for(int j = 0; j < 6; j++)
{
int k = as[j].indexOf(s.charAt(i));
if(k <= -1)
continue;
s1 = s1 + String.valueOf(j);
s2 = String.valueOf(k) + s2;
break;
}
}
return s1 + s2;
}
private static String _mthif(String s, String as[])
{
String s1 = "";
int i = s.length();
if(i % 2 == 1)
return null;
for(int j = 0; j < i / 2; j++)
{
String s2 = "";
s2 = as[Integer.parseInt(String.valueOf(s.charAt(j)))];
String s3 = String.valueOf(s.charAt(i - j - 1));
s1 = s1 + s2.charAt(Integer.parseInt(s3));
}
return s1;
}
}