SKINNY algorithm component optimization method based on particle-group-like normal optimization algorithm

文档序号:1363414 发布日期:2020-08-11 浏览:32次 中文

阅读说明:本技术 一种基于类粒子群正态优化算法的skinny算法组件优化方法 (SKINNY algorithm component optimization method based on particle-group-like normal optimization algorithm ) 是由 金鑫 段玉玮 张莹 毛明 于 2020-03-09 设计创作,主要内容包括:一种基于类粒子群正态优化算法的SKINNY算法组件优化方法,包括步骤如下:1、设定SKINNY密码算法组件格式;2、种群初始化,生成符合要求的初始种群用于后续优化;3、种群个体预处理,对种群中的个体进行预处理,使其符合SKINNY密码算法组件格式,用于后续目标函数计算;4、设定SKINNY密码算法目标函数,根据SKINNY密码算法所需要优化的性能指标,选择确定轮数下的活跃s盒数作为优化标准,计算方式作为SKINNY密码算法目标函数;5、种群迭代更新,根据类粒子群正态优化算法的设定对初始种群进行更新迭代,最终得到符合设定指标下的种群;6、算法输出,根据设定,对符合要求的算法组件进行存储,并输出一个或多个性能最优的算法组件。(A SKINNY algorithm component optimization method based on a particle-group-like normal optimization algorithm comprises the following steps: 1. setting a format of a SKINNY cryptographic algorithm component; 2. initializing a population, and generating an initial population meeting requirements for subsequent optimization; 3. preprocessing the population individuals, namely preprocessing the individuals in the population to make the individuals accord with a SKINNY cryptographic algorithm component format for subsequent objective function calculation; 4. setting a SKINNY cryptographic algorithm target function, selecting the number of active s boxes under a determined number of rounds as an optimization standard according to performance indexes required to be optimized by the SKINNY cryptographic algorithm, and using a calculation mode as the SKINNY cryptographic algorithm target function; 5. performing iterative updating on the population, namely updating and iterating the initial population according to the setting of the particle-group-like normal optimization algorithm to finally obtain the population meeting the set index; 6. and algorithm output, namely storing the algorithm components meeting the requirements according to the setting, and outputting one or more algorithm components with optimal performance.)

1. A SKINNY algorithm component optimization method based on a particle-group-like normal optimization algorithm is characterized by comprising the following steps:

step 1, setting a SKINNY cryptographic algorithm component format;

step 2, initializing a population, generating an initial population meeting requirements for subsequent optimization, and setting the initial population as 50 individuals;

step 3, pretreating the population individuals, namely pretreating the individuals in the population to make the individuals conform to the format of a SKINNY cryptographic algorithm component for subsequent objective function calculation;

step 4, setting a SKINNY cryptographic algorithm target function, selecting the number of active s boxes under the determined number of rounds as an optimization standard according to the performance index required to be optimized by the SKINNY cryptographic algorithm, and using a calculation mode as the SKINNY cryptographic algorithm target function;

step 5, updating population iteration, namely updating and iterating the initial population according to the setting of the particle-group-like normal optimization algorithm to finally obtain the population meeting the set index;

and 6, outputting an algorithm, storing the algorithm components meeting the requirements according to the setting, and outputting one or more algorithm components with optimal performance.

2. The method for optimizing SKINNY algorithm components based on the particle-group-like normal optimization algorithm according to claim 1, wherein: the steps (1) and (2) are as follows for generating an initial population according to a set SKINNY cryptographic algorithm component format:

(1) the optimized component is a replacement P for generating SKINNY algorithm expansion keyT,PTThe constraint of (c) translates into a mathematical language of two in total: first, it should be a random permutation of 0 to 15, with 16 numbers all occurring and only occurring once; second, as a permutation, the 8 digits 0 to 7 can only appear in the last eight bits of the permutation, and the remaining 8 digits appear in the first eight bits of the permutation;

