Hi, i think mono has a bug with the private method "_NewEncryptor", since i get null, when i want to get the method by "GetMethod":
TripleDES tripleDESalg = TripleDES.Create(); TripleDESCryptoServiceProvider sm = tripleDESalg as TripleDESCryptoServiceProvider; sm.Mode = CipherMode.ECB; sm.Padding = PaddingMode.None; *MethodInfo mi = sm.GetType().GetMethod("_NewEncryptor", BindingFlags.NonPublic | BindingFlags.Instance);* if (mi != null) { object[] Par = { keyValue, sm.Mode, iVValue, sm.FeedbackSize, 0 }; // encrypt 0 ICryptoTransform trans = mi.Invoke(sm, Par) as ICryptoTransform; // CreateEnrypt doesn't work for Weak Keys //ICryptoTransform trans = sm.CreateEncryptor(keyValue, iVValue); byte[] resultArray = trans.TransformFinalBlock(bytes, 0, bytes.Length); return resultArray; } else { throw new Exception("Decryption failed. Method _NewEncryptor not found"); } I can't use the CreateEnrypt Method, since most times i will have to deal with Weak Keys. So does anyone has a solution, how i can get it work under mono? -- View this message in context: http://mono.1490590.n4.nabble.com/TripleDESCryptoServiceProvider-NewEncryptor-returns-null-tp4649909.html Sent from the Mono - WinForms mailing list archive at Nabble.com. _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list