login about faq

I have a large quantity of ebencrypted data and existing routines. I would like to convert the routines to CHILKAT CRYP. Do you have any sample code showing how to decrypt EBencrypted data?

Function EncryptStringEX(subText,subKey)
    on error resume next
    'Encryption engine for encrypting the actual URLs
    Dim cipherObject
    set cipherObject = CreateObject("EbCrypt.eb_c_Cipher")
    Dim libObject
    set libObject = CreateObject("EbCrypt.eb_c_Library")
    EncryptStringEX = _
        libObject.BLOBToHex(_
            cipherObject.EncryptString(19, _
                cstr(subKey), cstr(right("99009900" & cstr(subKey),8)), _
                subText))
end Function

How would I decrypt this using the ChillKat component?

asked Apr 05 '13 at 17:37

Wolfie's gravatar image

Wolfie
1111


I don't know anything about EbCrypt, and therefore I don't have a good answer.

All I can say is that Chilkat will produce results that are in agreement with the various published test vectors for various algorithms: AES, Blowfish, TwoFish. In other words, there is nothing proprietary about the Chilkat encryption -- as long as the inputs are the same, such as secret key, key length, cipher mode, padding scheme, etc., then Chilkat will interoperate with any other encryption software that produces correct results -- i.e. results where the encryption algorithm is implemented to published specifications.

link

answered Apr 06 '13 at 13:56

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

I have tried to produce the same output using chilkat as I get from ebCrypt. Cipher algorithm 19 (above) is Blowfish CBC.

EncryptString(algorithm As EB_CRYPT_CIPHER_ALGORITHM, passPhrase As String, salt As String, plainText As String) As Byte()

Testing in VB6 IDE using "This is a test" as the input string, "MyPass" as the password. Using ebcrypt the output string is :"919606543DE09AACE379C2E13ABE511EF5D9DD30B716D2961DD1A3836EF1A3C9" Using chillkat the output string is :"A9502569CDA4393253740360B7B33B5E"

As you can see the output length is substantially different. For the Chillkat routines, I have altered the key length, padding and IV. Nothing I do remotely comes close to the output length of EbCrypt.

Crypt.CryptAlgorithm = "blowfish2"
Crypt.CipherMode = "cbc"
Crypt.KeyLength = 128
Crypt.PaddingScheme = 0
Crypt.EncodingMode = "hex"

Dim hexKey As String
hexKey = Crypt.GenEncodedSecretKey(Password & "4242", "hex")
Crypt.SetEncodedKey hexKey, "hex"

Text3.Text = Crypt.EncryptStringENC(TestText)

I am beginning to think its how EB returns the encrypted data compared to how yours does. The input string is 14 characters. Chilkat outputs 32 characters. EB outputs 64 characters. When I change the input to 7 characters, Chillkat outputs 15 characters, EB outputs 32. EB always outputs 2x the size Chillkat does.

Kinda thinking this isn't solvable.

link

answered Apr 08 '13 at 13:22

Wolfie's gravatar image

Wolfie
1111

You would NOT want to use GenEncodedSecretKey if you are trying to match the encryption of some other system. See the reference documentation here:
http://www.chilkatsoft.com/refdoc/xChilkatCrypt2Ref.html

Make sure to read about GenerateSecretKey also:

IMPORTANT: If you are trying to decrypt something encrypted by another party such that the other party provided you with the secret key, DO NOT use this method. This method is for transforming an arbitrary-length password into a binary secret key of the proper length. Please see this Chilkat blog post: Getting Started with AES Decryption

link

answered Apr 08 '13 at 15:34

chilkat's gravatar image

chilkat ♦♦
11.8k316358420

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:

×1

Asked: Apr 05 '13 at 17:37

Seen: 3,442 times

Last updated: Apr 08 '13 at 15:34

Related questions

powered by OSQA