login about faq

I came up with the following code using the available examples, but the code is not decrypting properly. I'm not sure where I'm setting it up incorrectly and could use some help please:

    string pubKey = "nhasasdbasdtene7230asb";
    string iv = "a5e8d2e9c1721ae0e84ad660c472c1f3";

    Chilkat.Crypt2 crypt = new Chilkat.Crypt2();
    bool success = crypt.UnlockComponent("Anything for 30-day trial");
    crypt.VerboseLogging = true;

    crypt.CryptAlgorithm = "aes";
    crypt.CipherMode = "cbc";
    crypt.KeyLength = 256;
    crypt.PaddingScheme = 0;

    crypt.Charset = "utf-8";
    crypt.EncodingMode = "hex";
    crypt.HashAlgorithm = "sha256";
    string derivedKey = crypt.HashStringENC(pubKey);

    crypt.SetEncodedIV(iv, "hex");
    crypt.SetEncodedKey(derivedKey, "hex");

    crypt.Charset = "utf-8";
    crypt.EncodingMode = "base64";       
    // code is a Base64 string
    decryptedString = crypt.DecryptStringENC(code);

asked Mar 17 at 20:02

RexfelisLOC's gravatar image

RexfelisLOC
1

edited Mar 21 at 10:34

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×40
×10
×8
×3

Asked: Mar 17 at 20:02

Seen: 406 times

Last updated: Mar 21 at 10:34

powered by OSQA