我有以下用java编写的代码.我需要C#等价物.
Key key = new SecretKeySpec(keyValue, "AES");
Cipher c = Cipher.getInstance("AES");
c.init(1, key);
byte[] encVal = c.doFinal(Data.getBytes());
encryptedValue = new BASE64Encoder().encode(encVal);
Run Code Online (Sandbox Code Playgroud)