Elatec GmbH
Page 50 of 65
7.6.16 DES / Triple-DES Data Encryption/Decryption
„ds‟
Use this command to perform encryption/decryption operations on 8 byte data blocks. The command
offers both Single-DES and Triple-DES crypto functions. Triple-DES cryptology is based on two keys
data encryption/decryption. Keys can be passed via serial connection, optionally the internally stored
keys can be used.
Command:
‘ds’[Options][Key/KeyNumber][Data]
Parameters
Description
[Options]
Option byte (1 byte)
[Key/KeyNumber]
Key (8 or 16 bytes) / Key number (1 byte)
, 00h…0Fh
[Data]
Data to be encrypted/decrypted (8 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
KeyLength
KeyIndex
Encode:
1
Encode the data
0
Decode the data
KeyLength:
1
Use Triple-DES algorithm with 16 bytes key
0
Use Single-DES algorithm with 8 bytes key
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
ds0011223344556677881020304050607080
Decode ciphertext 1020304050607080 with Single-DES algorithm using key
1122334455667788
Plaintext is 1B3446C2C2AA73CDh
ds070A1020304050607080
Encode plaintext 1020304050607080 with Triple-DES algorithm using
EEPROM-key 0Ah.