Solved

Urgent Help on CAPICOM Decrypt and Encrypt

Posted on 2004-09-27
4
616 Views
Last Modified: 2012-06-22
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,
yymae
0
Comment
Question by:yymae
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 6

Accepted Solution

by:
mogun earned 100 total points
ID: 12167741
Use the Decrypt method of the encrypteddata class.. You will have to specify same secret password that used for encrypting.

string decrypteddata = Crypt1.Decrypt(data);

where "data" is your encrypted data.

BTW, why are you using CAPICOM, when you have System.Security.Cryptography ?

Cheers
Mohan

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question