473,468 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2175
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...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.