CN115225330A - Data encryption method and device, electronic equipment and storage medium - Google Patents

Data encryption method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115225330A
CN115225330A CN202210706335.XA CN202210706335A CN115225330A CN 115225330 A CN115225330 A CN 115225330A CN 202210706335 A CN202210706335 A CN 202210706335A CN 115225330 A CN115225330 A CN 115225330A
Authority
CN
China
Prior art keywords
sequence
encrypted
digit
group
group number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210706335.XA
Other languages
Chinese (zh)
Other versions
CN115225330B (en
Inventor
徐永生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202210706335.XA priority Critical patent/CN115225330B/en
Publication of CN115225330A publication Critical patent/CN115225330A/en
Application granted granted Critical
Publication of CN115225330B publication Critical patent/CN115225330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention provides a data encryption method, a data encryption device, electronic equipment and a storage medium, wherein data to be encrypted is acquired; converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm; supplementing bits to the first encrypted sequence to generate a second encrypted sequence; the digit of the second encrypted sequence is larger than that of the first encrypted sequence, so that the output length of a hash function of the encrypted data is increased, the defense strength against birthday attacks is effectively improved, and the safety against confidential data is improved.

Description

Data encryption method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of digital encryption technologies, and in particular, to a data encryption method, a data encryption apparatus, an electronic device, and a computer-readable storage medium.
Background
With the development of computer and internet technologies, a great deal of personal sensitive information is collected and stored in many social and public service fields such as finance, telecommunication, transportation, medical treatment, property management, accommodation service, express delivery and the like.
Therefore, how to encrypt the sensitive information to improve the security of the sensitive information is a technical problem that needs to be overcome by those skilled in the art.
Disclosure of Invention
Embodiments of the present invention provide a data encryption method, an apparatus, an electronic device, and a computer-readable storage medium, so as to solve a problem of how to improve data security.
The embodiment of the invention discloses a data encryption method, which can comprise the following steps:
acquiring data to be encrypted;
converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm;
supplementing bits to the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
Optionally, the step of padding the first encrypted sequence to generate a second encrypted sequence may include:
acquiring a natural constant, and determining the number of bits to be complemented and time information which need to be complemented in the first encrypted sequence;
converting the digits to be complemented into 16-system digits by adopting a 16-system algorithm;
calculating the bit number ratio of the to-be-complemented bit number to the 16-system bit number;
determining the occurrence times of the to-be-complemented digit in the 16-system digit;
calculating and generating a discrete information source by adopting the digit to be compensated, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the digit to be compensated in the 16-system digit; the discrete information source is a number;
calculating an average amount of information for the discrete information sources;
calculating a first complement number based on discrete component operation by adopting the average information quantity;
performing golden section on the first complement digit to generate a second complement digit;
and adding the complement number to the first encrypted sequence based on the number of bits to be complemented to generate a second encrypted sequence.
Optionally, the method may further include:
grouping the second encrypted sequence according to a preset group number, and determining an initial group number of each group;
summing the numbers of the digits in the second encrypted sequence;
using the sum and the bit number of the second encrypted sequence to take the remainder;
determining a microscopic constant using the residue;
and determining the entropy group number of each group by adopting the microscopic state constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encryption sequence.
Optionally, the step of determining the number of entropy groups for each group is willing to include:
calculating the number of entropy groups for each group;
when the entropy group number is the same as the determined entropy group number, acquiring an integer which is different from the determined entropy group number from the initial group number according to a first preset sequence to be used as the entropy group number;
when the entropy group number is the same as the determined entropy group number and no integer different from the determined entropy group number exists in the first preset sequence, acquiring an integer different from the determined entropy group number from the initial group number according to a second preset sequence as the entropy group number; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
Optionally, the method may further include:
extracting odd digits in the third encrypted sequence;
calculating the sum of the times of the odd digits in the second encrypted sequence;
based on a Fourier transform function, taking the odd-numbered digits and the number of times the odd-numbered digits are in the third encrypted series and generating a first control group series for the third encrypted series;
inverting the numbers in the first control group number sequence bit by bit to generate a second control group number sequence;
and generating a fourth encrypted sequence through the second control group sequence based on a Meglangel cyclic XOR algorithm.
The embodiment of the invention discloses a data encryption device, which can comprise:
the data to be encrypted acquisition module is used for acquiring data to be encrypted;
the first encryption sequence conversion module is used for converting the data to be encrypted into a first encryption sequence by adopting a 16-system algorithm;
the second encrypted sequence generating module is used for complementing the bits of the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
Optionally, the second encrypted sequence generating module may include:
the natural constant acquisition submodule is used for acquiring a natural constant and determining the number of bits to be complemented and time information which need to be complemented in the first encrypted sequence;
the to-be-compensated digit conversion submodule is used for converting the to-be-compensated digit into a 16-system digit by adopting a 16-system algorithm;
the digit ratio calculation submodule is used for calculating the digit ratio of the to-be-complemented digit and the 16-system digit;
the occurrence number determining submodule is used for determining the occurrence number of the to-be-complemented digit in the 16-system digit;
the discrete information source calculation submodule is used for calculating and generating a discrete information source by adopting the number of digits to be complemented, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the number of digits to be complemented in the 16-system digits; the discrete information source is a number;
an average information amount operator module for calculating an average information amount for the discrete information sources;
the first complement digit calculation submodule is used for calculating a first complement digit based on discrete component operation by adopting the average information quantity;
a second complementary digit calculating submodule for performing golden section on the first complementary digit to generate a second complementary digit;
and the second encrypted sequence generation sub-module is used for adding the complement digit to the first encrypted sequence based on the number of digits to be complemented and generating a second encrypted sequence.
Optionally, the method may further include:
the initial group number determining module is used for grouping the second encrypted sequence according to a preset group number and determining the initial group number of each group;
the first summation module is used for summing the numbers of all digits in the second encrypted sequence;
a remainder module for taking the remainder of the digit of the second encrypted series by the sum;
a microscopic constant determination module for determining a microscopic constant by using the residue;
and the third encryption sequence generation module is used for determining the entropy group number of each group by adopting the microscopic constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encryption sequence.
Optionally, the third encrypted sequence generating module may include:
an entropy group number calculation sub-module for calculating an entropy group number for each group;
a first entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number, obtain, in the initial group number, an integer different from the determined entropy group number as an entropy group number according to a first preset order;
a second entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number and there is no integer different from the determined entropy group number in the first preset order, obtain, as an entropy group number, an integer different from the determined entropy group number in the initial group number according to a second preset order; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
Optionally, the method may further include:
an odd digit extraction module, configured to extract an odd digit in the third encrypted sequence;
a second summing module for calculating a sum of times of the odd-numbered digits in the second encrypted sequence;
a first comparison set number sequence generation module for generating a first comparison set number sequence aiming at the third encryption number sequence by adopting the odd number and the times of the odd number in the third encryption number sequence based on a Fourier change function;
the second control group array generating module is used for inverting the numbers in the first control group array bit by bit to generate a second control group array;
and the fourth encryption sequence generation module is used for generating a fourth encryption sequence through the second control group sequence based on the Meglanning cyclic XOR algorithm.
The embodiment of the invention also discloses electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory finish mutual communication through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.
Also disclosed is a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform a method according to an embodiment of the invention.
The embodiment of the invention has the following advantages:
according to the embodiment of the invention, data to be encrypted is obtained; converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm; supplementing bits to the first encrypted sequence to generate a second encrypted sequence; the digit of the second encrypted sequence is larger than that of the first encrypted sequence, so that the output length of the hash function of the encrypted data is increased, the defense strength against birthday attacks is effectively improved, and the security against confidential data is further improved.
Drawings
FIG. 1 is a flow chart of the steps of a data encryption method provided in an embodiment of the present invention;
fig. 2 is a block diagram of a data encryption apparatus provided in an embodiment of the present invention;
fig. 3 is a block diagram of a hardware structure of an electronic device provided in each embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
In practical applications, the data summarization algorithm is simply understood to be an algorithm function by which a very long data can be generated into a summary information of a fixed length. The data digest algorithm is a one-way hash function, namely, it is easy to calculate the hash value of a piece of data, but it is almost impossible to calculate the original data according to the hash, but if the data digest algorithm encounters a birthday attack, it may lose confidentiality, for example, the digest extraction methods such as MD5, SHA-1, SHA-256 cannot resist the birthday attack, which limits the application occasions of them.
The birthday attack is a cryptographic attack means, and utilizes the mathematical principle of birthday problem in probability theory to find out conflicting hash value and forge message, so that the identity authentication algorithm is invalid.
Referring to fig. 1, a flowchart illustrating steps of a data encryption method provided in an embodiment of the present invention is shown, which may specifically include the following steps:
step 101, acquiring data to be encrypted;
step 102, converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm;
103, complementing the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
The data to be encrypted in the embodiment of the present invention may be text information, for example, a user identification ID, a password, and the like.
After the data to be encrypted is obtained, the data to be encrypted may be converted into the first encrypted sequence by using a 16-ary algorithm in the embodiment of the present invention.
In practical applications, the hexadecimal conversion has 16 numbers which can be different in size from small to large on each bit, namely 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f16, namely, when the hexadecimal conversion is carried out at 16 to 1, wherein six letters a, b, c, d, e, f are used to respectively represent 10, 11, 12, 13, 14, 15, for example, a 16-ary algorithm can be adopted to convert the data to be encrypted, i.e. the country X, into a 24-bit first encrypted number sequence of 621172314f60ff0c4e2d56fd ".
In practical application, increasing the output length of the hash function can effectively improve the defense strength against the birthday attack, so after the first encryption sequence is generated, the embodiment of the invention can complement the first encryption sequence by the random number, thereby generating the second encryption sequence with the digit number larger than the first encryption sequence.
For example, since the first encrypted sequence is a 24-bit sequence and the first encrypted sequence needs to be complemented to generate a 36-bit second encrypted sequence, bits 25 to 36 of the first encrypted sequence "621172314f60ff0c4e2d56fd" can be complemented to generate a second encrypted sequence "621172314f60ff0c4e2d56fd23895612".
According to the embodiment of the invention, data to be encrypted is obtained; converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm; supplementing bits to the first encrypted sequence to generate a second encrypted sequence; the digit of the second encrypted sequence is larger than that of the first encrypted sequence, so that the output length of the hash function of the encrypted data is increased, the defense strength against birthday attacks is effectively improved, and the security against confidential data is further improved.
On the basis of the above-described embodiment, a modified embodiment of the above-described embodiment is proposed, and it is to be noted herein that, in order to make the description brief, only the differences from the above-described embodiment are described in the modified embodiment.
In an optional embodiment of the present invention, the step of complementing the first encrypted sequence to generate a second encrypted sequence includes:
acquiring a natural constant, and determining the number of bits to be complemented and time information which need to be complemented in the first encrypted sequence;
converting the digits to be complemented into 16-system digits by adopting a 16-system algorithm;
calculating the bit number ratio of the to-be-complemented bit number to the 16-system bit number;
determining the occurrence times of the to-be-complemented digit in the 16-system digit;
calculating and generating a discrete information source by adopting the digit to be compensated, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the digit to be compensated in the 16-system digit; the discrete information source is a number;
calculating an average amount of information for the discrete information sources;
calculating a first complement number based on discrete component operation by adopting the average information amount;
performing golden section on the first complement digit to generate a second complement digit;
and adding the complement number to the first encrypted sequence based on the number of bits to be complemented to generate a second encrypted sequence.
In a specific implementation, the natural constant, symbol e, is a constant in mathematics, is an infinite acyclic decimal number, and is an transcendental number, whose value is about 2.718281828459045. It is the base of the natural logarithmic function.
The embodiment of the present invention may determine the number of bits to be complemented and the time information that need to be complemented in the first encrypted number sequence, for example, the first encrypted number sequence is a 24-bit number sequence, and the 25 th bit needs to be complemented at present, the number of bits to be complemented is 25, and the time information may be the number of milliseconds 3861302743014 from 6 months, 12 days, 10 days from 2022 years.
In the embodiment of the invention, the discrete information source p (x) can be simulated by utilizing the disorder of pi through the following formula.
The formula I is as follows:
Figure BDA0003706278730000081
the formula II is as follows:
Figure BDA0003706278730000082
the formula III is as follows:
Figure BDA0003706278730000083
the number of the digits to be complemented is marked as x, m represents the ratio of the current digit to the total digit converted into the 16-system, z represents the current date number, alpha represents the number of milliseconds from the current year to 1900, and b represents the number of times that the value of the current digit appears in the total digit in the 16-system.
Regarding each data needing bit compensation as a discrete information source, and solving for average information quantity to obtain a function as follows:
the formula four is as follows:
Figure BDA0003706278730000084
after the average information amount for the discrete information source is calculated, the embodiment of the invention can calculate the first complement number based on the discrete component operation by using the average information amount through the following formula, and perform golden section on the first complement number to generate the second complement number.
The formula five is as follows:
Figure BDA0003706278730000085
formula six:
B(x)=Ф h(A)
the present invention can generate a second encrypted sequence by adding a complementary digit to the first encrypted sequence based on the number of digits to be complemented, for example, the first encrypted sequence is a 24-digit sequence, the 24-digit first encrypted sequence needs to be complemented to generate a 32-digit second encrypted sequence, the number of digits to be complemented is 25, the 25-digit first encrypted sequence needs to be complemented, and the second complementary digit corresponding to the 25-digit is calculated to be "2", so that "2" is complemented to the 25-digit, and the sequence "621172314f60ff0c4e2d56fd2" is generated until the 32-digit is complemented, thereby generating the second encrypted sequence "621172314f60ff0c4e2d56fd23895612".
In the embodiment of the invention, the number of bits to be complemented and time information which need to be complemented in the first encrypted number sequence are determined by acquiring a natural constant; converting the digits to be complemented into 16-system digits by adopting a 16-system algorithm; calculating the bit number ratio of the to-be-complemented bit number to the 16-system bit number; determining the occurrence times of the to-be-complemented digit in the 16-system digit; calculating and generating a discrete information source by adopting the digit to be compensated, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the digit to be compensated in the 16-system digit; the discrete information source is a number; calculating an average amount of information for the discrete information sources; calculating a first complement number based on discrete component operation by adopting the average information quantity; performing golden section on the first complement digit to generate a second complement digit; and adding the complement number to the first encrypted sequence based on the number of bits to be complemented to generate a second encrypted sequence, so that the randomness of the complement number is enhanced, and the security of confidential data is further improved.
In an optional embodiment of the present invention, further comprising:
grouping the second encrypted sequence according to a preset group number, and determining an initial group number of each group;
summing the numbers of the digits in the second encrypted sequence;
using the sum and the bit number of the second encrypted sequence to take the remainder;
determining a microscopic constant using the residue;
and determining the entropy group number of each group by adopting the microscopic constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encrypted sequence.
In a specific implementation, the embodiment of the present invention may group the second encrypted number sequence by a preset number of groups, and determine an initial number of groups of each group, for example, the second encrypted number sequence "621172314f60ff0c4e2d56fd23895612" is divided into eight groups, and the initial number of groups after grouping is "6211" group 1, "7231" group 2, "group 3" 4f60, "group 4" ff0c, "group 5" 4e2d, "group 6" 56fd, "group 7" 2389, "and group 8" 5612.
After grouping the second encrypted sequence according to the preset group number and determining the initial group number of each group, the embodiment of the invention can take the remainder of the total number of bits of the data after bit padding and 32, and determine the group number to be marked as a after bit padding according to a certain rule g And the number of each group of numbers is recorded as N by increasing from a natural number of 1 m Determining the final sorting by circularly scaling the standard sorting value according to the entropy increasing function, and marking as N s . The formula for entropy increase is as follows:
the formula seven:
S=k l nΩ
where S represents entropy, k represents Boltzmann constant, and Ω represents a microscopic constant.
In another optional embodiment of the present invention, the step of determining the number of entropy groups for each group comprises:
calculating the number of entropy groups for each group;
when the entropy group number is the same as the determined entropy group number, acquiring an integer which is different from the determined entropy group number from the initial group number according to a first preset sequence to be used as the entropy group number;
when the entropy group number is the same as the determined entropy group number and no integer different from the determined entropy group number exists in the first preset sequence, acquiring an integer different from the determined entropy group number from the initial group number according to a second preset sequence as the entropy group number; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
For example, 1-8 groups are labeled with letters a-g, respectively, and the number of entropy groups determined for group e is 2, but in the previous calculation, the number of entropy groups determined for group c was also 2, so that "1" can be used as the number of entropy groups for group e, which is also 2, and 1 is already the number of entropy groups for group e, so "8" can be used as the number of entropy groups for group f, or the number of entropy groups determined for group e is 7, but in the previous calculation, the number of entropy groups for group c is also 7, which is also 7, so "8" can be used as the number of entropy groups for group e, which is also 7, and 8 is already the number of entropy groups for group e, so "1" can be used as the number of entropy groups for group f.
In the embodiment of the invention, the second encrypted sequence is grouped according to the preset group number, and the initial group number of each group is determined; summing the numbers of the digits in the second encrypted sequence; using the sum and the bit number of the second encrypted sequence to take the remainder; determining a microscopic state constant using the residue; and determining the entropy group number of each group by using the microscopic state constant and the boltzmann constant, and replacing the initial group number by using the entropy group number to generate a third encryption number sequence, thereby further improving the security aiming at the confidential data by using the randomness of the entropy.
In an optional embodiment of the present invention, further comprising:
extracting odd digits in the third encrypted sequence;
calculating the sum of the times of the odd digits in the third encrypted sequence;
based on a Fourier transform function, taking the odd-numbered digits and the number of times the odd-numbered digits are in the third encrypted series and generating a first control group series for the third encrypted series;
inverting the numbers in the first control group number sequence bit by bit to generate a second control group number sequence;
and generating a fourth encrypted sequence through the second control group sequence based on a Meglangel cyclic XOR algorithm.
In a specific implementation, the embodiment of the present invention may extract an odd number of bits in the second encrypted number sequence, for example, assuming that the second encrypted number sequence is "621172314f60ff0c4e2d56fd23895612", the odd number of bits of the second encrypted number sequence is "617346fced6d3962".
After extracting the odd number of bits in the second encrypted number sequence, the sum of the number of times the odd number of bits in the second encrypted number sequence is calculated, for example, the number of times 6 occurs in the second encrypted number sequence is 4,1 and the number of times 4 … … 2 occurs in the second encrypted number sequence is 5, so the sum of the number of times the odd number of bits in the second encrypted number sequence =4+4+. +5.
After the odd-numbered digits are determined and the sum of the times of the odd-numbered digits in the second encrypted digit sequence is determined, the embodiment of the invention can take the odd-numbered digits as an argument x and take the sum of the times of the odd-numbered digits in the second encrypted digit sequence as ω into the following fourier transform function:
the formula eight:
Figure BDA0003706278730000111
obtaining a 16-bit array, adding the first 4 bits of the array, and squaring to obtain a value g 1 (ii) a The value of the cubic operation after multiplying the number sequence by 5 to 8 bits is recorded as g 2 (ii) a Adding 9 to 12 bits and then performing an open square operation to obtain a number g 3 (ii) a The sum of 13 bits and 14 bits plus the product of 15 bits and 16 bits is denoted as g 4 (ii) a Will be provided with
Figure BDA0003706278730000121
The value obtained by adding up to the number of 32 bit data sets is recorded as m 1 ,m 1 Zooming to the range of the maximum group number according to the multiple of 10, and recording the zoomed value as m z Will be closest to m z As the first comparison set series of the third encrypted series.
In the embodiment of the present invention, after the first control group sequence is generated, the first control group sequence is inverted bit by bit, and the first control group sequence that is inverted bit by bit is used as the second control group sequence, for example, assuming that the first control group sequence is 62198732658932456987412365479856, the second control group sequence 65897456321478965423985623789126 is obtained by inversion.
After the second comparison group digit sequence is generated, the embodiment of the invention can select the comparison group digits of the XOR operation from left to right in turn according to the following formula, thereby generating a fourth encryption digit sequence.
Scaling the values of the whole group which can be divided by 2 by using the following Maxlaurin formula to find the number of the comparison groups which is nearest to the values:
the formula is nine:
Figure BDA0003706278730000122
wherein:
Figure BDA0003706278730000123
x represents a value divisible by 2, n represents a group number, and θ represents a bit number, which are sequentially taken in the third encrypted sequence.
And (3) carrying out value taking and zooming by using the following Meglalin formula, removing the number of the comparison group digit taken in the previous step, and finding the nearest comparison group digit:
Figure BDA0003706278730000124
x represents a value divisible by 3, m represents a group number, and θ represents a bit number, which are sequentially taken in the third encrypted sequence.
And (3) carrying out value taking and zooming by using the following Maclaurin formula which can be divided by 5, removing the number of the comparison group bits in the first two steps, and then finding the number of the comparison group bits which is the nearest to the comparison group bits:
formula eleven:
Figure BDA0003706278730000131
wherein:
Figure BDA0003706278730000132
x represents a value divisible by 5, n represents a group number, and α represents a number of digits, which are sequentially taken in the third encrypted sequence.
And 7, scaling after value taking is carried out by using the following Meglalin formula, wherein the number of the comparison group digits closest to the comparison group digits is found after the comparison group digits taken in the first 3 steps are removed:
formula eleven:
Figure BDA0003706278730000133
wherein:
Figure BDA0003706278730000134
x represents a value divisible by 2, n represents a group number, and θ represents a bit number, which are sequentially taken in the third encrypted sequence.
And carrying out XOR operation on the rest digits in the third encrypted digit sequence and the rest digits in the second comparison group digit sequence from small to large in sequence until a last group of 32-digit sequences are generated and are used as a fourth encrypted digit sequence.
In a specific implementation, the embodiment of the present invention further extracts an odd number of digits in the third encrypted number sequence; calculating the sum of the times of the odd digits in the second encrypted sequence; based on a Fourier transform function, taking the odd-numbered digits and the number of times the odd-numbered digits are in the third encrypted series and generating a first control group series for the third encrypted series; inverting the numbers in the first control group number sequence bit by bit to generate a second control group number sequence; the fourth encryption sequence is generated through the second control sequence based on the Maxolin cyclic XOR algorithm, so that the second encryption sequence is generated through 16 complementary bits of data to be encrypted, the third encryption sequence is generated through entropy sorting, the Fourier searching algorithm is performed on the third encryption sequence, the Maxolin cyclic XOR algorithm is performed on the third encryption sequence according to bits, and the fourth encryption sequence is generated.
In order to better understand the embodiments of the present invention, a full example will be described below.
The first step is as follows: 16-bit data is generated.
The 16-system data of the 'I love you, X country' is 621172314f60ff0c4e2d56fd.
The second step: and complementing the 16-system data.
1. A complementary bit information source p (x) is obtained.
a) Complement from 25 bits to 32 bits;
b) 25 bit, p (25) is pi N
c) Calculating m, wherein the current digit is 25, and the digit of the 16-digit system of 'I love you, china' is 24, so that m =1;
d) Number of milliseconds to 10 days of 12 weeks at 6 months at 2022 is 3861302743014;
e) The value of the natural constant e is 2.72;
f) b has a value of 4, the current digit is 25 bits, and the number of occurrences of 2 and 5 in the 16-bit system is 4;
g)N=2.72*14*14*1*1/(2*3.14*(4*4-14)=42;
h) The 42 th bit of the 25 th bit complement information source bit is 9;
i) The 26 bits to 32 bits are calculated in sequence according to the above rule.
2. The average information amount of the complementary bit data is obtained.
a) The 25 th bit has an average information amount of 42 × log which is the sum of 1 to M (1) 2 42=223;
b) The average information amount is calculated from 26 bits to 32 bits one by one according to the rule.
3. The complementary bit data h (25) =223 × 2 × 25/(3.14 × 3.14) =97 is obtained, and the complementary bit data 60, 26 bits to 32 bits are calculated one by one according to the rule according to the golden section.
The third step: entropy grouping and sorting;
for example, the sum of the numbers of bits after bit padding is 300, and the sum of 300 and 32 is obtained, so that the number of groups =9;
converting the ordering value into entropy ordering value, and taking the microcosmic constant
Figure BDA0003706278730000151
Boltzmann constant, k =1.380649 × 10 23
The entropy ordered value =1.380649 × 10 is obtained 23 ×l n 9 23 =3;
And if the converted entropy sorting value conflicts with the previous entropy sorting value, sequentially rounding up, and after finishing rounding up, rounding up from the last bit of the group number to the front (if the number is 3, the entropy sorting value is 2), wherein the rest number is the last group.
The fourth step: fourier group searching;
1. if the 16-ary data is 621172314f60ff0c4e2d56fd23895612;
(1) Obtaining odd digits which are 617346fced6d3962 respectively;
(2) Obtaining the sum of the times of odd occurrence, wherein the number of times of 6 occurrence is 4,1 occurrence is 4 … …, and if the result obtained by the odd number according to the rule operation is 32 (omega);
(3)g1=(6+1+7+3) 2 =289;
(4)g2=(4×6×16×12) 3 =97,844,723,712;
(5)
Figure BDA0003706278730000152
(6)g4=3+9+62=24;
(7) g1+ g2+ g3+ g4 and 32 to obtain the rest of 0;
(8) The closest second group is associated with it;
(9) The contrast groups of the rest groups correspond according to the rule;
2. assuming that the comparison group is 62198732658932456987412365479856, inverting to 65897456321478965423985623789126, and performing corresponding XOR operation according to rules;
(1) The first bit 6 can be divided by 2, using:
Figure BDA0003706278730000161
searching the digit number of the control group for XOR, and taking 6,2,8,2,6,8,2,4,6,8,4,2,6,4,8,6 as x;
Figure BDA0003706278730000162
Figure BDA0003706278730000163
θ=1;R n (x)=0.007;
after scaling by 1+6+0.007=7.007, the numbers which can be divided by 2 are exclusive-ored with the 7 th bit of the control group.
(2) All of which are divisible by 3 are 9,9,9,9, with the number of bits being 4, 12, 18, 29, respectively;
next, the integer divisible by 3 is 9, R2m (x) = -1 × cos (9)/3! *9 2 =-13.3;
Figure BDA0003706278730000164
X=9;
9-13.3= -4.3, then xor with bit 4, leaving the number that can be evenly divided by 3 to be xor in turn.
(3) The 5-bit divisible is 5,5,5 which are respectively positioned at the 10 th bit, the 16 th bit and the 26 th bit;
Rn(x)=10*9*(1+3*5) 5-1-1 ×5 1+1 =9216000;
1+5*6=31;
31+9216000=9216031, scaling to 9, carrying out XOR operation with the 9 th bit of the comparison group, and carrying out XOR operation on the remaining bits which can be evenly divided by 3;
(4) The bits that can be divided by 7 are the 6 th bit, 20 th bit, 28 th bit;
Figure BDA0003706278730000171
7-6.66=0.34, and the number of the rest which can be divided by 7 is scaled to obtain 3, and the corresponding number of the bits of the comparison group is selected according to the rule.
(5) And carrying out XOR operation on the remaining digit of the ith group and the remaining digit of the comparison group in sequence from small to large.
(6) The loop performs a set-finding or loop until the last set of 32-bit data is generated.
It should be noted that for simplicity of description, the method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 2, a block diagram of a data encryption apparatus provided in the embodiment of the present invention is shown, and specifically, the data encryption apparatus may include the following modules:
a to-be-encrypted data acquisition module 201, configured to acquire data to be encrypted;
a first encrypted sequence conversion module 202, configured to convert the data to be encrypted into a first encrypted sequence by using a 16-ary algorithm;
a second encrypted sequence generating module 203, configured to complement the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
Optionally, the second encrypted sequence generating module may include:
a natural constant obtaining submodule, configured to obtain a natural constant, and determine a to-be-complemented digit and time information that need to be complemented in the first encrypted digit sequence;
the number-to-be-compensated converting submodule is used for converting the number of to-be-compensated digits into 16-system digits by adopting a 16-system algorithm;
the digit ratio calculation submodule is used for calculating the digit ratio of the to-be-complemented digit and the 16-system digit;
the occurrence frequency determining submodule is used for determining the occurrence frequency of the to-be-complemented digit in the 16-system digit;
the discrete information source calculation submodule is used for calculating and generating a discrete information source by adopting the number of digits to be complemented, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the number of digits to be complemented in the 16-system digits; the discrete information source is a number;
an average information amount operator module for calculating an average information amount for the discrete information sources;
the first complement digit calculation submodule is used for calculating a first complement digit based on discrete component operation by adopting the average information quantity;
a second complementary digit calculating submodule for performing golden section on the first complementary digit to generate a second complementary digit;
and the second encrypted sequence generation sub-module is used for adding the complement digit to the first encrypted sequence based on the number of digits to be complemented and generating a second encrypted sequence.
Optionally, the method may further include:
the initial group number determining module is used for grouping the second encrypted sequence according to a preset group number and determining the initial group number of each group;
the first summation module is used for summing the numbers of all digits in the second encrypted sequence;
a remainder module for taking the remainder of the digit of the second encrypted series by the sum;
a microscopic constant determination module for determining a microscopic constant by using the residue;
and the third encryption sequence generation module is used for determining the entropy group number of each group by adopting the microscopic constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encryption sequence.
Optionally, the third encrypted sequence generating module may include:
an entropy group number calculation sub-module for calculating an entropy group number for each group;
a first entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number, obtain, in the initial group number, an integer different from the determined entropy group number as an entropy group number according to a first preset order;
a second entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number and there is no integer different from the determined entropy group number in the first preset order, obtain, as an entropy group number, an integer different from the determined entropy group number in the initial group number according to a second preset order; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
Optionally, the method may further include:
an odd digit extraction module, configured to extract an odd digit in the third encrypted sequence;
a second summing module for calculating a sum of times of the odd-numbered digits in the second encrypted sequence;
a first comparison set number sequence generation module for generating a first comparison set number sequence aiming at the third encryption number sequence by adopting the odd number and the times of the odd number in the third encryption number sequence based on a Fourier change function;
the second control group number sequence generation module is used for inverting the numbers in the first control group number sequence bit by bit to generate a second control group number sequence;
and the fourth encryption sequence generation module is used for generating a fourth encryption sequence through the second control group sequence based on the Meglanning cyclic XOR algorithm.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
In addition, an embodiment of the present invention further provides an electronic device, including: the processor, the memory, and the computer program stored in the memory and capable of running on the processor, when executed by the processor, implement the processes of the above-mentioned data encryption method embodiment, and can achieve the same technical effects, and for avoiding repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program implements each process of the data encryption method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
Fig. 3 is a schematic diagram of a hardware structure of an electronic device for implementing various embodiments of the present invention.
The electronic device 300 includes, but is not limited to: radio frequency unit 301, network module 302, audio output unit 303, input unit 304, sensor 305, display unit 306, user input unit 307, interface unit 308, memory 309, processor 310, and power supply 311. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 3 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 301 may be used for receiving and sending signals during a process of sending and receiving information or a call, and specifically, receives downlink data from a base station and then processes the downlink data to the processor 310; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 301 can also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 302, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 303 may convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output as sound. Also, the audio output unit 303 may also provide audio output related to a specific function performed by the electronic apparatus 300 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
The input unit 304 is used to receive audio or video signals. The input Unit 304 may include a Graphics Processing Unit (GPU) 3041 and a microphone 3042, and the Graphics processor 3041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 306. The image frames processed by the graphic processor 3041 may be stored in the memory 309 (or other storage medium) or transmitted via the radio frequency unit 301 or the network module 302. The microphone 3042 may receive sounds and can process such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 301 in case of the phone call mode.
The electronic device 300 also includes at least one sensor 305, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 3061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 3061 and/or the backlight when the electronic device 300 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 305 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 306 is used to display information input by the user or information provided to the user. The Display unit 306 may include a Display panel 3061, and the Display panel 3061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 307 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 307 includes a touch panel 3071 and other input devices 3072. The touch panel 3071, also referred to as a touch screen, may collect touch operations by a user on or near the touch panel 3071 (e.g., operations by a user on or near the touch panel 3071 using a finger, a stylus, or any suitable object or attachment). The touch panel 3071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 310, and receives and executes commands sent by the processor 310. In addition, the touch panel 3071 may be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 307 may include other input devices 3072 in addition to the touch panel 3071. Specifically, the other input devices 3072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described herein.
Further, the touch panel 3071 may be overlaid on the display panel 3061, and when the touch panel 3071 detects a touch operation on or near the touch panel, the touch operation is transmitted to the processor 310 to determine the type of the touch event, and then the processor 310 provides a corresponding visual output on the display panel 3061 according to the type of the touch event. Although the touch panel 3071 and the display panel 3061 are shown in fig. 3 as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 3071 and the display panel 3061 may be integrated to implement the input and output functions of the electronic device, which is not limited herein.
The interface unit 308 is an interface for connecting an external device to the electronic apparatus 300. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 308 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic apparatus 300 or may be used to transmit data between the electronic apparatus 300 and the external device.
The memory 309 may be used to store software programs as well as various data. The memory 309 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, etc. Further, the memory 309 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 310 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 309 and calling data stored in the memory 309, thereby performing overall monitoring of the electronic device. Processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 310.
The electronic device 300 may further include a power supply 311 (such as a battery) for supplying power to various components, and preferably, the power supply 311 may be logically connected to the processor 310 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the electronic device 300 includes some functional modules that are not shown, and are not described in detail herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (12)

