CN103684763A - Data encryption method based on RSA algorithm, device and smart card - Google Patents
Data encryption method based on RSA algorithm, device and smart card Download PDFInfo
- Publication number
- CN103684763A CN103684763A CN201210351037.XA CN201210351037A CN103684763A CN 103684763 A CN103684763 A CN 103684763A CN 201210351037 A CN201210351037 A CN 201210351037A CN 103684763 A CN103684763 A CN 103684763A
- Authority
- CN
- China
- Prior art keywords
- multiplicand
- multiplier
- random
- numbers
- sums
- 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.)
- Pending
Links
Images
Landscapes
- Storage Device Security (AREA)
Abstract
The invention provides a data encryption method based on an RSA algorithm. The method comprises the steps that two numbers needing multiplication are acquired, wherein two numbers are respectively a multiplier and a multiplicand; the multiplier is split into the sum of at least two numbers, and the multiplicand is split into the sum of at least two numbers; and multiplication is carried out on at least two numbers which are acquired by splitting the multiplier and at least two numbers which are acquired by splitting the multiplicand, and adding is carried out on the multiplication results. The invention further provides a data encryption device based on the RSA algorithm and a smart card which realizes data encryption by using the method. According to the data encryption method based on the RSA algorithm, the device and the smart card, which are provided by the invention, two large numbers are split into a number of numbers, and then multiplication and adding are carried out on a number of numbers; the final result based on the RSA algorithm is not obviously correlated with the multiplier and the multiplicand in multiplication; the problem that the multiplier and the multiplicand are analyzed by an external attack can be prevented; and the security of the final encryption data is enhanced.
Description
Technical field
The application relates to technical field of data processing, particularly relates to a kind of data ciphering method based on RSA Algorithm, installs and have the smart card of enciphered data.
Background technology
Along with the development of computer network, the network information security is also paid attention to by industry gradually.Generally, by be encrypted anti-locking system people in addition that information data is tackled or revised to information.
RSA(Rivest Shamirh Adleman) algorithm is current more common a kind of public key algorithm, and the encryption key of use (public-key cryptography) is different from decruption key (privacy key).Normally first generate a pair of RSA key, one of them is privacy key, by user, is preserved; Another is public-key cryptography, can external disclosure, even can in the webserver, register.If privacy key is revealed, information security can be on the hazard.
At present, a kind of attack that the RSA Algorithm in IC-card series products is faced is conventionally DPA(Differential Power Analysis, difference energy consumption analysis) attack of type.When this kind of attack pattern can be worked according to RSA in the card monitoring, power consumption rule, analyzes multiplier or the multiplicand multiplying from result and the process power consumption of multiplying.Because RSA is used Chinese remainder theorem to do privacy key computing, wherein just comprise multiplying.Therefore, the multiplier in multiplying or multiplicand analyzed out after, just can analyze the privacy key of RSA.Therefore, adopt the Information Security that this kind of algorithm is encrypted well not guaranteed.
Summary of the invention
The application's technical problem to be solved is to provide a kind of data ciphering method, device and smart card based on RSA Algorithm, can solve the poor problem of Information Security that the cryptographic algorithm based on current produces.
In order to address the above problem, the application discloses a kind of data ciphering method based on RSA Algorithm, comprises the following steps:
Obtain two numbers that need to carry out multiplying, be respectively multiplier and multiplicand;
Described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums;
Described multiplier partition is obtained at least two numbers and multiply each other with at least two numbers that described multiplicand partition obtains respectively, the results added obtaining multiplying each other.
Further, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and by randomizer, realizes, comprising:
Input needs the number of partition;
Random at least two numbers that produce of the number of random generator based on described input, described at least two number sums equal the number of described input.
Further, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and by randomizer, realizes, comprising:
Random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand;
All the first random number sums that described multiplier deducted to random generation obtain the first remainder, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
Further, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and comprises:
Multiplier is split into two number sums, multiplicand is split into two number sums.
Disclosed herein as well is a kind of data encryption device based on RSA Algorithm, comprising:
Data acquisition module, for obtaining two numbers that need to carry out multiplying, is respectively multiplier and multiplicand;
Partition module, for described multiplier being divided into at least two number sums, is divided at least two number sums by described multiplicand;
Computing module, multiplies each other with at least two numbers that described multiplicand partition obtains respectively for described multiplier partition being obtained at least two numbers, the results added obtaining multiplying each other.
Further, described partition module comprises:
Randomizer, for random at least two numbers that produce of the number based on input, described at least two number sums equal the number of described input.
Further, described partition module comprises:
Randomizer, for random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand;
Calculating sub module, obtains the first remainder for described multiplier being deducted to all first random number sums of random generation, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
Further, described partition module is divided into respectively two number sums by multiplier and multiplicand.
Disclosed herein as well is a kind of smart card, adopt the foregoing data ciphering method based on RSA Algorithm to be encrypted data wherein.
Compared with prior art, the application comprises following advantage:
The application is when RSA Algorithm is carried out to data encryption, originally the mode that multiplier in multiplying and multiplicand are splitted into respectively at least two number sums represents, in the time of can avoiding multiplier and multiplicand directly to multiply each other by this kind of mode, assailant obtains multiplier and multiplicand by analyzing the result of multiplying, thereby guarantees the safety and stability of enciphered data.
Accompanying drawing explanation
Fig. 1 is the flow chart of the application's the data ciphering method embodiment mono-based on RSA Algorithm;
Fig. 2 is the structural representation of the application's the data encryption device embodiment based on RSA Algorithm.Embodiment
For the application's above-mentioned purpose, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
The application is based on RSA Algorithm, ciphering process to data improves further, by when normal RSA Algorithm is encrypted, to adopting two large numbers to do this step of multiplying in the process of privacy key computing, improve, the mode that adopts the number after a plurality of partition to multiply each other and then be added, make final result based on RSA computing and the multiplier in multiplying and multiplicand there is no obvious correlation, this just can prevent that external attack from analyzing multiplier and multiplicand from the correlation of multiplication power consumption and final result, thereby the fail safe of final enciphered data is enhanced.
With reference to Fig. 1, a kind of data ciphering method embodiment based on RSA Algorithm of the application is shown, comprise the following steps:
Can be random multiplier and multiplicand be broken as long as can enough at least two numbers represent this multiplier or multiplicand, for example, can be two, three, four or more.Wherein, the quantity of the number that multiplier and multiplicand are broken can be identical, also can be different.For example, multiplier can be divided into two number sums, and multiplicand can be divided into two number sums, also can be divided into three, four or most sum.
Preferably, can adopt the mode of randomizer to break, can pre-enter the number that needs partition, then randomizer is random produces at least two numbers, as long as this at least two numbers sum equals to pre-enter the number of partition.Be appreciated that to come in the following way multiplier or multiplicand broken:
Random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand;
All the first random number sums that described multiplier deducted to random generation obtain the first remainder, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
Be appreciated that because at least one first random number is random generation, so when having a plurality of the first random number, each first random number may be identical, also may be different.In like manner, for the second random number, be also like this.In addition, if only have first random number or the second random number, the first remainder is multiplier and deducts the first random number so, and the second remainder is multiplicand and deducts the second random number.Also be, the application is that the mode that multiplier originally and multiplicand are splitted into respectively at least two number sums represents, in the time of can avoiding multiplier and multiplicand directly to multiply each other by this kind of mode, assailant obtains multiplier and multiplicand by analyzing the result of multiplying, thereby guarantees the fail safe of enciphered data.
Preferably, in aforementioned partition process, can also break according to the length of multiplier and multiplicand, even if the number before the number after partition and partition has equal length, thereby reduce operand, improve system treatment effeciency.
Concrete, can preset the length of multiplier and the multiplicand that need to carry out multiplying, when needed, randomizer produces respectively the first random number and the second random number according to predefined length.Be appreciated that, when specific implementation, also can realize automatic identification, carry out in RSA data encryption process, when proceeding to multiplying step, encryption device is identified the length of multiplier and multiplicand automatically, then be transferred to randomizer, randomizer is according to the multiplier and the multiplicand that get, and the length of the two, produces the first random number and the second random number.
Wherein, the quantity of the number that multiplier and multiplicand partition obtain, for example, the quantity of at least one first random number and the second random number can be determined according to the operational capability of encryption device.If the operational capability of encryption device is enough strong, fecund is given birth to several partition numbers as much as possible, for example three, four, or more, because partition number is more, the fail safe of institute's enciphered data is higher, it is just lower by the possibility of attack recognition.Otherwise, can only produce first random number and second random number, although the now fail safe of enciphered data can reduce when having a plurality of random number, but the mode by observing multiplying power consumption rule is this enciphered data of None-identified still, therefore its Information Security still can be improved, and prevents from being identified attack, simultaneously, because the data volume of partition is little, can improve the treatment effeciency of data encryption device.
If multiplier is divided into the first random number and the first remainder, multiplicand is divided into the second random number and the second remainder, this step is so: the first remainder is multiplied by the second remainder, the first remainder is multiplied by the second random number, the first random number is multiplied by the second remainder, the first random number is multiplied by the second random number, then these four multiplication results is added.According to mathematical operation rule, four multiplication results are added coming to the same thing that multiplier before the result that obtains and partition and multiplicand directly multiply each other, but after partition, single from result, assailant analyze obtain the difficulty of this four number can be far away higher than obtaining multiplier and multiplicand.
Below in conjunction with instantiation, aforementioned process is elaborated, supposes that the multiplier in the multiplying of rsa encryption is x, multiplicand is y, and the two carries out the result z=x * y of multiplying.
Adopt the application's the data ciphering method based on RSA Algorithm, when proceeding to multiplying, first obtain x and y, then produce at random at least one first random number identical with x length and at least one second random number identical with y length, supposing to produce first random number is herein x1 and a second random number y1.Multiplier x is deducted to x1 and obtain the first remainder x2, multiplicand y deducts y1 and obtains the second remainder y2.Be x=x1+x2, y=y1+y2.Then after the first remainder and the first random number being multiplied each other respectively at the second remainder and the second random number, then be added.Be x1 * y1+x1 * y2+x2 * y1+x2 * y2.After this four number multiplies each other respectively, be added again the result obtaining and can draw x1 * y1+x1 * y2+x2 * y1+x2 * y2=x1 * (y1+y2)+x2 * (y1+y2)=(x1+x2) * (y1+y2)=x * y=z through mathematical operation.Also, after partition, calculating result is identical with the result before partition.But now, by operation result z analyze obtain the difficulty of x1, x2, y1, y2 can be far away higher than analyze the difficulty that obtains x and y by z.If be appreciated that, x and y are split into three number sums or four number sums or most sum, and it is analyzed by z the possibility that obtains each partition number and can greatly reduce.
Therefore, can find out, the fail safe of the data that employing the application's the data ciphering method based on RSA Algorithm obtains is improved, and prevents that external attack from drawing initial data from the correlation analysis of multiplication power consumption and final result.
With reference to Fig. 2, the application's the data encryption device based on RSA Algorithm is shown, comprise data acquisition module 10, partition module 20 and computing module 30.
Preferably, this partition module 20 comprises randomizer, and for random at least two numbers that produce of the number based on input, described at least two number sums equal the number of described input.
Be appreciated that this partition module 20 can also comprise randomizer and calculating sub module simultaneously.Wherein, randomizer, for random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand.Calculating sub module, obtains the first remainder for described multiplier being deducted to all first random number sums of random generation, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
Partition module can be divided into multiplier and multiplicand two, three or more count sum, and the quantity of the number being broken is more, and the fail safe of its enciphered data is higher, and correspondingly, its operand is also larger.Therefore,, in order to take into account fail safe and operation efficiency, preferably, partition module is divided into respectively two number sums by multiplier and multiplicand.
Preferably, the application also comprises a kind of smart card, and it includes by the aforementioned data ciphering method based on RSA Algorithm encrypts the data that obtain.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.For system embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
The data ciphering method based on RSA Algorithm, device and the smart card that above the application are provided are described in detail, applied specific case herein the application's principle and execution mode are set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; Meanwhile, for one of ordinary skill in the art, the thought according to the application, all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.
Claims (9)
1. the data ciphering method based on RSA Algorithm, is characterized in that, comprises the following steps:
Obtain two numbers that need to carry out multiplying, be respectively multiplier and multiplicand;
Described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums;
Described multiplier partition is obtained at least two numbers and multiply each other with at least two numbers that described multiplicand partition obtains respectively, the results added obtaining multiplying each other.
2. the data ciphering method based on RSA Algorithm as claimed in claim 1, is characterized in that, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and by randomizer, realizes, and comprising:
Input needs the number of partition;
Random at least two numbers that produce of the number of random generator based on described input, described at least two number sums equal the number of described input.
3. the data ciphering method based on RSA Algorithm as claimed in claim 1, is characterized in that, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and by randomizer, realizes, and comprising:
Random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand;
All the first random number sums that described multiplier deducted to random generation obtain the first remainder, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
4. the data ciphering method based on RSA Algorithm as described in claims 1 to 3 any one, is characterized in that, described multiplier is divided into at least two number sums, described multiplicand is divided into at least two number sums and comprises:
Multiplier is split into two number sums, multiplicand is split into two number sums.
5. the data encryption device based on RSA Algorithm, is characterized in that, comprising:
Data acquisition module, for obtaining two numbers that need to carry out multiplying, is respectively multiplier and multiplicand;
Partition module, for described multiplier being divided into at least two number sums, is divided at least two number sums by described multiplicand;
Computing module, multiplies each other with at least two numbers that described multiplicand partition obtains respectively for described multiplier partition being obtained at least two numbers, the results added obtaining multiplying each other.
6. the data encryption device based on RSA Algorithm as claimed in claim 5, is characterized in that, described partition module comprises:
Randomizer, for random at least two numbers that produce of the number based on input, described at least two number sums equal the number of described input.
7. the data encryption device based on RSA Algorithm as claimed in claim 5, is characterized in that, described partition module comprises:
Randomizer, for random at least one first random number and at least one second random number of producing, described at least one first random number sum is less than multiplier, and described at least one second random number sum is less than multiplicand;
Calculating sub module, obtains the first remainder for described multiplier being deducted to all first random number sums of random generation, and all the second random number sums that described multiplicand deducted to random generation obtain the second remainder.
8. the data encryption device based on RSA Algorithm as described in claim 5 to 7 any one, is characterized in that, described partition module is divided into respectively two number sums by multiplier and multiplicand.
9. a smart card, is characterized in that, the data ciphering method based on RSA Algorithm of employing as described in claim 1 to 4 any one is encrypted data wherein.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210351037.XA CN103684763A (en) | 2012-09-19 | 2012-09-19 | Data encryption method based on RSA algorithm, device and smart card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210351037.XA CN103684763A (en) | 2012-09-19 | 2012-09-19 | Data encryption method based on RSA algorithm, device and smart card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103684763A true CN103684763A (en) | 2014-03-26 |
Family
ID=50321161
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210351037.XA Pending CN103684763A (en) | 2012-09-19 | 2012-09-19 | Data encryption method based on RSA algorithm, device and smart card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103684763A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055128A (en) * | 2017-12-18 | 2018-05-18 | 数安时代科技股份有限公司 | Generation method, device, storage medium and the computer equipment of RSA key |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1411644A (en) * | 1999-10-14 | 2003-04-16 | 格姆普拉斯公司 | Countermeasure method in electronic component which uses RSA-type public key cryptographic algorithm |
CN101122850A (en) * | 2007-09-21 | 2008-02-13 | 清华大学 | Large number multiplier based on secondary Booth coding |
CN101213512A (en) * | 2005-06-29 | 2008-07-02 | 皇家飞利浦电子股份有限公司 | Arrangement for and method of protecting a data processing device against an attack or analysis |
CN101470598A (en) * | 2007-12-28 | 2009-07-01 | 航天信息股份有限公司 | Method for improving big integer Montgomery modular multiplication speed |
US20100183142A1 (en) * | 2006-01-16 | 2010-07-22 | Sony Corporation | Encryption Processing Apparatus, Encryption Processing Method, and Computer Program |
CN101902331A (en) * | 2009-05-28 | 2010-12-01 | 质子世界国际公司 | Protection of a generation of prime numbers for the RSA algorithm |
US20110228930A1 (en) * | 2008-07-18 | 2011-09-22 | Thomson Licensing | Method and device for key generation |
CN102468956A (en) * | 2010-11-11 | 2012-05-23 | 上海华虹集成电路有限责任公司 | Method suitable for RSA modular exponentiation calculation |
CN102571342A (en) * | 2010-12-27 | 2012-07-11 | 北京中电华大电子设计有限责任公司 | RSA (Ron Rivest, Adi Shamir and Leonard Adleman) algorithm digital signature method |
-
2012
- 2012-09-19 CN CN201210351037.XA patent/CN103684763A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1411644A (en) * | 1999-10-14 | 2003-04-16 | 格姆普拉斯公司 | Countermeasure method in electronic component which uses RSA-type public key cryptographic algorithm |
CN101213512A (en) * | 2005-06-29 | 2008-07-02 | 皇家飞利浦电子股份有限公司 | Arrangement for and method of protecting a data processing device against an attack or analysis |
US20100183142A1 (en) * | 2006-01-16 | 2010-07-22 | Sony Corporation | Encryption Processing Apparatus, Encryption Processing Method, and Computer Program |
CN101122850A (en) * | 2007-09-21 | 2008-02-13 | 清华大学 | Large number multiplier based on secondary Booth coding |
CN101470598A (en) * | 2007-12-28 | 2009-07-01 | 航天信息股份有限公司 | Method for improving big integer Montgomery modular multiplication speed |
US20110228930A1 (en) * | 2008-07-18 | 2011-09-22 | Thomson Licensing | Method and device for key generation |
CN101902331A (en) * | 2009-05-28 | 2010-12-01 | 质子世界国际公司 | Protection of a generation of prime numbers for the RSA algorithm |
CN102468956A (en) * | 2010-11-11 | 2012-05-23 | 上海华虹集成电路有限责任公司 | Method suitable for RSA modular exponentiation calculation |
CN102571342A (en) * | 2010-12-27 | 2012-07-11 | 北京中电华大电子设计有限责任公司 | RSA (Ron Rivest, Adi Shamir and Leonard Adleman) algorithm digital signature method |
Non-Patent Citations (1)
Title |
---|
庞世春: "能抵御边信道攻击的椭圆曲线标量乘算法研究", 《中国博士学位论文全文数据库 信息科技辑 (月刊 ) 2011 年》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108055128A (en) * | 2017-12-18 | 2018-05-18 | 数安时代科技股份有限公司 | Generation method, device, storage medium and the computer equipment of RSA key |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
ZA201805050B (en) | Cryptographic method and system for secure extraction of data from a blockchain | |
CN111898137A (en) | Private data processing method, equipment and system for federated learning | |
EP3202079B1 (en) | Exponent splitting for cryptographic operations | |
EP3230921B1 (en) | Multiplicative masking for cryptographic operations | |
US9176707B2 (en) | Arithmetic apparatus, elliptic scalar multiplication method of arithmetic apparatus, elliptic scalar multiplication program, residue operation method of arithmetic apparatus, and residue operation program | |
EP3930252A1 (en) | Countermeasures for side-channel attacks on protected sign and key exchange operations | |
US10721056B2 (en) | Key processing method and device | |
CN108418688B (en) | Computing device, method and storage medium for elliptic curve cryptography hardware acceleration | |
Mahajan et al. | Analysis of RSA algorithm using GPU programming | |
US10693625B2 (en) | Security processor, application processor including the same, and operating method of security processor | |
JP2007187958A (en) | Cryptography processing device, cryptography processing method, and computer program | |
CN106464483A (en) | Countermeasure method for electronic component implementing elliptic curve cryptography algorithm | |
CN113014373B (en) | Data encryption method, device, equipment and medium in homomorphic calculation | |
KR20110085403A (en) | Method and apparatus for providing masking operations in encryption system | |
Wenger et al. | Solving the discrete logarithm of a 113-bit Koblitz curve with an FPGA cluster | |
CN105681033B (en) | A kind of out-of-order encryption device of multivariate quadratic equation | |
CN105119929B (en) | Safe module exponent outsourcing method and system under single malice Cloud Server | |
Vijayakumar et al. | Comparative study of hyperelliptic curve cryptosystem over prime field and its survey | |
WO2019191040A1 (en) | Using cryptographic blinding for efficient use of montgomery multiplication | |
KR101344402B1 (en) | Method and apparatus for rsa signature | |
CN103684763A (en) | Data encryption method based on RSA algorithm, device and smart card | |
WO2023141934A1 (en) | Efficient masking of secure data in ladder-type cryptographic computations | |
EP3972187A1 (en) | Protection of authentication tag computation against power and electromagnetic side-channel attacks | |
CN105743644B (en) | A kind of mask encryption device of multivariate quadratic equation | |
CN116225373A (en) | Data processing method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination |