:D ahora tendre que mirar un poco de que va esto del java jaja se me escapa un poco de todas formas no parece mucho mas complicado que .net
Estoy en el curro y le he podido echar un ojo muy rapido solo pero qu encontrado algo que parece muy interesante
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page:
http://www.kpdus.com/jad.html// Decompiler options: packimports(3)
package com.mobileapptracker;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
public class Encryption
{
public Encryption(String s, String s1)
{
a = new IvParameterSpec(s1.getBytes());
b = new SecretKeySpec(s.getBytes(), "AES");
c = Cipher.getInstance("AES/CBC/NoPadding");
_L1:
return;
NoSuchAlgorithmException nosuchalgorithmexception;
nosuchalgorithmexception;
nosuchalgorithmexception.printStackTrace();
goto _L1
NoSuchPaddingException nosuchpaddingexception;
nosuchpaddingexception;
nosuchpaddingexception.printStackTrace();
goto _L1
}
private static String a(String s)
{
int i = 16 - s.length() % 16;
for(int j = 0; j < i; j++)
s = (new StringBuilder()).append(s).append(' ').toString();
return s;
}
public static String bytesToHex(byte abyte0[])
{
String s;
if(abyte0 == null)
{
s = null;
} else
{
int i = abyte0.length;
s = "";
int j = 0;
while(j < i)
{
if((0xff & abyte0[j]) < 16)
s = (new StringBuilder()).append(s).append("0").append(Integer.toHexString(0xff & abyte0[j])).toString();
else
s = (new StringBuilder()).append(s).append(Integer.toHexString(0xff & abyte0[j])).toString();
j++;
}
}
return s;
}
public static byte[] hexToBytes(String s)
{
byte abyte0[];
abyte0 = null;
break MISSING_BLOCK_LABEL_2;
if(s != null && s.length() >= 2)
{
int i = s.length() / 2;
abyte0 = new byte
;
int j = 0;
while(j < i)
{
abyte0[j] = (byte)Integer.parseInt(s.substring(j * 2, 2 + j * 2), 16);
j++;
}
}
return abyte0;
}
public static String md5(String s)
{
if(s != null) goto _L2; else goto _L1
_L1:
String s1 = "";
_L4:
return s1;
_L2:
String s2;
MessageDigest messagedigest = MessageDigest.getInstance("MD5");
messagedigest.update(s.getBytes());
s2 = bytesToHex(messagedigest.digest());
s1 = s2;
continue; /* Loop/switch isn't completed */
NoSuchAlgorithmException nosuchalgorithmexception;
nosuchalgorithmexception;
nosuchalgorithmexception.printStackTrace();
s1 = "";
if(true) goto _L4; else goto _L3
_L3:
}
public static String sha1(String s)
{
if(s != null) goto _L2; else goto _L1
_L1:
String s1 = "";
_L4:
return s1;
_L2:
String s2;
MessageDigest messagedigest = MessageDigest.getInstance("SHA-1");
messagedigest.update(s.getBytes());
s2 = bytesToHex(messagedigest.digest());
s1 = s2;
continue; /* Loop/switch isn't completed */
NoSuchAlgorithmException nosuchalgorithmexception;
nosuchalgorithmexception;
nosuchalgorithmexception.printStackTrace();
s1 = "";
if(true) goto _L4; else goto _L3
_L3:
}
public static String sha256(String s)
{
if(s != null) goto _L2; else goto _L1
_L1:
String s1 = "";
_L4:
return s1;
_L2:
String s2;
MessageDigest messagedigest = MessageDigest.getInstance("SHA-256");
messagedigest.update(s.getBytes());
s2 = bytesToHex(messagedigest.digest());
s1 = s2;
continue; /* Loop/switch isn't completed */
NoSuchAlgorithmException nosuchalgorithmexception;
nosuchalgorithmexception;
nosuchalgorithmexception.printStackTrace();
s1 = "";
if(true) goto _L4; else goto _L3
_L3:
}
public byte[] decrypt(String s)
{
if(s == null || s.length() == 0)
throw new Exception("Empty string");
byte abyte0[];
try
{
c.init(2, b, a);
abyte0 = c.doFinal(hexToBytes(s));
}
catch(Exception exception)
{
throw new Exception((new StringBuilder("[decrypt] ")).append(exception.getMessage()).toString());
}
return abyte0;
}
public byte[] encrypt(String s)
{
if(s == null || s.length() == 0)
throw new Exception("Empty string");
byte abyte0[];
try
{
c.init(1, b, a);
abyte0 = c.doFinal(a(s).getBytes());
}
catch(Exception exception)
{
throw new Exception((new StringBuilder("[encrypt] ")).append(exception.getMessage()).toString());
}
return abyte0;
}
private IvParameterSpec a;
private SecretKeySpec b;
private Cipher c;
}