A Symmetric-Key Block Cipher Generating Cryptograms Containing Characters Belonging to the Definite Set
? Czeslaw Koscielny 2008
Academy of Management in Legnica, Poland,
Faculty of Computer Science,
Wroclaw University of Applied Informatics, Poland
e mail: c.koscielny@wsm.edu.pl
Abstract
A strong symmetric-key block cipher of byte-oriented architecture has been described. The encryption algorithm transforms a plaintext file into a cryptogram file consisting of such ASCII characters only which belong to the set determined by the user.
1. Introduction
This application is intended as an initial step on the way at the end of which cryptography and steganography converge. The issue is that the encryption procedure should be able to turn a plaintext file into a cryptogram in the form of a file containing quite reasonable message but unrelated to the plaintext file. For example, we could want to convert a phone call representing the plaintext file into the cryptogram file being the photo of a spacecraft. After such action the cryptogram is quite different from classic cryptograms looking usually as outputs of random ASCII characters generator. The method of encryption presented here produces cryptogram files comprised of characters which belong to the set determined by the cryptographic key, using the operations of conversion between bases and substitution. In general, the cipher is redundant, i.e. the size of the cryptogram file is usually greater than that of the plaintext file.
2. Key Generation, Encryption and Decryption Algorithms
It is assumed that the plaintext and the ciphertext blocks are files stored in the disk. Furthermore, the encryption/decryption algorithms do not divide the plaintext/cryptogram files into smaller blocks but process these files in the whole. It is also assumed that one out of the three components of the secret encryption/decryption key, namely , is passed to cryptographic routines as an integer in hexadecimal notation. However, since this component can have even 100.000 bits or more, to minimize the size of data on the key we may replace this notation by simple expression, the value of which is equal to the above mentioned integer.
2.1. Key Generation
Input: the number of elements of the set of ASCII characters which will be contained in the cryptogram file (evidently, the size of a plaintext file.
1. Determine the < and convert this integer into hexadecimal notation .
2. Choose b elements of the set of characters , where the byte value of ASCII character. Merely characters belonging to the set cs will be present in the cryptogram file.
3. Generate an arbitrary permutation π of the set cs and create the table
4. Determine the table
Output: encryption key, decryption key. The equivalent maximal key length equals approximately to bits, since there are different substitution tables
2.2. Encryption Algorithm
Input: a plaintext file of size , encryption key.
1. Read of bytes from the plaintext file and place them in the list
2. Append a random element from the set to the list . This step is necessary because the plaintext file may contain zero bytes at its end.
3. Represent the hexadecimal number as the decimal number .
4. Compute
.
5. Convert base 10 number to base and create the list , where ∈{0, 1, ..., } denotes the th digit of the number in base notation, the most significant digit at the end of the list.
6. Compute the list .
7. Write all bytes from the list to the cryptogram file.
Output: the cryptogram file of size .
2.3. Decryption Algorithm
Input: a cryptogram file of size , decryption key.
1. Read of bytes from the cryptogram file and place them in the list
2. Compute the list
+ .
5. Convert base 10 number to base 256 and create the list .
6. Remove the last byte from the list
7. Write ps bytes from the modified list toretrieved plaintext file.
Output: retrieved plaintext file of size
3. Maple Routines Allowing to Implement the Cipher
The following 13 procedures allowing to experiment with the discussed cipher have been implemented in Maple interpreter and written into the file routines.m:
4. Examples
We will show how to encrypt three plaintext files representing sound, text and image messages, respectively, employing the procedures described in the previous section. For any plaintext file we will generate four cryptograms by means of four secret keys having the same component and various substitution tables. Next, we will decipher the obtained cryptograms using identical component and appropriate substitution tables. We will also produce histograms showing the frequency of occurrence of bytes in the plaintext and cryptogram files.
To begin with, assuming that the file routines.m in the directory C:\\dschc is stored, together with the worksheet file dsc.mw, plaintext files m.wav, m.txt and m.jpg, we ought to execute:
4.1. Encryption of m.wav file and Decryption of its Cryptogram Files
We will see the histogram of the plaintext file first:
This file contains the majority of characters of byte value from 0 to 255. We may set now the component kn of the secret key. Its maximal value depends on the plaintext file size:
Let the component kn of the secret key be:
The above value of kn will be used in computing all four cryptograms including characters form four different sets. We determine now the set of b characters of which the cryptogram file will consist and substitution tables ek and dk, invoking the routine keycomb:
To see the result of carrying out of the above statement we execute:
Taking into account the number of substitution tables ek and the determined value of kn we can get the quivalent real key length by means of the statement:
Having the above data, i.e. b, kn, dk, we can compute the cryptogram of the plaintext file:
It can be observed that in the current directory the cryptogram file cwav.cmb has been created. It's worth seeing the frequency of bytes in this file:
To decrypt the cryptogram file cwav.cmb we must use the same values of b and kn as in encrypting and the following substitution table:
The retrieved plaintext file mcmb.wav has been created in the current directory. It is easy to verify that this file is identical to m.wav, by executing the statement:
Now we have:
Assuming already computed value for kn, we will have the cryptogram
We see that the second cryptogram really contains the desired characters, that is the decimal digits. One can now decipher the cryptogram and verify that the decrypted file is identical with the plaintext file:
The third cryptogram file will contain the control characters with byte values in the range 0 .. 31:
One can see that the cryptogram file is built now from all control characters. Let us examine the correctness of decryption:
If we want to produce the cryptogram file contained all 5 vowels and 6 random consonants, represented as lowercase letters, we should execute:
Let us, as usual, see the frequency of bytes in the last cryptogram file:
At last, we can decrypt the cryptogram file and verify that the decrypted file is identical to the plaintext file:
One can now remove cryptogram and retrieved plaintext files from the disk:
4.2. Encryption of m.txt file and Decryption of its Cryptogram Files
The statements mentioned below concern encryption of plaintext file carrying the text message. The statements are very similar to these in the previous section and need no comment.
4.3. Encryption of m.jpg file and Decryption of its Cryptogram Files
The last example makes it possible to observe the encryption process of the plaintext file representing the image message.
5. Conlusions
A quite new conception of strong encryption has been introduced. The presented routines allow to implement the cipher generating cryptogram files with the desired set of ASCII characters. In order to transform any cryptogram into a spurious message, the cryptogram may be replenished with extra dummy characters which do not belong to the proper set and which should be removed during decryption. For example, if we generate a cryptogram containing random decimal digits, we can next convert it into a list of insured persons and their insurance policy numbers. This approach is a kind of the steganocryptography.
The encryption/decryption procedures described in Section 3 are not, however, multipurpose and are suitable for encipher files of rather small and medium size. It is evident that one can construct many similar byte oriented block ciphers processing the plaintext file in relatively large blocks of bytes, more versatile and even stronger than described here, using not only the operation of base conversion and substitution, but also a permutation of any block of bytes.
Reference
[1] C. Koscielny - Maple Tools for Preliminary Cryptanalysis, 2004, http://www.maplesoft.com/applications/app_center_view.aspx?AID=1302
Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities.