Bug 6985 - Latest Monodevelop v3.0.4.6 now crashes when encrypting
Summary: Latest Monodevelop v3.0.4.6 now crashes when encrypting
Status: RESOLVED DUPLICATE of bug 6967
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 3.0.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-09-07 07:36 UTC by Amanda
Modified: 2012-09-07 16:17 UTC (History)
2 users (show)

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


Attachments
The error (59.08 KB, image/png)
2012-09-07 07:36 UTC, Amanda
Details


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 Amanda 2012-09-07 07:36:43 UTC
Created attachment 2471 [details]
The error

Hi

Encryption worked until I updated to the latest Monodevelop v3.0.4.6. The line where it crashes is :

result = desCrypt.CreateEncryptor().TransformFinalBlock(buffer, 0, buffer.Length);


Here is the entire method:

	private byte[] Encrypt(
			string value,
			string key)
		{
			byte[] result = new Byte[] { };
			// Create a hash from the key
			MD5CryptoServiceProvider md5Hash = new MD5CryptoServiceProvider();
			byte[] hash =
				md5Hash.ComputeHash(
				ASCIIEncoding.ASCII.GetBytes(key));
			md5Hash = null;
		
			// Create a Triple Data Encryption Standard TripleDES object
			TripleDESCryptoServiceProvider desCrypt = new TripleDESCryptoServiceProvider();
			try
			{
				// 128 bit encryption ;)
				desCrypt.Key = hash;
				desCrypt.Mode = CipherMode.ECB;
				byte[] buffer = ASCIIEncoding.ASCII.GetBytes(value);
				result = desCrypt.CreateEncryptor().TransformFinalBlock(buffer, 0, buffer.Length);
			}
			finally
			{
				desCrypt = null;
			}
			return result;
		}
	

The  error message is System.Security.CryptographicUnexpectedOperationexception . Error attached.

My Monodevelop version is 3.0.4.6
Mono 2.10.9
GTK 2.24.10
GTK # (2.12.0.0)
Xcode 4.3.3 (1178)
Monotouch 5.4.0
Mac OSX 10.7.4


Thanks
Comment 1 Sebastien Pouliot 2012-09-07 16:17:37 UTC

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