login about faq

I have an encrypted string (with ChilkatDotNet2.dll 9.5.0.45) which I want to decrypt with the current version 9.5.0.64. This doesn't work.

Her my code to decrypt:

    static void Main(string[] args)
        {
            var encryptedText = "01A30BD25F16A525ACFD8DC840D94F6626A52036ECD4ECFCCB6B74C7CD3CCA24D0069B1C114AFBD0D37251A6AE380471F5FD4E99EE8013C2E754750C5C7A87FB12F0E93BE0F4DC6B6CE9BBDDA1853245EFF78B45CAC8887E9341C57080500732BE6EA8E5298E3085";
            var pwd = "123456";

            var crypt = new Crypt2();
            var success = crypt.UnlockComponent("???");
            if (success != true)
            {
                return;
            }
            crypt.CryptAlgorithm = "pbes2";
            crypt.PbesPassword = pwd;
            crypt.PbesAlgorithm = "rc2";
            crypt.KeyLength = 128;
            crypt.Rc2EffectiveKeyLength = 128;
            crypt.SetEncodedIV("0000000000000000", "hex");
            crypt.SetEncodedSalt("0102030405060708", "hex");
            crypt.IterationCount = 1024;
            crypt.HashAlgorithm = "sha1";
            crypt.EncodingMode = "hex";

            var decryptedText = crypt.DecryptStringENC(encryptedText);
        }

with version 9.5.0.45 the decrypted string is: "cpsdyfrgmVlC43X8iVdWeP21lNcyYkIT23xzSkuKOtVSspcGeUQXVbaOew==9d5f58d7-fa9c-40ed-b08b-b97604f21d54" which it should be

with version 9.5.0.64 the decrypted string is: "´¥ª]RÚ¼°u0014ðnÌZÉ:éé"

asked Nov 23 at 06:36

erik's gravatar image

erik
1


the other direction (encryption with 9.5.0.64 and decryption with 9.5.0.45) also doesn't work

link

answered Nov 23 at 07:11

erik's gravatar image

erik
1

Thanks, I'm having a look..

link

answered Nov 23 at 12:18

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Here's a new build with the fix:

http://chilkatdownload.com/prerelease/chilkatdotnet2-9.5.0-win32.zip
http://chilkatdownload.com/prerelease/chilkatdotnet2-9.5.0-x64.zip

At some point since v9.5.0.45, there was a copy/paste error introduced in the internals such that PBES1 was being used instead of PBES2. This is now fixed, and the results should be the same.

link

answered Nov 23 at 12:39

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

Thanks for your quick answer. Seems to work. When do you expect to release this version? I need also builds for other Frameworks and for C++.

link

answered Nov 24 at 02:00

erik's gravatar image

erik
1

Your answer
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:

×64
×23

Asked: Nov 23 at 06:36

Seen: 89 times

Last updated: Nov 24 at 02:00

powered by OSQA