1. A method of data encryption, comprising:
acquiring data to be encrypted;
converting the data to be encrypted into a first encrypted sequence by adopting a 16-system algorithm;
supplementing bits to the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
2. The method of claim 1, wherein the step of padding the first encrypted sequence to generate a second encrypted sequence comprises:
acquiring a natural constant, and determining the number of bits to be complemented and time information which need to be complemented in the first encrypted sequence;
converting the digits to be complemented into 16-system digits by adopting a 16-system algorithm;
calculating the bit number ratio of the to-be-complemented bit number to the 16-system bit number;
determining the occurrence times of the to-be-complemented digit in the 16-system digit;
calculating and generating a discrete information source by adopting the digit to be compensated, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the digit to be compensated in the 16-system digit; the discrete information source is a number;
calculating an average amount of information for the discrete information sources;
calculating a first complement number based on discrete component operation by adopting the average information amount;
performing golden section on the first complement digit to generate a second complement digit;
and adding the complement number to the first encrypted sequence based on the number of bits to be complemented to generate a second encrypted sequence.
3. The method of claim 1 or 2, further comprising:
grouping the second encrypted sequence according to a preset group number, and determining an initial group number of each group;
summing the numbers of the digits in the second encrypted sequence;
using the sum and the bit number of the second encrypted sequence to take the remainder;
determining a microscopic state constant using the residue;
and determining the entropy group number of each group by adopting the microscopic constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encrypted sequence.
4. The method of claim 3, wherein the step of determining the number of entropy groups for each group comprises:
calculating the number of entropy groups for each group;
when the entropy group number is the same as the determined entropy group number, acquiring an integer which is different from the determined entropy group number from the initial group number according to a first preset sequence to be used as the entropy group number;
when the entropy group number is the same as the determined entropy group number and no integer different from the determined entropy group number exists in the first preset sequence, acquiring an integer different from the determined entropy group number from the initial group number according to a second preset sequence as the entropy group number; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
5. The method of claim 3, further comprising:
extracting odd digits in the third encrypted sequence;
calculating the sum of the times of the odd digits in the third encrypted sequence;
based on a Fourier transform function, taking the odd-numbered digits and the number of times the odd-numbered digits are in the third encrypted series and generating a first control group series for the third encrypted series;
carrying out bit-by-bit inversion on the numbers in the first control group number sequence to generate a second control group number sequence;
and generating a fourth encrypted series through the second control group series based on a Maxolin cyclic exclusive-OR algorithm.
6. A data encryption apparatus, comprising:
the data to be encrypted acquisition module is used for acquiring data to be encrypted;
the first encryption sequence conversion module is used for converting the data to be encrypted into a first encryption sequence by adopting a 16-system algorithm;
the second encrypted sequence generating module is used for complementing the bits of the first encrypted sequence to generate a second encrypted sequence; the number of bits of the second encrypted series is greater than the number of bits of the first encrypted series.
7. The apparatus of claim 6, wherein the second encrypted sequence generation module comprises:
a natural constant obtaining submodule, configured to obtain a natural constant, and determine a to-be-complemented digit and time information that need to be complemented in the first encrypted digit sequence;
the to-be-compensated digit conversion submodule is used for converting the to-be-compensated digit into a 16-system digit by adopting a 16-system algorithm;
the digit ratio calculation submodule is used for calculating the digit ratio of the to-be-complemented digit and the 16-system digit;
the occurrence number determining submodule is used for determining the occurrence number of the to-be-complemented digit in the 16-system digit;
the discrete information source calculation submodule is used for calculating and generating a discrete information source by adopting the number of digits to be complemented, the digit ratio, the natural constant, the time information, the occurrence frequency and the circumference ratio of the number of digits to be complemented in the 16-system digits; the discrete information source is a number;
an average information amount operator module for calculating an average information amount for the discrete information sources;
the first complementary digit number calculation submodule is used for calculating a first complementary digit number based on discrete component operation by adopting the average information quantity;
a second complementary digit calculating submodule for performing golden section on the first complementary digit to generate a second complementary digit;
and the second encrypted sequence generation sub-module is used for adding the complement digit to the first encrypted sequence based on the number of digits to be complemented and generating a second encrypted sequence.
8. The apparatus of claim 6 or 7, further comprising:
the initial group number determining module is used for grouping the second encrypted sequence according to a preset group number and determining the initial group number of each group;
the first summation module is used for summing the numbers of all digits in the second encrypted sequence;
a remainder module for taking the remainder of the digit of the second encrypted series by the sum;
a microscopic constant determination module for determining a microscopic constant by using the residue;
and the third encryption sequence generation module is used for determining the entropy group number of each group by adopting the microscopic constant and the boltzmann constant, and replacing the initial group number by adopting the entropy group number to generate a third encryption sequence.
9. The apparatus of claim 8, wherein the third encrypted sequence generation module comprises:
an entropy group number calculation sub-module for calculating an entropy group number for each group;
a first entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number, obtain, in the initial group number, an integer different from the determined entropy group number as an entropy group number according to a first preset order;
a second entropy group number determining submodule, configured to, when the entropy group number is the same as the determined entropy group number and there is no integer different from the determined entropy group number in the first preset order, obtain, as an entropy group number, an integer different from the determined entropy group number in the initial group number according to a second preset order; the initial group numbers are arranged according to a natural sequence, and the second preset sequence starts from the maximum number or the minimum number in the initial group numbers.
10. The apparatus of claim 8, further comprising:
an odd digit extraction module, configured to extract an odd digit in the third encrypted sequence;
a second summing module for calculating a sum of times of the odd-numbered digits in the second encrypted sequence;
a first comparison set sequence generation module for generating a first comparison set sequence for the third encrypted sequence based on a Fourier transform function, using the odd-numbered digits and a number of times the odd-numbered digits are in the third encrypted sequence;
the second control group array generating module is used for inverting the numbers in the first control group array bit by bit to generate a second control group array;
and the fourth encryption sequence generation module is used for generating a fourth encryption sequence through the second control group sequence based on the Maxolin cyclic exclusive-OR algorithm.
11. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1-5.
12. A computer-readable storage medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-5.
CN202210706335.XA 2022-06-21 2022-06-21 Data encryption method and device, electronic equipment and storage medium Active CN115225330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210706335.XA CN115225330B (en) 2022-06-21 2022-06-21 Data encryption method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210706335.XA CN115225330B (en) 2022-06-21 2022-06-21 Data encryption method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115225330A true CN115225330A (en) 2022-10-21
CN115225330B CN115225330B (en) 2024-06-28

