473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System.Security.Cryptography.MD5CryptoServiceProvi der

Hi,

According to MS Knowledge Base article 307020, we have to instantiate a new
instance of the MD5CryptoServiceProvider class for every new hash value we'd
like to compute (from step 6 of the article).

I'm wondering if I could reuse the same object to compute multiple hash
values by using the Init() method of the class inbetween calls of
ComputeHash().

Comments/suggestions please.

Thanks.

Nov 16 '05 #1
1 2174
I'm not convinced the article is correct.
ComputeHash is a base-class method that first calls HashCore then calls
HashFinal, and then also calls Initialize again.
From looking at ILDASM on MD5CryptoServiceProvider, the Initialize method
appears to recreate the underlying unmanaged hash handle.
So to answer your question, Initialize is already being called for you.
Also, the CanReuseTransform property returns True. I really don't know why
the article specifies you would need a new instance. If anyone has more
info, feel free to chime in, but off the top of my head, I can't see why you
would.

-Rob Teixeira

"Casual Reader" <Ca**********@discussions.microsoft.com> wrote in message
news:2D**********************************@microsof t.com...
Hi,

According to MS Knowledge Base article 307020, we have to instantiate a new instance of the MD5CryptoServiceProvider class for every new hash value we'd like to compute (from step 6 of the article).

I'm wondering if I could reuse the same object to compute multiple hash
values by using the Init() method of the class inbetween calls of
ComputeHash().

Comments/suggestions please.

Thanks.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrzej | last post by:
Hi, I have to figure out why we have a problem with special characters in encrypted usernames and passwords. Case: Username: r&bgeorge Password: tigger
0
by: Ebert | last post by:
hi I am just trying out some example in the help, however, it is stranged that I can't imports system.security.cryptography.Xml namespace, I only have cryptography.X509 and the rest but not .XML,...
3
by: segue | last post by:
I have VS 2005, .NET 2.0, no girlfriend and this article: http://msdn2.microsoft.com/en-us/library/ms278836.aspx. Yet, I can't successfully import this namespace. ...
1
by: muthu | last post by:
Hi, I have two web applications running on my machine.The application is developed using asp.net 1.1 and vb.net.When i try to run both the applications in the same browsers, i get the following...
1
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Hi, everybody here. I am implementing data encryption/decryption, and try to use System.Security.Cryptography.TripleDESCryptoServiceProvider. But I can not find it in MS Visual Studio when I...
1
by: Eric Simmons | last post by:
Hello, I am trying to run a .NET 2.0 application that I developed and I am getting the following error: Key not valid for use in specified state I am attempting to retrieve the...
6
by: andrew | last post by:
Hi, I have a web service application written in C# .NET 1.1 using MD5CryptoServiceProvider.ComputeHash(Byte) The problem is that after a while(web service processes requests) the call throws...
0
by: Amelyan | last post by:
Why does this happen? How to fix it? Once in a while I get error in ~/ScriptResource.axd?d=... System.Reflection.TargetInvocationException: Exception has been thrown by the target of an...
0
by: a.bavdhankar | last post by:
Hi, I am using System.Security.Cryptography.RijndaelManaged in web application that is executed under annonymous user. I am getting access denied error message. It seems annonymous user does...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.