viernes, 27 de febrero de 2015

Using java to decrpyt a password

This program can be used to uncrypt a password envrypted by a program



// @Override
public class decryption{
 


 public static void main(String[] args) {
 String Password="32531797071005001042151983420895121254121152111845630528191791";
StringBuffer strNew  = new StringBuffer();
StringBuffer strTemp = new StringBuffer(Password);
int          intPwd  = 0;
int          i       = 0;
int          intTemp = 0;



try {

intPwd = 99 - Integer.parseInt(Password.substring(Password.length() - 2));

for (i = 1; i <= 30; i++)
strNew.append(strTemp.charAt(2 * (31 - i) - 2));

for (i = 1; i <= 30; i++)
strNew.append(strTemp.charAt(2 * i - 1));

strTemp = strNew;
strNew  = new StringBuffer();

for (i = 1; i <= intPwd; i++) {
intTemp = 3 * i - 3;
strNew.append((char) (Integer.parseInt(strTemp.substring(intTemp, intTemp + 3))));


} // end for

} catch (Exception e) {
e.printStackTrace();

} // end try-catch
String  pwd;
pwd=strNew.toString();
System.out.println(pwd);
} // end decrypt

    }





No hay comentarios:

Publicar un comentario