主权项 |
1. A method for encrypting plaintext digital data divided into a sequence comprising successive plaintext blocks of a same length and a residual plaintext block having a length less than the length of one of the successive plaintext blocks, the method comprising preliminary step of:
a) inputting, by an electronic processor, the sequence of successive plaintext blocks into a pre-processing module comprising at least a ciphering module, an addition module, registers and a memory containing a main encryption key, the addition module applying a logical exclusive OR (XOR) operation carried out bitwise; b) ciphering the successive plaintext blocks with the main encryption key by using an encryption algorithm based on a cipher block chaining mode where the first block is added to an initialization vector and each following plaintext block is added to the preceding ciphered block before being encrypted with the main encryption key, to obtain a sequence of successive ciphered blocks each of the same length as one of the successive plaintext blocks; c) generating a set of round keys having a same length by applying a key schedule function on a string obtained by adding the last ciphered block to the main encryption key; d) adding together by the addition module all or part of the round keys of the set, to obtain a resulting string having a length equal to the length of a block; e) adding to the residual plaintext block the most significant bits of the resulting string forming a string having a length equal to the length of the residual block, to obtain a residual ciphered block; f) outputting the sequence of successive ciphered blocks, including the previously obtained successive ciphered blocks followed by the residual ciphered block. |