Posted on: 7/18/2014 2:26:25 PM | Views : 479

Hi
I know that C# is very close to Java 
I need to create a C# Web Service that talks to Android Java
So it will encrypt some code and send it to android to decrypt and vice versa, Android will encrypt some code and send it to C# to decrypt

I finished the java part, the problem is with the C# now. as the functions should work the same with same encryption decryption method
anyone can help me find out what is the equivalent code for this java?
thanks
String Encrypt(String text, String key) throws Exception { Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); byte[] keyBytes = new byte[16]; byte[] b = key.getBytes("UTF-8"); int len = b.length; if (len > keyBytes.length) len = keyBytes.length; System.arraycopy(b, 0, keyBytes, 0, len); SecretKeySpec keySpec = new SecretKeySpec(keyByt ...

Go to the complete details ...