The Reordering Technique

(Ema_1, Unmasking/Decryption) – Reordering is the opposite of shuffling. The only difference is that the Reordering must start from the end of the masked byte block and the last index of the key.

Below is the reordering technique (unmasking) applied to the previous shuffling technique (masking) example.

KEY & DATA
INDEX
KEY
VALUES
DATA BEFORE
Reordering
Reordering
(UNMASKING)
DATA
RESULT
000006dgaa
001007lhbb
002015epcc
003000fgdd
004002bpee
005009cjff
006013nagg
007008ibhh
008004pbii
009010kfjj
010003gfkk
011012amll
012014olmm
013011mann
014001hloo
015005jcpp
015014013012011010009008007006005004003002001000

Example of reordering in unmasking/decrypting stage

1. key(15)=5, j → data(5), c → data(15)
2. key(14)=1, h → data(1), l → data(14)
3. key(13)=11, m → data(11), a → data(13)
4. key(12)=14, o → data(14), l → data(12)
and so on.

As you can see from the example, at the end of the Reordering we can reconstruct the original order (the rightmost element for each row). Unlike the other techniques, in reordering we start from the end of the block and the end of the key.

From a computational point of view, all that is required is to overwrite the elements of an array, and the speed of execution is the same as for the shuffling technique.

Note
We have seen how, at a theoretical level, the masking and unmasking steps work to encrypt and decrypt a data source with Ema_0 and Ema_1, the techniques of replacement and substitution and shuffling and reordering are completely independent.
Ema_0 can be used for all types of data, especially for text files or data sources that are easily recognisable.
Ema_1 can be used for all types of data, but for plain text files, it should first be compressed or masked by Ema_0.
EMA uses both, Ema_0 and Ema_1 techniques at the same time.

Scroll to Top