(2) generating a certain number of random numbers within a fixed range, wherein one random number represents the position of one microparticle, 16 random numbers are divided into one group, and 50 groups are generated in total; and matching the randomly generated speed value in the determined range and a uniformly set theta value for each random number.

3. The method for optimizing SKINNY algorithm components based on the particle-group-like normal optimization algorithm according to claim 2, wherein: the method for pretreating the population particles in the step (3) comprises the following steps:

(3.1) regarding the initial population as 50 particle groups, wherein each particle group comprises 16 micro-particles, the micro-particles are distributed in a three-dimensional space, and each micro-particle comprises a position, a speed and a uniformly set theta value;

(3.2) numbering the micro-particles in each particle group, wherein the serial numbers are 0 to 15;

(3.3) arranging the microparticles in a descending order according to the position sizes of the microparticles on the three-dimensional space;

(3.4) taking out the micro-particles with the serial numbers of 0 to 7 and placing the micro-particles in the last eight bits of the array, and placing the micro-particles with the serial numbers of 8 to 15 in the first eight bits of the array;

and (3.5) finally, replacing the position number values of the micro-particles by the serial numbers of the micro-particles to obtain the final arrangement.

4. The method for optimizing SKINNY algorithm components based on the particle-group-like normal optimization algorithm according to claim 1, wherein: after the objective function is set in the steps (4) and (5), the iterative updating process of the population is carried out, and the following steps are adopted:

(1) setting an objective function according to needs, and calculating the objective function of the initial population after pretreatment to obtain the fitness value of each particle;

(2) determining a global optimal solution and an individual optimal solution according to the fitness value, wherein the particle with the earliest maximum fitness value in the population is used as the global optimal solution, the particle corresponding to the historical highest fitness value of each particle is used as the individual optimal solution, and the individual optimal solution of the particle in the initial population is the particle;

(3) according to each micro particle in the particles, regarding the position of each micro particle as the average value of normal distribution, regarding the theta value as the standard deviation of the normal distribution, and updating the position of the micro particle once through the normal distribution;

(4) and updating the position, the speed and the theta value of the micro-particles according to the updating formula.

5. The method for optimizing SKINNY algorithm components based on the particle-group-like normal optimization algorithm according to claim 1, wherein: the step (6) algorithm output process comprises the following steps:

(6.1) storing the particles meeting the requirements in a data storage module in the algorithm iteration process;

(6.2) there are two algorithm termination conditions, and optimization is stopped when any one of the two conditions is reached:

firstly, the particle quantity of the data storage module reaches a preset value;

secondly, the fitness value of the global optimal solution particle reaches the preset requirement, at the moment, the original output optimal solution is kept, and other parallel optimal solutions with the same fitness value are output at the same time.

Technical Field

The invention belongs to the fields of cryptography and group intelligent algorithms, in particular to a method for designing a block cipher algorithm component, and particularly relates to a SKINNY algorithm component optimization method based on a particle-group-like normal optimization algorithm.

Background

In recent years, Mixed Integer Linear Programming (MILP) has been applied successively by different scholars to solve cryptographic problems, and then, automatic analysis of cryptographic algorithms using MILP has become an important research progress in the field of cryptography, including various analysis means such as difference, linearity, impossibility of difference, and intermediate encounter. However, few researchers have studied the design of cryptographic algorithm components implemented by MILP using advanced computer tools such as smart optimization techniques. The earliest cryptographic algorithm designers paid more attention to the logic of the algorithm, and often rely on subjective experience to judge on the selection of algorithm parameters, or simply screen the existing algorithm parameters. There is no guarantee whether the parameters are optimal solutions.

The meta-heuristic algorithm is an improvement of the heuristic algorithm, and is a product of combining a random algorithm and a local search algorithm. Particle swarm optimization is derived from a complex adaptive system. The basic principle of the algorithm is derived from behavioral studies on the predation of a group of birds, the basic idea being to find the optimal solution through collaboration and information sharing among individuals in the group. The evolution strategy is an important variant of an evolution algorithm and adopts real value coding.