Family

ID=83607546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210706335.XA Active CN115225330B (en) 2022-06-21 2022-06-21 Data encryption method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115225330B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116186745A (en) * 2023-04-27 2023-05-30 暗链科技(深圳)有限公司 Hash encryption method, nonvolatile readable storage medium, and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101237320A (en) * 2008-02-04 2008-08-06 西安理工大学 Method for password protection for constructing unidirectional hash function based on infinite dimension ultra-chaos
CN101296079A (en) * 2007-04-23 2008-10-29 索尼(中国)有限公司 One-way hashing function construction method and system based on built-in chaos mapping
CN105743916A (en) * 2016-04-03 2016-07-06 北京动石科技有限公司 Information processing method, system and device for enhancing access security
CN108155985A (en) * 2017-06-29 2018-06-12 广东网金云计算有限公司 A kind of encipher-decipher method, device and user terminal
CN110995433A (en) * 2019-10-28 2020-04-10 北京三快在线科技有限公司 Data encryption method and device, electronic equipment and computer readable storage medium
CN111386674A (en) * 2017-08-28 2020-07-07 迈锐奥塔企业有限公司 Terminal identity protection method in communication system
CN112307522A (en) * 2020-10-30 2021-02-02 苏州浪潮智能科技有限公司 Method and device for realizing maintenance service in software system and storage medium
US11018873B1 (en) * 2020-01-16 2021-05-25 Tyson York Winarski Collision resistant digital signatures
CN114374505A (en) * 2021-11-24 2022-04-19 中国银行股份有限公司 Ciphertext generating method, device, server, medium and product

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101296079A (en) * 2007-04-23 2008-10-29 索尼(中国)有限公司 One-way hashing function construction method and system based on built-in chaos mapping
CN101237320A (en) * 2008-02-04 2008-08-06 西安理工大学 Method for password protection for constructing unidirectional hash function based on infinite dimension ultra-chaos
CN105743916A (en) * 2016-04-03 2016-07-06 北京动石科技有限公司 Information processing method, system and device for enhancing access security
CN108155985A (en) * 2017-06-29 2018-06-12 广东网金云计算有限公司 A kind of encipher-decipher method, device and user terminal
CN111386674A (en) * 2017-08-28 2020-07-07 迈锐奥塔企业有限公司 Terminal identity protection method in communication system
CN110995433A (en) * 2019-10-28 2020-04-10 北京三快在线科技有限公司 Data encryption method and device, electronic equipment and computer readable storage medium
US11018873B1 (en) * 2020-01-16 2021-05-25 Tyson York Winarski Collision resistant digital signatures
CN112307522A (en) * 2020-10-30 2021-02-02 苏州浪潮智能科技有限公司 Method and device for realizing maintenance service in software system and storage medium
CN114374505A (en) * 2021-11-24 2022-04-19 中国银行股份有限公司 Ciphertext generating method, device, server, medium and product

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116186745A (en) * 2023-04-27 2023-05-30 暗链科技(深圳)有限公司 Hash encryption method, nonvolatile readable storage medium, and electronic device
CN116186745B (en) * 2023-04-27 2023-07-18 暗链科技(深圳)有限公司 Hash encryption method, nonvolatile readable storage medium, and electronic device

