EldoS | Feel safer!

Software components for data protection, secure storage and transfer

AESEncryption.SetKey

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#9677
Posted: 04/13/2009 09:17:06
by David Perkins (Standard support level)
Joined: 12/03/2008
Posts: 17

I'm using the Delphi libraries in BCB2006 and am trying to use the AESEncryption.SetKey routine. The header gives that function declaration as:

void __fastcall SetKey(AnsiString Remote, ByteArray Value);

What's a ByteArray and what would I use in BCB?

Thanks

David
#9679
Posted: 04/13/2009 09:54:53
by Eugene Mayevski (EldoS Corp.)

ByteArray is an alias of "array of byte" in Delphi. In BCB it should be "byte[]"


Sincerely yours
Eugene Mayevski
#9680
Posted: 04/13/2009 10:11:40
by David Perkins (Standard support level)
Joined: 12/03/2008
Posts: 17

If it's byte[], how does SetKey know the length of the key?
#9681
Posted: 04/13/2009 10:44:55
by Eugene Mayevski (EldoS Corp.)

AES key must always be exactly 16 byte long. This is a fixed length of the key defined by AES standard.


Sincerely yours
Eugene Mayevski
#9682
Posted: 04/13/2009 10:46:59
by David Perkins (Standard support level)
Joined: 12/03/2008
Posts: 17

Ah, OK. Help files says 16,24 or 32 bytes, hence my question.
#9683
Posted: 04/13/2009 11:05:33
by Eugene Mayevski (EldoS Corp.)

Good point and I must appologize for misleading you:

"array of byte" in Delphi is a *dynamic array*, and the code measures the length of the key (16, 24 or 32 bytes) and uses appropriate algorithm (AES128, AES192 or AES256) for encryption. Consequently, in C++Builder this WON'T be byte[]. Unfortunately I don't know the syntax of the dynamic arrays in BCB, but if you look at MCAES.hpp file generated by compiler, there you will find the declaration of the method.

I don't have the code near me and that's why I gave you wrong information.
So it's about the source code which might give better answer than support sometimes :).


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.

Reply

Statistics

Topic viewed 3220 times

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




|

Back to top

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

Got it!