SKINNY is an SPN type lightweight block cipher and is excellent in security and the like. Compared with the SIMON algorithm, the SKINNY algorithm has comparable software and hardware performances, but better safety. The SKINNY algorithm has 6 versions (SKINNY-n-t, SKINNY-n-2t, SKINNY-n-3t) according to the grouping length and the key length, wherein the grouping length n can be equal to 64 bits or 128 bits, the key length t can be equal to n,2n or 3n, so the SKINNY is also called an adjustable grouping encryption algorithm. The scheme of the invention mainly discusses SKINNY-n-3t, wherein n is equal to 64 bit.

At present, SKINNY algorithm components are designed through meta-heuristic algorithms, and one of the defects exists, the adopted meta-heuristic algorithms are all existing mature algorithms and are not provided for the SKINNY algorithms; secondly, the original method can only output one algorithm component for each optimization, which is not beneficial to subsequent screening and use of a user; and thirdly, the original method has single termination condition and is not suitable for practical application scenes.

Disclosure of Invention

The invention aims to solve the technical problems, designs a brand-new meta-heuristic algorithm, provides a SKINNY algorithm component optimization method based on a particle-group-like normal optimization algorithm, designs a special meta-heuristic algorithm for the SKINNY algorithm, and modifies the termination condition setting of the algorithm and the storage module of the searched algorithm component. The invention can output one or more optimal solutions at one time in practical application, can store a large number of algorithm components meeting the storage requirement at one time, can effectively improve the optimization efficiency of the block cipher algorithm components, and can be suitable for the design and optimization of other block ciphers through simple parameter adjustment.

According to the defects and shortcomings of the current block cipher design process, some rules for designing the block cipher algorithm component optimization algorithm based on the optimization algorithm can be summarized as follows:

(1) the algorithm components meeting the structural requirements can be generated in a large number by a computer.

(2) The algorithm component has a simple structure, the search range is large enough, and the filtering can not be performed by traversing and other modes;

(3) the evaluation index of the algorithm component is clear and can be realized by programming;

(4) the algorithm components are modularized, and the replacement of the optimized components does not influence the overall logic of the algorithm.

According to the rules, the particle swarm optimization and the evolutionary strategy algorithm are utilized to design a brand-new particle swarm-like normal optimization algorithm, and a new SKINNY algorithm component optimization scheme is designed based on the particle swarm optimization algorithm. In the scheme, the initial population is optimized and screened by using a particle-swarm-like normal optimization algorithm, and an algorithm component meeting the requirements of a user is finally obtained. Specifically, the invention provides a SKINNY algorithm component optimization method based on a particle-group-like normal optimization algorithm, which comprises the following steps:

step 1, setting a SKINNY cryptographic algorithm component format;

step 2, initializing a population, generating an initial population meeting requirements for subsequent optimization, and setting the initial population as 50 individuals;

step 3, pretreating the population individuals, namely pretreating the individuals in the population to make the individuals conform to the format of a SKINNY cryptographic algorithm component for subsequent objective function calculation;

step 4, setting a SKINNY cryptographic algorithm target function, selecting the number of active s boxes under the determined number of rounds as an optimization standard according to the performance index required to be optimized by the SKINNY cryptographic algorithm, and using a calculation mode as the SKINNY cryptographic algorithm target function;

step 5, updating population iteration, namely updating and iterating the initial population according to the setting of the particle-group-like normal optimization algorithm to finally obtain the population meeting the set index;

and 6, outputting an algorithm, storing the algorithm components meeting the requirements according to the setting, and outputting one or more algorithm components with optimal performance.

Further, the steps (1) and (2) are adopted for generating the initial population according to the set SKINNY cryptographic algorithm component format, and the following steps are adopted:

