Good morning.
I have had a desktop application in java to convert it to WPF (c #). I do not know much about java but intuiting what it does, little by little I have managed to translate it except for a block of code. The code is as follows:
string key = "CLAVEPARACONVERSION";
string base64EncryptedString = "";
string text = "Esta es la cadena de texto que se va a codificar";
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digestOfPassword = md.digest(key.getBytes("utf-8"));
byte[] keyBytes = Arrays.copyOf(digestOfPassword, 24);
SecretKey key = new SecretKeySpec(keyBytes, "DESede");
Cipher cipher = Cipher.getInstance("DESede");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] plainTextBytes = text.getBytes("utf-8");
byte[] buf = cipher.doFinal(plainTextBytes);
byte[] base64Bytes = Base64.encodeBase64(buf);
base64EncryptedString = new String(base64Bytes);
Can someone help me out? I would appreciate it very much. Greetings and thanks in advance.