0% found this document useful (0 votes)
25 views3 pages

A File Encryption Algorithm Based On Dynamic Block Out of Order Matrix Mapping

Uploaded by

ongbro1224
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views3 pages

A File Encryption Algorithm Based On Dynamic Block Out of Order Matrix Mapping

Uploaded by

ongbro1224
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

2018 International Conference on Security, Pattern Analysis,

and Cybernetics (SPAC)

A File Encryption Algorithm Based on Dynamic


Block Out of order Matrix Mapping

1st Tan Dong 2nd YanXia Wang 3rd Liu Lei


Department of Technical Chongqing Research Center for Infor- The school of advanced manufacturing
Chongqing Radio and Television Digital mation and AutomationTechnology engineering
Media Co., Ltd. Chongqing Academy of Science and Chongqing University Of Posts And
Chongqing, China Technology Telecommunications
[email protected] Chongqing, China Chongqing, China
[email protected] [email protected]

Abstract—In order to solve the security of content transfer divided into the same proportion of blocks for data
during file transfer and fast encryption of large files. This paper replacement. The extracted raw data, indexes and weights of
proposes a method to quickly encrypt large files and protect the relevant data are calculated according to certain rules to form
contents of file information, also prevent files from being a block of data to be mapped into the matrix in disorder. And
intercepted and decrypted before use. The algorithm of file then conduct the Base64 coding to the disordered matrix data
encryption based on dynamic block out of order matrix so that the matrix is equivalent to the unique decryption key
mapping. First, dynamically block the files according to a of the file.
certain ratio, extract the raw data and key information of each
block, then store the out of order data into a two-dimensional II. CONSTRUCT ENCRYPTION ALGORITHM
table of matrix after calculation and processing. Second, use
Base64 encoding on this matrix mapping table. Then the matrix A. Dynamic Block with random position of File
mapping table is to be a unique decryption key of this file. After The file to calculate the number of blocks by use file
that, the data in the spare block of the file is filled with the MD5 length(Byte) mod 1024 3 powers, Then multiply by 8. It can
data, the MD5 data is generated by UUID and block with the be calculated by the following formula:
same size as the number of dynamic block. The new encrypted
file whose length is equal to the original file. Because it is
dynamic block and random extracted data, so it is fast and
8 L < 10243
Β= (1)
( L 1024 ) × 8
efficient. The experimental results and security analysis show 3
that the algorithm has a good encryption structure and high
L ≥ 10243
security, which can effectively resist various attack behaviors.
Most of the files that with different types can be used, and the Where L is the length of the file (Byte) and B is the
speed to encrypt and decrypt large files is greatly improved calculated number of blocks.
compared with the traditional encryption and decryption
After determining the number of blocks, and then
methods, the speed and efficiency far exceed the traditional file
randomly determine the range of extracted data positions of
encryption and decryption algorithms, such as AES, DES,
3DES and so on. each block. Specifying that the file header and the file tail are
fixed extracted data blocks [4], the other B-2 blocks
Keywords—Dynamic block, Large file, Encryption, Out of determine the position by generating random numbers. And
order Matrix, Mapping the size of each block is 4 bytes, so the random number range
is (4, L-4).
I. INTRODUCTION
The formula for generating random numbers is the Linear
At present, the encryption methods of common files Congruence Method [5]:
mainly adopt symmetric encryption algorithms, such as AES
, DES, 3DES and so on [1]. Symmetric encryption is fast, = + , ≥ 0. (2)
simple, with small calculation, and uses the same key for Among them,
encryption and decryption. This method has obvious
, ℎ ; 0< .
advantages in encrypting small files or text messages, but for
, ℎ ; 0≤ < .
the medium-sized or large files the process of encryption is
slow and inefficient. In addition, both the encrypting side and , ℎ ; 0≤ < .
the decrypting side of the file need to share and use the same , ℎ ;0 ≤ < .
key [2]. If there is leakage for any side, then the encrypted The structure resulting from the final block is roughly as
information is not safe any more, which is not safe for both follows:
side. And also there is a problem with the uniqueness of this 0 1 2 …… B-1 B
key, which may be duplicated [3].
Fig. 1. The Structure of Blocks
Therefore, in order to solve the above problems, this paper
proposes a file encryption algorithm based on dynamic block B. Generate replacement data blocks
out of order matrix mapping: dynamically block files
according to a certain random ratio, extract 4 bits of raw data Then generate a UUID and remove the - separator [6] in
between each blocks. The MD5 value generated by UUID is the UUID. MD5 is performed on the UUID, and the 32-bit

