The present invention relates to an electronic device for encrypting and decrypting data, more specifically, the present invention relates to an electronic device for performing symmetrical cryptographical operations on 8 byte-size data blocks according to the Digital-Encryption Standard (DES).
The ISO/IEC 7816-4 Secure Messaging Protocol requires a double-length key triple-DES data encryption and a double-length key triple-DES based message authentication code (MAC). The conventional implementation of this protocol requires the encrypted message to be calculated first and then the computation of the message authentication code on the encrypted message data to be calculated afterwards. The two-step encryption and decryption is conventionally sequentially implemented. This requires a substantial amount of time as the data blocks are first encrypted or decrypted and the message authentication code is subsequently encrypted or decrypted over the whole message length. Further, extra processing time is required for a key exchange, since encryption and MAC are using different keys. Furthermore, extra storage capacities and data paths for handling the encrypted or decrypted data and calculating interim results are required.
It is a general object of the present invention to provide an electronic device adapted to perform the necessary decryption and encryption steps in accordance with the DES standard, which is more efficient and less complex than the conventional solution.
According to an aspect of the present invention, an electronic device is provided for encrypting and decrypting data blocks of a message having n data blocks in accordance with the data encryption standard (DES as defined in the ISO/IEC 7816-4 Secure Messaging Protocol). The electronic device comprises a first data processing channel, which includes a first processing stage for performing encryption and decryption of data blocks of a predefined length. Further, there is a first input data buffer coupled to a data input and to the first processing stage. In a second data processing channel, there is a second processing stage for performing encryption and decryption of data blocks in accordance with the DES standard. Further, there is a second data input buffer coupled to an output of the first processing stage and to the second processing stage. The electronic device further comprises a control stage for controlling the first processing stage and the second processing stage, in a manner so as to perform an encryption or decryption step with the second processing stage on an encrypted or decrypted data block output from the first processing stage. The control stage is adapted to control the first processing stage to perform data encryption or decryption according to the data encryption standard on each block and to control the second processing stage to compute a message authentication code over the encrypted or decrypted message received from the first processing stage block-by-block.
Accordingly, the aspect of the present invention provides a solution, which is based on pipelined and parallel architecture using two processing stages. The processing stage is typically a processor unit dedicated to perform encryption or decryption in accordance with the DES standard. Therefore, the processing stage is also referred to as crypto core. The processing stages or crypto cores allow the execution of two DES operations in parallel. Each crypto core is capable of performing symmetrical cryptographical operations on 8 byte size data blocks according to the DES Standard. Each core can handle single- and triple-DES operations. A single-DES operation encrypts or decrypts a 64 bit wide data block using a 64 bit (i.e. 56 bit plus 8 parity bits in accordance with the DES Standard) key while a 128 bit key is used for triple-DES operations. A triple-DES operation consists of three successive rounds of single-DES operations. Before an encrypt or decrypt operation can be started, the crypto key must be loaded into the corresponding key register.
For triple-DES a single 128 bit key K is defined and has two 64 bit keys KA and KB concatenated together:
K:=K
A
∥K
B
A triple-DES encryption operation is defined as follows:
1) C′:=DES(KA, P)
2) C″:=DES−1(KB, C′)
3) C:=DES(KA, C″)
And a triple-DES decryption operation is defined as follows:
4) P′:=DES−1(KA, C)
5) P″:=DES(KB, P′)
6) P:=DES−1(KA, P″)
where DES means a single-DES encryption, DES−1 a single-DES decryption, P a plain text block and C a cipher text block.
After the desired mode for the channel has been configured, the data can be written to the input data buffer. When an 8 byte block of data has been written to the buffer, the DES operation can be started manually or, if so configured, it is started automatically when the last (8th) byte of the block is written into the data buffer. An interrupt can be generated upon completion of the operation.
The control stage is adapted to control the first processing stage to perform data encryption according to the data encryption standard on each block and to control the second processing stage to compute a message authentication code over the encrypted message received from the first processing stage (DES crypto core) block-by-block. This is in accordance with the DES Standard and the two processing stages of the electronic device according to the present invention are specifically adapted and controlled to perform data encryption or decryption block-by-block, wherein the encrypted or decrypted blocks are further computed in the processing stage (DES crypto core), so as to retrieve or to apply the message authentication code over the whole message, i.e. all blocks of the message, but on a block-by-block basis.
According to an aspect of the present invention, the electronic device comprises a first key register for storing a first encryption or decryption key to be used by the first processing stage, and a second key register for storing a second encryption or decryption key to be used by the second processing stage. This aspect of the present invention allows the encryption or decryption operations to be performed by the two processing stages basically independently from each other. An exchange of keys in the registers is not necessary.
In order to implement a real pipelined, partially parallel architecture, the second input data buffer should advantageously have twice the size of the first data buffer. Having a data buffer of double size is particularly helpful for a pipelined operation, as consecutive results and header information for the second crypto core have to be stored in the second channel. In fact, the computation of the message authentication code in the second channel requires feeding alternately encrypted or decrypted data blocks output from the first channel to the second processing stage. Therefore, a double size input data buffer improves throughput and speed. The first processing stage and the second processing stage are both adapted to perform single-DES and triple-DES operations. The first and second encryption keys have a maximum length of 128 bit. Accordingly, the first and second key registers can be restricted to this maximum bit length. This allows the storage capacity to be limited.
According to an aspect of the present invention, the first channel is preferably adapted to perform ECB mode and CBC mode for encryption and decryption and the second channel is advantageously adapted to perform ECB for encryption and decryption and CBC mode for encryption only. When encrypting or decrypting multiple blocks of data, the blocks can either be operated independently of each other or the result of an operation can be used to influence the next one. In an encryption and decryption according to the Electronic Codebook mode (ECB), each block is encrypted and decrypted independently of the other blocks of a message. This basic encryption and decryption configuration is shown in
An aspect of the present invention also relates to a method for encrypting a message having n data blocks. A data block is encrypted in a first processing stage in accordance with a single-DES or triple-DES operation. The encrypted data block is passed to a second processing stage (crypto core). In this second processing stage the encrypted data block is further encrypted in accordance with a single-DES or triple-DES operation. The first encryption step performs data encryption on each block and the second encryption step performs computation of a message authentication code over the encrypted message block in a block-by-block manner. Likewise, a method for decrypting a message having n encrypted data blocks and a message authentication code is provided. The encrypted data block is decrypted in a first processing stage in accordance with a single-DES or triple-DES operation. The decrypted data block is passed to a second processing stage, where the decrypted data block is further decrypted in accordance with a single-DES or triple-DES operation. The first decrypting step performs data decryption on each block and the second decrypting step retrieves the message authentication code over n blocks. In this way, it is possible to compute the whole encryption in a partially parallel manner using a pipelined structure, which incorporates two independent processing stages (crypto cores).
Further aspects of the present invention will ensue from the description hereinbelow of the preferred embodiments, with reference to the accompanying drawings, in which:
The decryption procedure is illustrated in
The double core DES3DES module according to the present invention is designed to enhance throughput when data is to be sent or to be received according to the secure messaging scheme. Since the message authentication code MAC is calculated over the encrypted data, which at some point is either written to the module for decryption or to read from it after encryption, the electronic device according to the present invention is preferably designed to automatically use this data as input into the MAC channel (CH2). This data must therefore not be moved separately into the second channel CH2 in order to calculate the MAC.
The input data stream from the encryption block is split into a 7 byte data portion which is to be combined in the second DES path with the data header (1 byte, e.g. DO'87, according to the ISO/IEC 7816-4). Therefore, the last byte of the 8 byte output from the encryption block is passed to the next DES core and combined with the first 7 bytes of the respective output from the second block of the encryption stage. The epilog can be the DO'99 data object of the ISO/IEC 7816-4 Secure Messaging Protocol. This data splitting due to the necessary inclusion of the data header information is the reason for the double-size input buffer in the MAC stage shown in
The data and key registers in the module are preferably implemented as a kind of a left-shift register. The first byte or word that is written to these registers is written to the far left of the register. The following bytes or words are then always written to the right of the previous data. This allows the content of the registers to be viewed in lexical order (from left to right) which complies with many protocol specifications. The first byte of 8 bytes written into the data registers is therefore the leftmost byte of the 8 bytes. An example for a single DES operation looks as follows (all numbers are hexadecimal):
Key=0123 4567 89AB CDEF
Plain=CAFÉ ABBA 1234 ABCD
Cyphered=3E3B 1B17 F395 6E62
The first word of the key written to the key register is 0123 followed by 4567 and the last word CDEF. (The key must always be written word-wise into the key register.) The same applies to the data where the first byte is CA and the last byte CD. Then, the first result byte read is 3E and the last byte 62.
Only DES channel 1 (CH1) has a dedicated output register. The results from channel 2 (CH2 or MAC channel) are read directly from the registers in the DES core. It is therefore not possible to read any results from channel 2 while the DES core is running. This is only possible (or meaningful) for channel 1 when using ECB mode and when encrypting in CBC mode.
Again, the data stream from the decryption stage is split into two data paths. One receiving the first seven bits of the first block output from the decryption stage and the data header (1 byte), which can be the DO'87 of the ISO/IEC 7816-4 Secure Messaging Protocol. The separator added in the last 3DES stage of the MAC stage shown in
Although the present invention has been described with reference to a specific embodiment, it is not limited to this embodiment and no doubt alternatives will occur to the skilled person that lie within the scope of the invention as claimed.
Number | Date | Country | Kind |
---|---|---|---|
10 2007 052 656.5 | Nov 2007 | DE | national |
This patent application is a continuation which claims priority from U.S. Nonprovisional patent application Ser. No. 12/264,782, filed Nov. 4, 2008, which claims priority from German Patent Application No. 10 2007 052 656.5, filed Nov. 5, 2007, which are incorporated herein by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | 12264782 | Nov 2008 | US |
Child | 14163924 | US |