Bug 7096 - After installing monotouch 5.4, TripleDES encryption does not work
Summary: After installing monotouch 5.4, TripleDES encryption does not work
Status: RESOLVED DUPLICATE of bug 6967
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-09-12 11:05 UTC by frederic torres
Modified: 2012-09-12 11:41 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 6967

Description frederic torres 2012-09-12 11:05:32 UTC
The following code that use to work with monotouch 5.3, does not work with with monotouch 5.4
The line
    byte[] b = des.CreateEncryptor().TransformFinalBlock(buff, 0, buff.Length);     
throw a general encryption error (Sorry I do not have the message at this time)

        public static byte[] C(string pw, byte[] buff)
        {

            TripleDESCryptoServiceProvider des;
            MD5CryptoServiceProvider hashmd5;
            byte[] pwdhash;

            hashmd5 = new MD5CryptoServiceProvider();
            pwdhash = hashmd5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(pw));
            hashmd5 = null;
            des = new TripleDESCryptoServiceProvider();
            des.Key = pwdhash;
            des.Mode = CipherMode.ECB; //CBC, CFB            
            byte[] b = des.CreateEncryptor().TransformFinalBlock(buff, 0, buff.Length);     
            return b;
        }
Comment 1 Sebastien Pouliot 2012-09-12 11:41:34 UTC

*** This bug has been marked as a duplicate of bug 6967 ***