login about faq

We have hit on small snag however. We have a web service that uses keys generated by CkCrypt’s GenerateSecretKey() function on the client. However, we need to integrate this same functionality on a different platform. We are hitting a snag where we do not know the algorithm/methodology used by GenerateSecretKey(). Would you be able to discuss any of that, so that we can generate keys that interoperate with Chilkat from different platforms? It seems to be a hash algorithm of some sort, but I imagine there is a salt involved or something else.

asked Aug 27 '12 at 16:57

chilkat's gravatar image

chilkat ♦♦

The GenerateSecretKey takes an arbitrary password string and produces a binary secret key equal in length to the value specified by the KeyLength property as follows:

1) Generate 32-bytes of key material.

A) Write the password to a byte array using the character encoding specified by the Charset property. Typically, if the password is entirely us-ascii (7bit) chars, this is simply the ascii bytes of the password. Differences would arise if non-English (8bit) chars are used in the password, and then it is important to understand the byte representation used for the password string.
B) MD5 hash the byte array to produce the 1st 16 bytes of key material.
C) Base64 encode the byte array from (A) and then MD5 hash the ascii bytes of the Base64 string. This becomes the 2nd 16 bytes of the key material.

2) Return the 1st N bytes of the key material according to the KeyLength property. For example, if the KeyLength = 192, then 24 bytes are returned.


answered Aug 27 '12 at 17:04

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: Aug 27 '12 at 16:57

Seen: 1,020 times

Last updated: Aug 27 '12 at 17:04

powered by OSQA