Solved

Urgent Help on CAPICOM Decrypt and Encrypt

Posted on 2004-09-27
4
604 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now