Elatec GmbH
Page 49 of 65
7.6.15 AES Data Encryption/D
ecryption „as‟
Use this command to perform AES encryption/decryption on 16 byte data blocks. Keys can be passed
via serial connection, optionally the internally stored keys can be used.
Command:
‘as’[Options][Key/KeyNumber][Data]
Parameters
Description
[Options]
Option byte (1 byte)
[Key/KeyNumber]
Key (16 bytes) / Key number (1 byte), 00h…0Fh
[Data]
Data to be encrypted/decrypted (16 bytes)
Option byte:
Options
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RFU
RFU
RFU
RFU
RFU
Encode
RFU
KeyIndex
Encode:
1
Encode the data
0
Decode the data
KeyIndex:
1 The command uses the EEPROM key, specified by KeyNumber
0 The key is passed via serial connection
Answer
Answer
Description
‘Data<CR><LF>’
Encrypted/Decrypted data
‘R<CR><LF>’
Error: Key index out of range
Examples
Command
Description
as00001122334455667788
99AABBCCDDEEFF00102030
405060708090A0B0C0D0E0F0
Decode ciphertext 00102030405060708090A0B0C0D0E0F0 using key
00112233445566778899AABBCCDDEEFF
Plaintext is 781536D4D011A7C5389598AD60AAFFA0h
as0509001020304050607080
90A0B0C0D0E0F0
Encode plaintext 00102030405060708090A0B0C0D0E0F0 using EEPROM-key 09h.