(1) the optimized component is a replacement P for generating SKINNY algorithm expansion keyT,PTThe constraint of (c) translates into a mathematical language of two in total: first, it should be a random permutation of 0 to 15, with 16 numbers all occurring and only occurring once; second, as a permutation, the 8 digits 0 to 7 can only appear in the last eight bits of the permutation, and the remaining 8 digits appear in the first eight bits of the permutation;

(2) generating a certain number of random numbers within a fixed range, wherein one random number represents the position of one microparticle, 16 random numbers are divided into one group, and 50 groups are generated in total; and matching the randomly generated speed value in the determined range and a uniformly set theta value for each random number.

Further, the method for pretreating population particles in the step (3) comprises the following steps:

(3.1) regarding the initial population as 50 particle groups, wherein each particle group comprises 16 micro-particles, the micro-particles are distributed in a three-dimensional space, and each micro-particle comprises a position, a speed and a uniformly set theta value;

(3.2) numbering the micro-particles in each particle group, wherein the serial numbers are 0 to 15;

(3.3) arranging the microparticles in a descending order according to the position sizes of the microparticles on the three-dimensional space;

(3.4) taking out the micro-particles with the serial numbers of 0 to 7 and placing the micro-particles in the last eight bits of the array, and placing the micro-particles with the serial numbers of 8 to 15 in the first eight bits of the array;

and (3.5) finally, replacing the position number values of the micro-particles by the serial numbers of the micro-particles to obtain the final arrangement.

Further, after the objective function is set in the steps (4) and (5), the following steps are taken in the iterative update process of the population:

(1) setting an objective function according to needs, and calculating the objective function of the initial population after pretreatment to obtain the fitness value of each particle;

(2) determining a global optimal solution and an individual optimal solution according to the fitness value, wherein the particle with the earliest maximum fitness value in the population is used as the global optimal solution, the particle corresponding to the historical highest fitness value of each particle is used as the individual optimal solution, and the individual optimal solution of the particle in the initial population is the particle;

(3) according to each micro particle in the particles, regarding the position of each micro particle as the average value of normal distribution, regarding the theta value as the standard deviation of the normal distribution, and updating the position of the micro particle once through the normal distribution;

(4) and updating the position, the speed and the theta value of the micro-particles according to the updating formula.

Further, the step (6) algorithm output process takes the following steps:

(6.1) storing the particles meeting the requirements in a data storage module in the algorithm iteration process;

(6.2) there are two algorithm termination conditions, and optimization is stopped when any one of the two conditions is reached:

firstly, the particle quantity of the data storage module reaches a preset value;

secondly, the fitness value of the global optimal solution particle reaches the preset requirement, at the moment, the original output optimal solution is kept, and other parallel optimal solutions with the same fitness value are output at the same time.

Has the advantages that:

compared with the prior art, the invention has the advantages that:

(1) a novel meta-heuristic algorithm, namely a particle swarm-like normal optimization algorithm, is provided, and the algorithm is specially used for cryptographic primitive design.

(2) The SKINNY algorithm component optimization method based on algorithm design improves the safety of the cryptographic algorithm.

(3) The algorithm can obtain one or more optimization results, and meanwhile, the algorithm is additionally provided with a data storage module, so that the storage conditions can be flexibly changed as required, and a user can conveniently and further screen the components.

(4) The algorithm can be suitable for the design optimization work of other similar cryptographic algorithm components by changing a small amount of parameters.

Drawings

FIG. 1 is a flow chart of an optimization method of the present invention;

FIG. 2 is a diagram of an application scenario of the optimization method of the present invention.

The specific implementation mode is as follows:

the technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments, and all other embodiments obtained by a person skilled in the art based on the embodiments of the present invention belong to the protection scope of the present invention without creative efforts.

Referring to fig. 1, the invention provides a SKINNY algorithm component optimization method based on a particle-swarm-like normal optimization algorithm, which comprises the following steps:

step 1, setting a SKINNY cryptographic algorithm component format;

step 2, initializing a population, generating an initial population meeting requirements for subsequent optimization, and setting the initial population as 50 individuals;