Also Published As

Publication number Publication date
CN115225330B (en) 2024-06-28

Similar Documents

Publication Publication Date Title
US20210399872A1 (en) Enabling constant plaintext space in bootstrapping in fully homomorphic encryption
CN106850220A (en) Data ciphering method, data decryption method and device
CN108400868B (en) Seed key storage method and device and mobile terminal
CN107784089B (en) Multimedia data storage method, processing method and mobile terminal
CN110162653B (en) Image-text sequencing recommendation method and terminal equipment
CN109145552B (en) Information encryption method and terminal equipment
CN115225330B (en) Data encryption method and device, electronic equipment and storage medium
CN107256346A (en) Protect method, system and the storage medium of file copy right
CN114973351A (en) Face recognition method, device, equipment and storage medium
CN109766705B (en) Circuit-based data verification method and device and electronic equipment
CN109446794B (en) Password input method and mobile terminal thereof
CN109145644B (en) Private key confusion and digital signature generation method and device and intelligent device
CN107358083A (en) A kind of information processing method, terminal and computer-readable recording medium
CN108933670A (en) A kind of digital signature method, device, mobile device and storage medium
CN115276966A (en) Data encryption method and device, electronic equipment and storage medium
CN110781488B (en) Password prompting method and terminal equipment
CN114629649B (en) Data processing method and device based on cloud computing and storage medium
CN108494958B (en) Image processing method and flexible screen terminal
CN115174758A (en) Picture encryption method and device, electronic equipment and storage medium
CN116527241A (en) Signature method, device and storage medium based on elliptic curve digital signature algorithm
CN104767622A (en) Encryption method and device
CN109743289B (en) Data verification method and device based on neural network and electronic equipment
CN110489977B (en) Operation control method and terminal
CN114900325A (en) Privacy set intersection method, system, device and medium based on federal learning
CN111192027B (en) Method and device for processing list and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant