TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jeff Roder
NA
4
0
C# encryption reimplementation from C++ legacy code
Jul 24 2009 11:03 AM
Hello all,
I'm a new user to this forum, so please bear with me if I make newbie mistakes...
THE PROBLEM
I have a visual C++ encryption project that I need to reimplement in C# .NET environment using MS VS 2005. Reimplementing seems manageable, most of the code is fileIO and stream manipulation. The part I am not sure about is the encryption classes used. Specifically, are there parallels in C# that will perform the IDENTICAL encryption and decryption? The encryption and hashing functions used in the VC++ project are the following:
CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)
CryptCreateHash(hProv,
CALG_MD5
, 0, 0, &hHash)
CryptHashData(hHash, (unsigned char*)szPassword, strlen(szPassword), 0)
CryptDeriveKey(hProv,
CALG_RC4
, hHash, (40 << 16) | CRYPT_EXPORTABLE, &hKey)
CryptDestroyHash(hHash)
CryptEncrypt(hKey, 0, eof, 0, pbBuffer, &dwCount, dwBufferLen)
CryptDestroyKey(hKey)
CryptDestroyHash(hHash)
CryptReleaseContext(hProv, 0)
QUESTIONS:
For the functions listed above, are there parallel versions in C#?
Does CALG_MD5 hashing exist in C#?
Does CALG_RC4 encryption exist in C#?
If 2 and 3 are true, will the reimplemented encryption be the same as the C++ version all things being equal?
Thanks much in advance.
Reply
Answers (
1
)
How to upload and download videos from our website
How to create custom form border ??