We help IT Professionals succeed at work.

Basic Cryptographic Services Provider works in Vista/Windows 7 but fails on XP

doraiswamy asked
I created a crypto object using MS Basic Cryptographic Services provider in VS 2008 (C++). It is encrypting and decrypting fine on Vista and Windows 7. However, the same provider does not work on XP. Both encryption and decryption return false, and the GetLastError returns the code 0x80090012.
Watch Question

Make sure the latest .NET framework is installed on the XP machine - I believe it is .NET Framework 3.5 SP1 ??  (Go to http://update.windows.com on the XP machine and look under the "Other" section for this update)

OR download it from the following location:


<Just Guessing>I'd be looking to see if the target WinXP machine has the proper Crypto API DLL files.  I'd consider installing the CAPICON redistributable to see if that helps</Just Guessing>
Hi. I am able to double-encrypt the string (i.e. encrypt it twice in succession) in WIndows 7, but XP throws the error that the string is already encrypted/decrypted. To overcome this problem, instead of immediately re-encrypting the string, I am encrypting the whole file in one pass and then re-encrypting it in the second pass with another cryptographic object.

This solves the problem (for now at least).

That sounds more like a coding issue...   We'd be happy to take a look at your code