step 3, pretreating the population individuals, namely pretreating the individuals in the population to make the individuals conform to the format of a SKINNY cryptographic algorithm component for subsequent objective function calculation;

step 4, setting a SKINNY cryptographic algorithm target function, selecting the number of active s boxes under the determined number of rounds as an optimization standard according to the performance index required to be optimized by the SKINNY cryptographic algorithm, and using a calculation mode as the SKINNY cryptographic algorithm target function;

step 5, updating population iteration, namely updating and iterating the initial population according to the setting of the particle-group-like normal optimization algorithm to finally obtain the population meeting the set index;

and 6, outputting an algorithm, storing the algorithm components meeting the requirements according to the setting, and outputting one or more algorithm components with optimal performance.

Further, the steps (1) and (2) are adopted for generating the initial population according to the set SKINNY cryptographic algorithm component format, and the following steps are adopted:

(1) the optimized component is a replacement P for generating SKINNY algorithm expansion keyT,PTThe constraint of (c) translates into a mathematical language of two in total: first, it should be a random permutation of 0 to 15, with 16 numbers all occurring and only occurring once; second, as a permutation, the 8 digits 0 to 7 can only appear in the last eight bits of the permutation, and the remaining 8 digits appear in the first eight bits of the permutation;

(2) generating a certain number of random numbers within a fixed range, wherein one random number represents the position of one microparticle, 16 random numbers are divided into one group, and 50 groups are generated in total; and matching the randomly generated speed value in the determined range and a uniformly set theta value for each random number.

Further, the method for pretreating population particles in the step (3) comprises the following steps:

(3.1) regarding the initial population as 50 particle groups, wherein each particle group comprises 16 micro-particles, the micro-particles are distributed in a three-dimensional space, and each micro-particle comprises a position, a speed and a uniformly set theta value;

(3.2) numbering the micro-particles in each particle group, wherein the serial numbers are 0 to 15;

(3.3) arranging the microparticles in a descending order according to the position sizes of the microparticles on the three-dimensional space;

(3.4) taking out the micro-particles with the serial numbers of 0 to 7 and placing the micro-particles in the last eight bits of the array, and placing the micro-particles with the serial numbers of 8 to 15 in the first eight bits of the array;

and (3.5) finally, replacing the position number values of the micro-particles by the serial numbers of the micro-particles to obtain the final arrangement.

Further, after the objective function is set in the steps (4) and (5), the following steps are taken in the iterative update process of the population:

(1) setting an objective function according to needs, and calculating the objective function of the initial population after pretreatment to obtain the fitness value of each particle;

(2) determining a global optimal solution and an individual optimal solution according to the fitness value, wherein the particle with the earliest maximum fitness value in the population is used as the global optimal solution, the particle corresponding to the historical highest fitness value of each particle is used as the individual optimal solution, and the individual optimal solution of the particle in the initial population is the particle;

(3) according to each micro particle in the particles, regarding the position of each micro particle as the average value of normal distribution, regarding the theta value as the standard deviation of the normal distribution, and updating the position of the micro particle once through the normal distribution;

(4) and updating the position, the speed and the theta value of the micro-particles according to the updating formula.

Further, the step (6) algorithm output process takes the following steps:

(6.1) storing the particles meeting the requirements in a data storage module in the algorithm iteration process;

(6.2) there are two algorithm termination conditions, and optimization is stopped when any one of the two conditions is reached:

firstly, the particle quantity of the data storage module reaches a preset value;

secondly, the fitness value of the global optimal solution particle reaches the preset requirement, at the moment, the original output optimal solution is kept, and other parallel optimal solutions with the same fitness value are output at the same time.

According to an aspect of the present invention, when updating the population particles, the speed and position of the ith micro-particle may be updated according to the speed and position values of the micro-particles of the respective numbers of the individual optimal solution and the global optimal solution. The specific update formula is as follows:

vi,j=0.1*θ*vi,j+c1*rand()*(pbesti,j-xi,j)+c2*rand()*(gbesti,j-xi,j) (1)

