EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Replace Chilkat component

Posted: 03/29/2016 08:13:13
by Ove Halseth (Basic support level)
Joined: 02/11/2016
Posts: 1

We have an application where user gives in a password that is used to generate a 256 bit key that we then encrypt a zip-file with.

How do I do it with SecureBlackBox?

Se code below:
  // Password is validated and set in Password dialog
  // or if Password comes from commandline, it is assumed correct
  //AES crypt
  crypt.CryptAlgorithm := 'aes';
  crypt.CipherMode := 'cbc';
  crypt.KeyLength := 256;

  // Use sha256-hash to generate a 256-bit key for password
  crypt.HashAlgorithm := 'sha256';
  key := crypt.Encode(crypt.HashString(strPassword),'hex');
  //  Set the secret key:

  iv := '2314991795132378';

  //  AES Encrypt the file (the file may be any size because it will
  //  stream the file in/out.
  success := crypt.CkEncryptFile(strZipFile,strToFile);

Best regards
Ove Halseth
Posted: 03/29/2016 08:32:47
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Please check the sample that is located inside \EldoS\SecureBlackbox.VCL\Samples\Delphi\PKIBlackbox\SymmetricCrypto folder after SecureBlackbox installation.

Also I’ve noticed there is no Support Access Ticket linked to your user account on EldoS site. Technical Support is provided to customers with the linked Support Access Ticket. You will find your Support Access Ticket together with all the details about how to use it in the registration e-mail that we’ve sent to you upon the purchase.

If you are evaluating the product and don't have a license yet, please let us know and then you can have support according to Basic support level. Basic support level includes answering basic technical questions that appear during product evaluation period. We also offer Premium support for a purchase from https://www.eldos.com/support/calc.php . You can use Premium Support to get higher level of assistance during your evaluation of our products.
Posted: 04/05/2016 10:16:25
by WIS AS (Standard support level)
Joined: 02/29/2016
Posts: 1


I'll check the SymmetricCrypto example.

Turns out I have two users on this forum :(

Now that I have a Ticket, do you have a more elaborate answer? :)

Ove B-)
Posted: 04/05/2016 12:36:17
by Eugene Mayevski (Team)

Thank you for linking the license access ticket. I have added your support access ticket to your account as well.

Did you try the sample, that Vsevolod mentioned? You have most of the information about the needed encryption mode etc. in your original code.

First, the binary key is derived from the password by creating a hash of the password (this approach is not secure, btw). This step can be performed with TElHashFunction (there are several forum posts regarding its use, such as https://www.eldos.com/forum/read.php?FID=7&TID=2835 )

Next, it's used for CBC encryption using AES algorithm. For this you can use the sample referenced by Vsevolod.

Sincerely yours
Eugene Mayevski
Posted: 04/05/2016 12:40:24
by Eugene Mayevski (Team)

Ove Halseth wrote:
iv := '2314991795132378';

I need to add, that we can't guess, how this code is supposed to work. As I read the Chilkat documentation (http://www.chilkatsoft.com/refdoc/csCrypt2Ref.html ), it says nothing about how it translates the string. Given that the string is 16-byte-long, I believe, that SBUtils.BytesOfString() function will produce the same IV ByteArray that Chilkat does.

Sincerely yours
Eugene Mayevski
Posted: 04/05/2016 15:07:20
by Vsevolod Ievgiienko (Team)

I need to add, that we can't guess, how this code is supposed to work

Try to use SBUtils.Unit.BytesOfString() or System.Text.Encoding.ASCII.GetBytes().



Topic viewed 2887 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!