978-1-7281-0551-2/18/$31.00 ©2018 IEEE 246


Authorized licensed use limited to: Sherwine Sheba S. Downloaded on October 17,2023 at 14:53:28 UTC from IEEE Xplore. Restrictions apply.
2018 International Conference on Security, Pattern Analysis,
and Cybernetics (SPAC)

string of the UUID is divided into blocks, also the 32-bit string
of the obtained MD5 is also divided into blocks [7]. The Calculate the Randomly determine
Raw File number of blocks
UUID block data after is used as the weight value of each data the block position
in the matrix, and the data of the MD5 block is converted to
the Byte to replace the raw data. Each block is 4 bytes in size.
C. Construct an out of order encryption matrix
First, the raw data of each block execute to add Calculate data, random Block MD5 generated by
keyWeight, displacement and so on, to get a meaningful stored in matrix UUID to replaced raw data
encryption data. Here is the following calculation method is
used for encryption to generate encrypted data:
[block+index+100][blockIndex+index+100][data+index
+100][start+keyWeight][keyWeight+10000000] Matrix converted to string, Generate Base64 key
then encoded by Base64 and encrypted file
In this format:
131 127 218 163008429 15131510
16300842 Fig. 3. Encryption process
131 127 218 15131510
9
The flow chart of decryption is as follows:
block blockInde
data+inde keyWeight
+ x start+
x +
index +index keyWeight
+100 10000000 Key Base64 Recover
+100 +100
decode matrix
Fig. 2. Data calculated format

The block is the number of the block, index is the position


index stored in the matrix, blockIndex is the index within the Calculate the block number,
Raw data replacement
block (for example, the index position in the 4 Bytes raw data, position, and raw data for
from 0 to 3), the data is the raw data Byte value, and the start recovery each data of the matrix
is the block start position in the file. The keyWeight is the
weight value obtained by calculating the ASCII code of the
character after the UUID grouping. In this way, an encrypted
data string is obtained, and a total of B × 4 size data strings Get the
need to be calculated and placed into the matrix. original file

Next, a random number in the range of B × 4 (0, B × 4) is


generated as an out of order storage postion in which the Fig. 4. Decryption process
calculated B × 4 size data strings are stored in the matrix.
The format stored in the matrix is as follows: III. EXPERIMENTS AND RESULTS
Select the files of 187MB, 1187MB and 2385MB as the
TABLE I. ENCODED MATRIX STORAGE FORMAT experimental data. Use the same size, and different file
Index Row Data encryption algorithms to get the time consuming statistical
0 1 … B-1 comparison. Here, the typical mainstream symmetric
encryption encryption encryption algorithm is selected: AES, DES, 3DES algorithm
0 … encryption data for statistical comparison with this paper algorithm.
data data
encryption encryption
1 … encryption data The 187MB file is dynamically divided into 8 random
data data
encryption encryption blocks by the formula (1). The random positions obtained in
2 … encryption data
data data the experiment are: 0, 34481781, 173960708, 35428008,
3
encryption encryption
… encryption data 122204283, 94115247, 77991145, 1973674040. The
data data generated matrix size is 8×4 size, the generated key length is
D. Generate a decrypted key 1152 Byte. The encryption takes 595 milliseconds, and the
decryption takes 24 milliseconds.
Finally, the two-dimensional matrix is converted into a
string, and the 32-bit UUID is spliced at the end, then the final The figure uses DBS to represent the algorithm of this
string encoded by Base64. So the string is the final decryption paper. The time consuming comparison statistics of the
key. 187MB file is as follows:
The decryption operation algorithm step is also the inverse
process of encryption [8]. The key step is to decrypt the data
of each original file in the matrix, and then perform the
replacement and recovery according to the block index
position.
The flow chart of encryption is as follows:

978-1-7281-0551-2/18/$31.00 ©2018 IEEE 247


Authorized licensed use limited to: Sherwine Sheba S. Downloaded on October 17,2023 at 14:53:28 UTC from IEEE Xplore. Restrictions apply.
2018 International Conference on Security, Pattern Analysis,
and Cybernetics (SPAC)

Encryption time Decryption time Encryption time Decryption time

232231
18401

209507
17473
Algorithm takes time

Algorithm takes time

104650
(milliseconds)

(milliseconds)
8607
8581

90939
57529
41861
4100
2735
595

425
24

27
DBS AES DES 3DES DBS AES DES 3DES

