Professional Web Applications Themes

Urgent Help on CAPICOM Decrypt and Encrypt - ASP.NET Security

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_ENCOD E_BASE64); this.Label1.Text = data; Please give some example on method to decrypt. Thanks in advance Cheers, Mae...

  1. #1

    Default Urgent Help on CAPICOM Decrypt and Encrypt

    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_ENCOD E_BASE64);
    this.Label1.Text = data;

    Please give some example on method to decrypt.

    Thanks in advance


    Cheers,
    Mae
    Mae Guest

  2. #2

    Default Re: Urgent Help on CAPICOM Decrypt and Encrypt


    > 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_ENCOD E_BASE64);
    > this.Label1.Text = data;
    >
    > Please give some example on method to decrypt.
    >
    > Thanks in advance
    >
    >
    > Cheers,
    > Ma
    User submitted from AEWNET ([url]http://www.aewnet.com/[/url])
    Guest Guest

  3. #3

    Default Re: Urgent Help on CAPICOM Decrypt and Encrypt

    if you want to use symmetric keys to encrypt/decrypt data i can only recommend to use the classes found in System.Security.Cryptography -

    you can have a look at this example which encrypts/decrypts files using the RijndaelManaged class
    [url]http://www.leastprivilege.com/PermaLink.aspx?guid=f73ca1e0-bcfa-4563-862f-eb06ab317075[/url]

    CAPICOM is normally used from .NET to access the Windows Certificate Store as there is no native support in 1.1 (but in 2.0)

    Dominick Baier - DevelopMentor
    [url]www.leastprivilege.com[/url]



    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<##Be#p##EHA.1404TK2MSFTNGP11.phx.gbl>


    > 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_ENCOD E_BASE64);
    > this.Label1.Text = data;
    >
    > Please give some example on method to decrypt.
    >
    > Thanks in advance
    >
    >
    > Cheers,
    > Mae User submitted from AEWNET ([url]http://www.aewnet.com/[/url])
    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier Guest

Similar Threads

  1. How do I Use DPAPI to Encrypt and Decrypt Data (C#/VB.NET)?
    By anonieko@hotmail.com in forum ASP.NET Security
    Replies: 0
    Last Post: March 16th, 11:54 PM
  2. 3DES encrypt in vb.net with decrypt in classic asp
    By David Lund in forum ASP.NET Security
    Replies: 0
    Last Post: December 3rd, 09:32 PM
  3. encrypt with TripleDES, decrypt with DES, doesnt work ?
    By Lech Migdal in forum ASP.NET Security
    Replies: 1
    Last Post: April 7th, 05:48 PM
  4. Decrypt / Encrypt Session objects
    By Stefan in forum ASP.NET Security
    Replies: 1
    Last Post: August 29th, 11:07 PM
  5. Troubles with CAPICOM EnvelopedData.Decrypt
    By Alexei Pashin in forum ASP Components
    Replies: 1
    Last Post: July 15th, 12:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139