Implementation of encryption software based on Java-based Misty1 algorithm (source code + paper)

Abstract
With the rapid development of computer networks and communication technologies, information security has become one of the most important issues that the information society urgently needs to solve. Cryptography is the core technology to ensure information security. This article uses JAVA language to develop an encryption software based on Misty1 algorithm, which can encrypt and decrypt files. In the specific implementation, the basic structure of the Misty1 algorithm was first analyzed, the corresponding implementation method was designed, and the algorithm was correctly implemented. Secondly, a graphical user interface was designed. Finally, the software was tested to verify the correctness of the implementation method. .

Keywords: Misty1; Java; encryption; decryption
1.1 Subject background
Modern cryptography is a rapidly developing applied science. With the rapid popularity of the Internet, people rely on it to transmit a large amount of information, but the transmission of this information on the network is open. Therefore, the information related to personal interests must be encrypted before it can be transmitted online, which will not be possible without modern cryptography.
The Misty1 algorithm was published in 1996. It is a block cipher algorithm with a key length of 128 bits and a plain text length of 64 bits. It was submitted to NESSIE by Eisaku Takeda who works at Mitsubishi. MISTY1 can be implemented in a resource-constrained environment. The whole algorithm is composed of recursion and so on, and the structure of each level is a secure Feistel structure. MISTY1 is an iterative password that can be iterated for more than 8 rounds, or more generally, iterated 4 times. It uses a 128-bit key to encrypt 64-bit data in uncertain cycles. It uses two S-boxes, one 7 × 7 S-box, s7, and one 9 × 9 S-box, s9. It has achieved a good resistance line and identification of attacks, but also enables implementation with relatively few logic components in a relatively low degree of execution function.
1.2 Current research status at home and abroad
With the popularization of computers in our country, computer and communication technologies have been widely developed and applied in our country, which makes our need for safe storage, safe processing and safe transmission of information more and more urgent. Especially in the application of Internet, as well as the establishment and realization of personal communication, personal electronic ID card, office automation, email, electronic automatic transfer payment system and automatic retail business network, the problem of information security protection has become very prominent and can be solved An effective approach to this problem is to use modern cryptography.
As early as 1977, the United States formulated its own data encryption standard, namely DES. With the advent of DES, people have carried out in-depth research and discussion on block ciphers. There have been a large number of block ciphers, such as various variants of DES, IDEA algorithms, SAFER series algorithms, RC series algorithms, Skipjack algorithms, FEAL series algorithms, REDOC series algorithms, CAST series algorithms Khufu, KhafreMMB, 3-WAY, TEA, Blowfish, GOST, SQUARE, MISTY, Rijndael algorithm and AES15 candidate algorithms (first round), and NESSIE17 candidate algorithms (first round), etc. .
The current overall structure of block ciphers can be divided into Feistel structure (such as CAST-256, DEAL, DFC, E2, etc.), SP network (such as Safer+, Serpent, etc.) and other cryptographic structures (such as Frog and HPC). The similarity of encryption and decryption is an implementation advantage of Feistel-type ciphers, but its diffusion in the cipher seems to be somewhat slow, for example, it takes two rounds to change each bit of the input. The network structure of SP is very clear, S is generally called the confusion layer, which mainly plays a role of confusion. P is generally called the diffusion layer, which mainly plays a role of diffusion. After clarifying certain cryptographic indicators of S and P, the designer can estimate the ability of SP-type cryptography to resist differential cryptanalysis and linear cryptanalysis. Compared with Feistel network, SP network can get more rapid spread, but the encryption/decryption of SP cipher is usually not similar.
The current discussions on the security of block ciphers mainly include differential cryptanalysis, linear cryptanalysis and brute force attacks. In theory, differential cryptanalysis and linear cryptanalysis are currently the most effective methods to attack block ciphers, but in fact, brute force attacks are the most reliable methods to attack block ciphers. So far, there has been a large amount of literature discussing the security of various block ciphers, and various analysis methods such as truncated differential analysis, nonlinear cryptanalysis and interpolation attacks have been introduced. Since the announcement of the AES candidate algorithm, many experts and scholars at home and abroad have devoted themselves to the security analysis of the candidate algorithm. It is expected that some new attack methods will be introduced, which will undoubtedly further promote the development of block ciphers.
1.3 The significance of this research
Standardization is a basic concept of the industrial society. It means scale production, cost reduction, and easy maintenance and replacement. In order to realize confidential communication between unrelated groups, the standardization of encryption systems is necessary. Due to its inherent characteristics, block ciphers have become the preferred system for the standardization process.
One of the greatest characteristics of information security is autonomy, so the research and development of its core technology-cryptography should be a native science. For some products, the problems caused by backward technology can be solved through foreign introduction. However, for security products, unless you can be completely sure that it has no trapdoors in hardware and software, rash use may bring unpredictable consequences. It is usually very difficult to confirm the software and hardware. Therefore, the most sensible method is to rely on one's own strength and draw on the existing advanced experience for research, design and development.
In order to maintain communication security and combat crime, in April 1993, the US government announced a new proposal, which advocated the federal government and industry to use a new federal encryption standard with key escrow function. This proposal is called the escrowed encrytion standard (EES), also known as the C1ipper proposal. Its purpose is to provide users with better ways of secure communication, while allowing government agencies to monitor if necessary. The block encryption algorithm Sk-ipjack is embedded in the EES system. Although there are many disputes over the system and algorithm, this proposal is positive from the perspective of maintaining national communication security.
In the regional communication system, there are many users, their status and functions are different, and the importance of the information circulating cannot be exactly the same, so the security protection levels they require should not be the same. It can be seen that it is very necessary to study multi-security level cryptographic algorithms. Iterative block cipher (the so-called alternative block cipher is a cipher based on iterating a simple round function, that is, by selecting a relatively simple cipher transformation, and using it for multiple encryption transformations in an iterative manner under the control of the key, for example Feistel-type cipher is a kind of alternative cipher, a typical representative of block cipher. Its mathematical idea is simple and smart. Especially under the same round function, the difference in the number of iterations represents different levels of security strength.
With the increase of communication volume and business types in Internet/Intranet, the demand for security authentication and confidential business is increasingly urgent. For example, PGP (Pretty Good Privacy) is a security technology solution widely used in E-mail systems in the Internet, and it can also be used in other networks. The security services of PGP include confidentiality, authentication, non-repudiation, etc. The confidentiality is guaranteed by the block cipher algorithm IDEA. In addition, the working mode of block cipher can provide some other cipher technologies that people need, such as stream cipher technology and hash technology.

class function//includes the functions used in the algorithm
{ int KO[]= new int[32]; int KI[]= new int[24]; long KL[]= new long[10]; int S7[]= { 27, 50, 51, 90, 59, 16, 23, 84, 91, 26, 114, 115, 107, 44, 102, 73, 31, 36, 19, 108, 55, 46, 63, 74, 93 , 15, 64, 86, 37, 81, 28, 4, 11, 70, 32, 13, 123, 53, 68, 66, 43, 30, 65, 20, 75, 121, 21, 111, 14, 85 , 9, 54, 116, 12, 103, 83, 40, 10, 126, 56, 2, 7, 96, 41, 25, 18, 101, 47, 48, 57, 8, 104, 95, 120, 42 , 76, 100, 69, 117, 61, 89, 72, 3, 87, 124, 79, 98, 60, 29, 33, 94, 39, 106, 112, 77, 58, 1, 109, 110, 99 , 24, 119, 35, 5, 38, 118, 0, 49, 45, 122, 127, 97, 80, 34, 17, 6, 71, 22, 82, 78, 113, 62, 105, 67, 52 , 92, 88, 125














};
int S9 [] = { 451, 203, 339, 415, 483, 233, 251, 53, 385, 185, 279, 491, 307, 9, 45, 211, 199, 330, 55, 126, 235, 356, 403, 472, 163, 286, 85, 44, 29, 418, 355, 280, 331, 338, 466, 15, 43, 48, 314, 229, 273, 312, 398, 99, 227, 200, 500, 27, 1, 157, 248, 416, 365, 499, 28, 326, 125, 209, 130, 490, 387, 301, 244, 414, 467, 221, 482, 296, 480, 236, 89, 145, 17, 303, 38, 220, 176, 396, 271, 503, 231, 364, 182, 249, 216, 337, 257, 332, 259, 184, 340, 299, 430, 23, 113, 12, 71, 88, 127, 420, 308, 297, 132, 349, 413, 434, 419, 72, 124, 81, 458, 35, 317, 423, 357, 59, 66, 218, 402, 206, 193, 107, 159, 497, 300, 388, 250, 406, 481, 361,










381, 49, 384, 266, 148, 474, 390, 318, 284, 96, 373, 463, 103,
281, 101, 104, 153, 336, 8, 7, 380, 183, 36, 25, 222, 295,
219, 228, 425, 82, 265, 144, 412, 449, 40, 435, 309, 362, 374,
223, 485, 392, 197, 366, 478, 433, 195, 479, 54, 238, 494, 240,
147, 73, 154, 438, 105, 129, 293, 11, 94, 180, 329, 455, 372,
62, 315, 439, 142, 454, 174, 16, 149, 495, 78, 242, 509, 133,
253, 246, 160, 367, 131, 138, 342, 155, 316, 263, 359, 152, 464,
489, 3, 510, 189, 290, 137, 210, 399, 18, 51, 106, 322, 237,
368, 283, 226, 335, 344, 305, 327, 93, 275, 461, 121, 353, 421,
377, 158, 436, 204, 34, 306, 26, 232, 4, 391, 493, 407, 57,
447, 471, 39, 395, 198, 156, 208, 334, 108, 52, 498, 110, 202,
37, 186, 401, 254, 19, 262, 47, 429, 370, 475, 192, 267, 470,
245, 492, 269, 118, 276, 427, 117, 268, 484, 345, 84, 287, 75,
196, 446, 247, 41, 164, 14, 496, 119, 77, 378, 134, 139, 179,
369, 191, 270, 260, 151, 347, 352, 360, 215, 187, 102, 462, 252,
146, 453, 111, 22, 74, 161, 313, 175, 241, 400, 10, 426, 323,
379, 86, 397, 358, 212, 507, 333, 404, 410, 135, 504, 291, 167,
440, 321, 60, 505, 320, 42, 341, 282, 417, 408, 213, 294, 431,
97, 302, 343, 476, 114, 394, 170, 150, 277, 239, 69, 123, 141,
325, 83, 95, 376, 178, 46, 32, 469, 63, 457, 487, 428, 68,
56, 20, 177, 363, 171, 181, 90, 386, 456, 468, 24, 375, 100,
207, 109, 256, 409, 304, 346, 5, 288, 443, 445, 224, 79, 214,
319, 452, 298, 21, 6, 255, 411, 166, 67, 136, 80, 351, 488,
289, 115, 382, 188, 194, 201, 371, 393, 501, 116, 460, 486, 424,
405, 31, 65, 13, 442, 50, 61, 465, 128, 168, 87, 441, 354,
328, 217, 261, 98, 122, 33, 511, 274, 264, 448, 169, 285, 432,
422, 205, 243, 92, 258, 91, 473, 324, 502, 173, 165, 58, 459,
310, 383, 70, 225, 30, 477, 230, 311, 506, 389, 140, 143, 64,
437, 190, 120, 0, 172, 272, 350, 292, 2, 444, 162, 234, 112,
508, 278, 348, 76, 450
};
public long FL(long x,long key)//FL函数
{
long XL,XR,KL,KR,YL,YR;
XL=x>>16;XR=x&0x0000FFFF;
KL=key>>16;KR=key&0x0000FFFF;
YR=(XL&KL)XR;YL=(YR|KR)XL;
return (YL<<16)|YR;
}
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_43708988/article/details/108208542