EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Creating bytearray from array of byte

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#28545
Posted: 02/25/2014 08:16:12
by informatica@cst.cat (Standard support level)
Joined: 02/20/2014
Posts: 12

Hi,

I want to pass an array of 16 bits to create an AES 128 bit key, but I don't know how to convert it to a bytearray type wich is used by TElSymmetricKeyMaterial.Key.

My array is:
KeyBuf2[0]:=$11;KeyBuf2[1]:=$b6;KeyBuf2[2]:=$92;KeyBuf2[3]:=$b8;
KeyBuf2[4]:=$97;KeyBuf2[5]:=$36;KeyBuf2[6]:=$6d;KeyBuf2[7]:=$27;
KeyBuf2[8]:=$40;KeyBuf2[9]:=$a1;KeyBuf2[10]:=$d0;KeyBuf2[11]:=$c0;
KeyBuf2[12]:=$d9;KeyBuf2[13]:=$da;KeyBuf2[14]:=$d4;KeyBuf2[15]:=$fa;

Thanks in advance.
#28546
Posted: 02/25/2014 08:22:14
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

The preudo-code is:

Code
var
  Key: ByteArray;
begin
  SetLength(Key, 16); // 16 bytes long
  Move(your_array[0], Key[0], 16); // use Key with TElSymmetricKeyMaterial
  ...
#28547
Posted: 02/25/2014 08:27:54
by informatica@cst.cat (Standard support level)
Joined: 02/20/2014
Posts: 12

It works perfectly for me, thank you!

Reply

Statistics

Topic viewed 763 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!