Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6683393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:48:59+00:00 2026-05-26T04:48:59+00:00

There is a particular library (.net dll) we had used for cryptography. But it

  • 0

There is a particular library (.net dll) we had used for cryptography. But it made use of Win32 routines. The issue here is we cannot use that for a 64-bit operating system. At least I think its so…we have code in the assembly written like this:

Friend Declare Function CryptAcquireContext Lib "advapi32.dll" Alias "CryptAcquireContextA" (ByRef phProv As Integer, ByVal pszContainer As String, ByVal pszProvider As String, ByVal dwProvType As Integer, ByVal dwFlags As Integer) As Integer

I see a 32 there; so I guess it is not meant for 64-bit machines. 🙁

Anyway, my ultimate goal is to convert that whole solution to a more portable code (so it can work on both 32 & 64 bit machines), but I can’t seem to understand how to write the equivalent .net code. After a lot of googling I found a C++ implementation which is similar to how things were done in the old .net dll. That can be found here

Being a novice in this area it is quite difficult for me to understand the process. I suppose they use the RSA algorithm. And I guess this is a symmetric algorithm, because we pass only one key to do the encryption/decryption. If you need any other details please add a comment; I’ll try to respond when I can…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:49:00+00:00Added an answer on May 26, 2026 at 4:49 am

    Unfortunately, the function you are calling is not a regular crypto function, its something used to get a cryptographic service provider(CSP)Generally, access to CSP’s except via native code calls are unsupported in .net ≤ 4.0.

    Absent your code,I can’t figure out what you are doing with the service provider once you grab the handle to it. If its one of the standard symmetric or asymmetric functions or something similar, you can probably do it entirely from managed code.

    Try looking at System.security.cryptography. There is also a Microsoft written set of wrappers around CNG/CSP data providers here that might directly expose expose the exact CSP and its functionality . Finally, if you want really really portable code, try searching for the bouncy castle library which would handle both win32, windows ce, win8, and mono.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .net library dll that acts like a functional library. There are
Is there any particular reason to use one over the other? I personally tend
There is a particular website I must use for work which is absolutely heinous
There seem to many ways to skin this particular cat - but which is
I have to use third party, unmanaged COM dll into my .NET application. I
I wonder if there is any .net library to create dummy instances of an
I am trying to use SevenZipSharp or/and Unrar library in C# WinForms .NET 3.5.
Is there a particular scenario where a WriteOnly property makes more sense then a
Is there a particular reason why a generic ICloneable<T> does not exist? It would
Is there a particular way to initialize an IList<T> ? This does not seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.