xi,j=xi,j+vi,j(2)

in the formula (1) and the formula (2), each symbol is expressed as follows:

the lower corner mark: i represents the ith particle group in the population, and j represents the jth micro-particle in the particle group;

v: representing the speed of the micro-particles;

θ: the convergence index of the optimization algorithm is obtained, and the smaller the theta value is, the faster the convergence is;

c1、c2: a fixed value, typically set to 2;

and rand (): a random number representing 0 to 1;

pbest: representing the individual optimal solution, namely the optimal solution searched by each particle group in the past iteration process;

and gbest: representing a global optimal solution, namely the optimal solution which is searched by the population in the iterative process;

x: indicating the position of the micro-particles. After the values of the particle groups of the population are updated, the parameters of the algorithm need to be updated. For the update of the value of θ, the present invention adopts formula (3). The size of the theta value determines the convergence rate of the population, and the larger the value, the better the divergence of the population particles. Therefore, the value of theta needs to be gradually reduced along with the increase of the iteration times, so that the population is gradually converged, and the search efficiency is improved.

θ=0.95*θ (3)

Fig. 2 is a diagram of an application scenario of the present invention.

Inputting:

the client needs to set four items of content, except parameter setting, other items all provide a plurality of templates for the user to select and modify, and the default values of each item of data are respectively: the particle group population size of the particle group-like normal optimization algorithm is 50 groups, c1 and c2 are set to be 2, and theta is initially set to be 8. A user can design a numerical value according to the actual situation, and the specific numerical value updating formula adopts a formula (1), a formula (2) and a formula (3). Different parameters will affect the search results and the search time of the algorithm.

For both the data storage condition setting and the algorithm termination condition setting, the tool will provide several standard templates that can be filled in, and the user can select the corresponding template and make fine adjustments. For the setting of the objective function of the algorithm, similar to the setting of the data storage criteria, the tool will also provide several templates for the user to choose to modify. Note that, if the objective function setting cannot be completed using a single template, a plurality of templates may be used for combination setting.

And (3) outputting:

and according to the setting condition of the client, the server generates a corresponding iterative program. Finally, a certain number of algorithm components meeting the requirements are output to the output end of the client, and the user can further screen the output components according to the requirements. The input and output of the client are the same device and no additional configuration is required.

In the server, the tool carries out iterative search according to the design conditions of a user, an objective function determines the iterative optimization standard of the tool, different parameters are set to determine the convergence of the algorithm and other characteristics, and the end conditions of the algorithm are stored and determined by the iterative standard. And finally, the algorithm generates a series of algorithm components meeting the design requirements of the user, the user can copy functions and the like at the own equipment terminal, and the output result is helpful for the user to further screen the algorithm components.

In a word, the SKINNY algorithm component optimization method provided by the invention can be completed in a short time, and meanwhile, the requirement on hardware of equipment is not high. According to the invention, the particle-group-like normal optimization algorithm is applied to the design optimization of the cryptographic algorithm for the first time, so that not only is the application scene of the algorithm improved, but also the cryptographic algorithm design efficiency of a user is greatly improved. The invention can search one or more algorithm components with better performance in a larger search space within a short time, and can select different screening standards according to different parameter settings to provide more optimization modes for users. In addition, the invention designs a brand-new meta-heuristic algorithm which is applied to the optimization design of SKINNY algorithm components. Experiments show that the method provided by the invention can effectively shorten the design time, improve the security of the cryptographic algorithm and reduce the workload of a user. The encryption method is easy to realize through software, and the method can be widely applied and popularized to other cryptographic algorithm design optimization with clear evaluation standards.

Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, but various changes may be apparent to those skilled in the art, and it is intended that all inventive concepts utilizing the inventive concepts set forth herein be protected without departing from the spirit and scope of the present invention as defined and limited by the appended claims.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于人工蜂群算法结合最小二乘法的谐波检测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!