dimanche 22 mars 2015

Is it safe to encrypt data by simply randomizing chucks based on a permutation?



Say I want to encrypt the following text: "Today is March the 22nd, 2015". And say want to encrypt 8-byte blocks of data using the following permutation [6,3,0,1,5,7,2,4] to swap characters at those indexes.


[T|o|d|a|y| |i|s| |M| a| r| c| h| | t| h| e| | 2| 2| n| d| ,| | 2| 0| 1| 5] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28


Using the encryption key [6,3,0,1,5,7,2,4], encrypting the first block goes like this:


First index is 6, so move the character of index 6 in the plain text to the first position of the cryptotext


cryptotext: [i]


Second one is 3, so add the character of index 3 to the cyptotext


cryptotext: [i|a]


When we finish the first block it looks like this:


cyptotext: [i|a|T|o| |s|d|y] (without the "|").


Then continue to do the same for the other blocks. If the length if the text is not a multiple of the block size, just pad with some character and remove it after decryption.


I can't think of any type of attack except for brute force. This would basically mean generating all permutations of size n (where n is the block size). For block sizes larger than 1KB, it's basically computationally infeasible to break it.


Can anyone think of any other type of attack?





Aucun commentaire:

Enregistrer un commentaire