Fig. 5. 187MB file encryption and decryption time consuming statistical


comparison Fig. 7. 2385MB file encryption and decryption time consuming statistical
comparison
The 1187MB file is dynamically divided into 8 random
blocks by the formula (1). The random positions obtained in Combining the three statistical charts, we can see that the
the experiment are: 0, 1078708605, 323133824, 609375030, encryption and decryption speed of the algorithm is much
763565877, 764770122, 917633321, 1252903205. The higher than the AES, DES, and 3DES algorithms, also the
time spent on encryption and decryption is basically not
generated matrix size is 8×4 size, the generated key length is
affected by the file size.
1172 Byte. The encryption takes 360 milliseconds, and the
decryption takes 28 milliseconds. IV. CONCLUSIONS
The figure same uses DBS to represent the algorithm of Through experiments and data analysis, the algorithm of
this paper. The time consuming comparison statistics of the dynamic block out of order matrix mapping in this paper is
1187MB file is as follows: more effective and far less time-consuming in file encryption
and decryption than AES, DES and 3DES algorithms. The
Encryption time Decryption time larger the file is, the advantage of its speed and time spent on
encrypting and decrypting will be more obvious. In addition,
117120
106252

the time-consuming of encryption and decryption is basically


Algorithm takes time

unaffected by the size of the file. As it is dynamic block of the


(milliseconds)

file, with the random extraction of raw data, the random


53930
49900

selection of data block location, and out of order mapping


21036
12840

after the confusion of data calculation into the matrix to form


keys, security and efficiency can fully meet the function of
360
28

cryptography.
DBS AES DES 3DES
REFERENCES
Fig. 6. 1187MB file encryption and decryption time consuming statistical
comparison
[1] Panda M, Nag A. Plain Text Encryption Using AES, DES and
SALSA20 by Java Based Bouncy Castle API on Windows and
The 2385MB file is dynamically divided into 2×8 random Linux[C]//Advances in Computing and Communication Engineering
blocks by the formula (1). The random 2 × 8 positions (ICACCE), 2015 Second International Conference on. IEEE, 2015:
obtained in the experiment are: 0, 713463986, 1418909879, 541-548.
1951280390, 1965044600, 2096603066, 2499832095, [2] Singh G, Kinger S. Integrating AES, DES, and 3-DES encryption
2443940873, 2289790361, 2237453225, 2171881527, algorithms for enhanced data security[J]. International Journal of
2157515025, 2122325312, 2151005447, 2145410690, Scientific & Engineering Research, 2013, 4(7): 2058.
2505806394. The generated matrix size is 16×4 size, the [3] Sivakumar R, Balakumar B, Pandeeswaran V A. A Study of
Encryption Algorithms (DES, 3DES and AES) for Information
generated key length is 2412 Byte. The encryption takes 425 Security[J]. 2018.
milliseconds, and the decryption takes 27 milliseconds.
[4] Li Xiaodong, Zhou Cailan, Huang Linquan. A SECURE AND
The figure same uses DBS to represent the algorithm of EFFICIENT IMAGE ENCRYPTION ALGORITHM BASED ON
DNA CODING[J]. Computer Application and Softwre, 2018, 35(1):
this paper. The time consuming comparison statistics of the 318-324.
2385MB file is as follows: [5] Cicirello V A. Impact of Random Number Generation on Parallel
Genetic Algorithms[C]//Proceedings of the Thirty-First International
Florida Artificial Intelligence Research Society Conference. 2018: 2-
7.
[6] Balkić Z, Šoštarić D, Horvat G. GeoHash and UUID identifier for
multi-agent systems[C]//KES International Symposium on Agent and
Multi-Agent Systems: Technologies and Applications. Springer,
Berlin, Heidelberg, 2012: 290-298.
[7] Binti Suhaili S, Watanabe T. High-Throughput Message Digest (MD5)
Design and Simulation-Based Power Estimation Using Unfolding
Transformation[J]. Journal of Signal Processing, 2017, 21(6): 233-
238.
[8] Chai X, Chen Y, Broyde L. A novel chaos-based image encryption
algorithm using DNA sequence operations[J]. Optics and Lasers in
engineering, 2017, 88: 197-213.

978-1-7281-0551-2/18/$31.00 ©2018 IEEE 248


Authorized licensed use limited to: Sherwine Sheba S. Downloaded on October 17,2023 at 14:53:28 UTC from IEEE Xplore. Restrictions apply.

You might also like