bonjour a tous voila j essaye de décrypter une string qui contient une Chaîne en MD5 en un String clair

ma chaîne MD5 cc8c0a97c2dfcd73caff160b65aa39e2

le résultat que je devrait obtenir : az

mais cela ne fonctionne pas. merci d'avance pour votre aide

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
	public static String decryptAES(String toDecrypt, String secretKey) {
	    String decrypted = null;
	    try {
	        // Instantiate the cipher
	        SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes("UTF8"), "AES");
	    	Cipher cipher = Cipher.getInstance(AES_TRANSFORMATION_STRING);
	        cipher.init(Cipher.DECRYPT_MODE, secretKeySpec);
	        byte[] original = cipher.doFinal(toDecrypt.getBytes("ISO-8859-1"));
 
	        StringBuilder hashString = new StringBuilder();
			for (int i = 0; i < original.length; i++)
			{
			        String hex = Integer.toHexString(original[i]);
			        if (hex.length() == 1) {
			                hashString.append('0');
			                hashString.append(hex.charAt(hex.length() - 1));
			        	}else{hashString.append(hex.substring(hex.length() - 2));}
			}
 
	        return hashString.toString();
	    }
	    catch (Exception e) {
	        e.printStackTrace();
	        System.out.println("Impossible to decrypt with AES algorithm: string=(" + toDecrypt + ") message=(" + e.getMessage() + ")");
	    }
	    return decrypted;
	}
String toDecrypt, String secretKey à l appel de la fonction je leur passe la chaine cryter en MD5