Urgent Help on CAPICOM Decrypt and Encrypt

From: Mae (Mae_at_discussions.microsoft.com)
Date: 09/28/04


Date: Mon, 27 Sep 2004 22:53:03 -0700

Dear all,

I'm new to CAPICOM not sure how to use it in C# Web application. As I know,
CAPICOM does have a function to decrypt and encrypt some string. The question
is, how to use CAPICOM to encrypt and decrypt given string ?

Below is the encrypted string, but how to decrypt it back to original string ?

EncryptedDataClass Crypt1= new CAPICOM.EncryptedDataClass();
Crypt1.SetSecret("MyPassword",CAPICOM_SECRET_TYPE.CAPICOM_SECRET_PASSWORD);
Crypt1.Content = "Some text to encrypt";
string data = Crypt1.Encrypt(CAPICOM_ENCODING_TYPE.CAPICOM_ENCODE_BASE64);
this.Label1.Text = data;

Please give some example on method to decrypt.

Thanks in advance

Cheers,
Mae



Relevant Pages

  • RE: Using Win32 CryptDecrypt to Decrypt RijndaelManaged
    ... I figured out how to use RijndaelManaged with AES in the C++ app. ... C++ crypto WILL successfully decrypt the .NET generated ... I am trying to write a Win32 app that can decrypt that string using the ... I can get both to encrypt and decrypt successfully in their own projects, ...
    (microsoft.public.platformsdk.security)
  • Re: Encrypt and Decrypt a file using .NET 2.0?
    ... public static string GenerateKey() ... DES des = DES.Create; ... // Distribute this key to the user who will decrypt this file. ... // Get the Key for the file to Encrypt. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .NET Crypto Classes Interoperability with Win32 Crypto APIs
    ... >the hash of the string you are feeding in. ... when i encrypt a string using .NET classes and try ... >> decrypt it using Win32 APIs, ...
    (microsoft.public.dotnet.security)
  • Re: Encrypt and Decrypt a file using .NET 2.0?
    ... public static string GenerateKey() ... using (CryptoStream cryptoStream = new CryptoStream(outFile, ... // Distribute this key to the user who will decrypt this file. ... // Get the Key for the file to Encrypt. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Decryptionfailed to bring original text back....
    ... cryptography, but now using them on web.config, any idea, I like to ... There isn't really much reason to encrypt a .NET string with ... what happen when you decrypt the encrypted ...
    (microsoft.public.dotnet.security)