CN103701593A - 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method - Google Patents

256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method Download PDF

Info

Publication number
CN103701593A
CN103701593A CN201310739565.7A CN201310739565A CN103701593A CN 103701593 A CN103701593 A CN 103701593A CN 201310739565 A CN201310739565 A CN 201310739565A CN 103701593 A CN103701593 A CN 103701593A
Authority
CN
China
Prior art keywords
algorithm
pki
private key
prime number
rsa
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
Application number
CN201310739565.7A
Other languages
Chinese (zh)
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.)
Xian University of Technology
Original Assignee
Xian University of Technology
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 Xian University of Technology filed Critical Xian University of Technology
Priority to CN201310739565.7A priority Critical patent/CN103701593A/en
Publication of CN103701593A publication Critical patent/CN103701593A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method, which comprises a public and private key pair generating process, an encryption process and a decryption process. By the encryption method, large numbers with any digits can be quickly and efficiently computed, the limitation of a built-in type is broken, the resource is fully and efficiently utilized, efficient algorithms such as an Euclidean algorithm and a primality testing algorithm are optimized again from a bottom layer, and the computation efficiency is improved. By a table look-up method, the computation efficiency is improved, the effect of encrypting and decrypting all file formats is realized, and the universality of encryption and decryption is realized.

Description

Rsa encryption method based on the large number of 256 system
Technical field
The invention belongs to encryption method technical field, relate to a kind of rsa encryption method based on the large number of 256 system.
Background technology
Along with the arriving in cloud epoch, large data (Big data) have also attracted increasing concern.The analyst team of work The Cloud Terrace thinks, large data (Big data) are commonly used to a large amount of destructurings and the semi-structured data that describe that Yi Ge company creates, these data download to relevant database can overspending time and money when analyzing.Normal and the cloud computing of large data analysis is linked together, because real-time large data set analysis need to share out the work to tens of, hundreds of or even thousands of computers by the framework as MapReduce.
For large data age, have that data volume is large, type is various, value density is low and the feature such as the fast timeliness height of speed.Under this background, a lot of application all will be based upon on the basis of large data processing.Owing to much only the processing of built-in type cannot being met to current demand, so the urgency of large data processing is self-evident.
RSA public key encryption algorithm be one can also can be for the algorithm of digital signature for data encryption.Its easy to understand and operation, also all the fashion.RSA public key encryption algorithm is named with inventor's surname initial: Ron Rivest, Adi Shamir and Leonard Adleman.Although since 1978 propose, the fail safe of RSA fails to obtain theoretic proof always, it has experienced various attack.Along with increasing business application and standardization effort, RSA has become the most representative public key cryptography.The secure electronic transaction standard (Secure Electronic Transactions, SET) that the companies such as VISA, MasterCard, IBM, Microsoft pull together to formulate has just adopted standard RSA algorithm, and this makes RSA almost ubiquitous in our life.The authentication function chips of digital certificate, intelligent mobile phone and storage card that online transaction encryption connection, Web bank's authentication, various credit card are used etc., great majority are used RSA technology.But existing RSA public key encryption algorithm Shortcomings part is that the realization of algorithm depends on speed and the capacity of computer, efficiency is lower.What carry out due to RSA Algorithm is all that large number calculates, and makes also than DES slow several times of situations that RSA is the fastest, and this is also the greatest drawback of RSA, so it only can be processed and encrypts a small amount of data.
Summary of the invention
The object of the present invention is to provide a kind of rsa encryption method based on the large number of 256 system, solve the slow problem of bottom data arithmetic speed that prior art exists.
Technical scheme of the present invention is that the rsa encryption method based on the large number of 256 system, comprises and produce public and private key to process, ciphering process and decrypting process.
Feature of the present invention is also:
Comprise large prime number p, large prime number q and produce public and private key to relate to three parameter n, e1, e2; Wherein, n is the long-pending of two large prime number p, q, and e1 and e2 are a pair of relevant values, and e1 can get arbitrarily, but requires e1 and (p-1) * (q-1) is relatively prime; Select again e2, meet (e2*e1) mod ((p-1) * (q-1))=1;
Specific algorithm is as follows:
(1) produce large prime number p and large prime number q immediately:
Utilize Rabin's Miller disposition detection algorithm, first large several M of figure place are specified in random generation, then utilize a plurality of random number r to carry out disposition detection to the large several M that produce, can be by thinking prime number;
Can obtain like this Euler n and count greatly n;
Its computational process is: n=p*q; Euler n=(p-1) * (q-1);
(2) by Euler n, find PKI, key:
By Euclidean algorithm, traversal table of primes, adjusts algorithm through gcd recurrence, finds the several e1s relatively prime with Euler n as PKI, calculates key e2 simultaneously, makes them meet relation (e1*e2) mod oln=1;
PKI is to being (n, e1), and private key is to being (n, e2);
Calculate private key (e2), produce PKI to (n, e1), private key is to (n, e2);
If A is that expressly B is ciphertext, encrypt: A=B^e2mod n; Deciphering: B=A^e1mod n;
(3) by PKI to file content is encrypted:
Ciphering process is, reads one by one plaintext to be encrypted from file, and agreement is read a byte at every turn and is encrypted, ciphertext after encryption is a large number, utilize structure to store it, comprise the information such as the maximum length of array, current figure place, then write cryptograph files.
(4) by key to file content is decrypted:
Decrypting process is, from cryptograph files, read one by one and treat decrypting ciphertext, read the data of a structure type decomposes at every turn, comprise large array, current data figure place and maximum data figure place, then utilize decipherment algorithm to carry out computing to each large number and obtain expressly and write clear text file, complete deciphering.
The present invention has following beneficial effect:
1, encryption method of the present invention can be carried out rapidly and efficiently computing to the large number in any position, broken the restriction of built-in type, and fully efficiently utilize resource, and from bottom, the highly effective algorithms such as Euclidean algorithm, disposition detection algorithm are optimized again, improved operation efficiency.
2, the present invention utilizes look-up table, has not only improved operation efficiency, and has solved the encrypting and decrypting problem for All Files form, has realized the versatility of encryption and decryption.
Accompanying drawing explanation
Fig. 1 is the rsa encryption embodiment of the method faithful record figure that the present invention is based on the large number of 256 system.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is elaborated.
The present invention is based on the rsa encryption method of the large number of 256 system, comprise and produce public and private key to process, ciphering process and decrypting process.
To the processing of bottom data depend on reply 256 systems realize a set ofly add efficiently, subtract, multiplication and division and delivery basic operation; it realizes principle: plus-minus adopts basic carry borrow principle of operation; for multiplication, adopt displacement to multiply each other; the result store that one of them multiplier and 0-255 are multiplied each other, in the large array of 256, then allows each shifter-adder of tabling look-up of another multiplier obtain results needed.For division, adopt vertical rule of being divided by, record remainder simultaneously, computing when realizing division and delivery, reduces amount of calculation.
Algorithm of the present invention comprises following parameter: large prime number p, large prime number q and generation public and private key are to relate to three parameter n, e1, e2; Wherein, n is the long-pending of two large prime number p, q, and e1 and e2 are a pair of relevant values, and e1 can get arbitrarily, but requires e1 and (p-1) * (q-1) is relatively prime; Select again e2, meet (e2*e1) mod ((p-1) * (q-1))=1.
Specific algorithm is as follows:
(1) produce large prime number p and large prime number q immediately:
Utilize Rabin's Miller disposition detection algorithm, first large several M of figure place are specified in random generation, then utilize a plurality of random number r to carry out disposition detection to the large several M that produce, can be by thinking prime number in certain degree; In addition, optimization is the advanced preliminary treatment of large prime number immediately to producing, and controlling low level or a high position, make it be first an odd number, utilizes in addition little prime number to test in advance, raises the efficiency.
Can obtain like this Euler n and count greatly n:
Its computational process is: n=p*q; Euler n=(p-1) * (q-1);
(2) by Euler n, find PKI, key:
By Euclidean algorithm, traversal table of primes, adjusts algorithm through gcd recurrence, finds the several e1s relatively prime with Euler n as PKI, calculates key e2 simultaneously, makes them meet relation (e1*e2) mod oln=1;
PKI is to being (n, e1), and private key is to being (n, e2);
Calculate private key (e2), produce PKI to (n, e1), private key is to (n, e2);
Occupation mode is: establish A for plaintext, B is ciphertext, encrypts: A=B^e2mod n; Deciphering: B=A^e1mod n;
(3) by PKI to file content is encrypted:
Ciphering process is, reads one by one plaintext to be encrypted from file, and agreement is read a byte at every turn and is encrypted, ciphertext after encryption is a large number, utilize structure to store it, comprise the information such as the maximum length of array, current figure place, then write cryptograph files.
(4) by key to file content is decrypted:
Decrypting process is, from cryptograph files, read one by one and treat decrypting ciphertext, read the data of a structure type decomposes at every turn, comprise large array, current data figure place and maximum data figure place, then utilize decipherment algorithm to carry out computing to each large number and obtain expressly and write clear text file, complete deciphering.
The present invention has carried out following 4 optimizations to prior art:
1. in the storage of space, adopt 256 systems:
Large several n in current encryption system more than many employings 1024 bits meet the security level of algorithm, this key length has surpassed the memory range of built-in type in computer, for conventional way, use the form of linear character array to carry out the storage of large number, draw by analysis for a unsigned char type and account for a byte (x8632 position cpu), the present invention just stores 0-9, namely only need three bits above, never use for below 5, so its utilance is extremely low, what follow is exactly the decline of arithmetic speed.Therefore, for addressing this problem, the present invention proposes a kind of large several memory mechanisms based on 256 systems, makes full use of the space of these 8 bits, makes the large number of 1024 bits use memory mechanism of the present invention only to need 128 can meet the demands.
Pair 256 systems realize a set ofly add efficiently, subtract, multiplication and division and delivery basic operation; it realizes principle: plus-minus adopts basic carry borrow principle of operation; for multiplication, adopt displacement to multiply each other; the result store that one of them multiplier and 0-255 are multiplied each other, in the large array of 256, then allows each shifter-adder of tabling look-up of another multiplier obtain results needed.For division, adopt vertical rule of being divided by, record remainder simultaneously, computing when realizing division and delivery, reduces amount of calculation.
Through test, for the large number of 256 system more than kilobit (amounting to the decimal system about 2500 multidigits), above each algorithm processing time is a second level.
Optimization during the large several encryption methods of 3.RSA realize:
(1) optimization of the quick power modulo n arithmetic in Montgomery:
That the present invention calculates ratio juris and the optimization carried out based on 256 system storage organizations is calculated fast below:
As calculate B=A^e2mod n:
E2 is represented with 2 systems, from low level,
A, res are initialized as 1, m and are initialized as A;
If high one of b e2 is 1, res=(res*m) mod n;
If high one of c e2 is 0, m=(m*m) mod n;
d、return?res;
Be characterized in agreeing with 256 system storage node conceptions, because each element of sequence list is all unsigned char type, storage organization in internal memory is just in time binary system, therefore, adopt 256 system storages, without e2 is converted into binary system again, only need start from sequence list the first bit element, 8 circulations, each with 1 with, result is 1 and carries out the 2nd step, result is 0 and carries out the 3rd step that the next element of sequence list is got in 8 circulation end, until take sequence list, obtain the value that result d is ciphertext B.
(2) optimization of disposition detection algorithm:
Utilize Rabin's Miller disposition detection algorithm, optimization of the present invention is the advanced preliminary treatment of large prime number immediately to producing, and controlling low level or a high position, make it be first an odd number, utilizes in addition little prime number to test in advance, raises the efficiency.
4. the optimization (look-up table) in encryption method process:
Plain text encryption and decrypt ciphertext utilize data dictionary to record 0-255 encrypted result, the ASCII of the data of reading in before each encryption searches as array indexing subscript, find direct utilization, do not find and utilize existing algorithm to be encrypted computing and in table, supply search next time result store.
Embodiment, due to the restriction of room and time, the demonstration of the large number that the present embodiment is all adopts the print form (in actual applications without printing, only needing to utilize large number array) of a byte of a byte.
First stage, produce the required public and private key pair of encryption method:
Prime number adopts five bit lengths (user can nominative testing length), as follows by generating immediately the result producing:
Prime number p: 143 105 255 97 73
Prime number q: 51 30 18 201 203
According to following rule: the product of prime number p, q is n, gets arbitrary value e1, require e1 and (p-1) * (q-1) is relatively prime, then select suitable e2, and meet (e2*e1) mod ((p-1) * (q-1))=1;
Draw each parameter value (high-order on a left side, low level is on the right side):
N is: 28 162 246 210 206 216 246 6 117 227
Oln (i.e. (p-1) * (q-1)) is:
28?162?246?210?206?22?109?244?74?208
PKI e1 is: 5 186 49 93 92 106 226 202 117 93
Private key e2 is: 5
(n, e1), (n, e2) is exactly key pair; Wherein (n, e1) is PKI, and (n, e2) is private key.
Arrive this, produced all data that encryption method needs.
Second stage, ciphering process:
Encrypt formula: establish A for plaintext, B is ciphertext: B=A^e2mod n;
A is ' x ', and its file layout is: 120
Ciphertext after it is encrypted is: 10 6 32 236 75 154 198 72 0 138
To in these ciphertext writing in files, just can realize the encryption to data like this.
Phase III, decrypting process:
Deciphering formula: establish A for plaintext, B is ciphertext: A=B^e1mod n;
Ciphertext to second stage is decrypted operation:
The large data that read out in cryptograph files are:
10?6?32?236?75?154?198?72?0?138
Utilize the character after above formula deciphering to be: 120
Arrive this, realized all operations of encryption method, referring to Fig. 1, altogether needing the time is 0.312 second.

Claims (2)

1. the rsa encryption method based on the large number of 256 system, is characterized in that: comprise and produce public and private key to process, ciphering process and decrypting process.
2. the rsa encryption method based on the large number of 256 system as claimed in claim 1, is characterized in that: comprise large prime number p, large prime number q and produce public and private key to relate to three parameter n, e1, e2; Wherein, n is the long-pending of two large prime number p, q, and e1 and e2 are a pair of relevant values, and e1 can get arbitrarily, but requires e1 and (p-1) * (q-1) is relatively prime; Select again e2, meet (e2*e1) mod ((p-1) * (q-1))=1;
Specific algorithm is as follows:
(1) produce large prime number p and large prime number q immediately:
Utilize Rabin's Miller disposition detection algorithm, first large several M of figure place are specified in random generation, then utilize a plurality of random number r to carry out disposition detection to the large several M that produce, and can, by thinking prime number, obtain Euler n and count greatly n;
Its computational process is: n=p*q; Euler n=(p-1) * (q-1);
(2) by Euler n, find PKI, key:
By Euclidean algorithm, traversal table of primes, adjusts algorithm through gcd recurrence, finds the several e1s relatively prime with Euler n as PKI, calculates key e2 simultaneously, makes them meet relation (e1*e2) mod oln=1;
PKI is to being (n, e1), and private key is to being (n, e2);
Calculate private key (e2), produce PKI to (n, e1), private key is to (n, e2);
If A is that expressly B is ciphertext, encrypt: A=B^e2mod n; Deciphering: B=A^e1mod n;
(3) by PKI to file content is encrypted:
Ciphering process is, reads one by one plaintext to be encrypted from file, and agreement is read a byte at every turn and is encrypted, ciphertext after encryption is a large number, utilize structure to store it, comprise the information such as the maximum length of array, current figure place, then write cryptograph files.
(4) by key to file content is decrypted:
Decrypting process is, from cryptograph files, read one by one and treat decrypting ciphertext, read the data of a structure type decomposes at every turn, comprise large array, current data figure place and maximum data figure place, then utilize decipherment algorithm to carry out computing to each large number and obtain expressly and write clear text file, complete deciphering.
CN201310739565.7A 2013-12-26 2013-12-26 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method Pending CN103701593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310739565.7A CN103701593A (en) 2013-12-26 2013-12-26 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310739565.7A CN103701593A (en) 2013-12-26 2013-12-26 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method

Publications (1)

Publication Number Publication Date
CN103701593A true CN103701593A (en) 2014-04-02

Family

ID=50362999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310739565.7A Pending CN103701593A (en) 2013-12-26 2013-12-26 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method

Country Status (1)

Country Link
CN (1) CN103701593A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685660A (en) * 2015-11-07 2017-05-17 上海复旦微电子集团股份有限公司 Method and device for testing large prime number
CN108599941A (en) * 2018-04-28 2018-09-28 陶宁宇 Random asymmetries expand byte encryption of communicated data method
CN109598133A (en) * 2018-11-27 2019-04-09 苏州浪潮智能软件有限公司 The implementation method of data file encryption C language based on RSA Algorithm
CN110838914A (en) * 2019-11-07 2020-02-25 鲜明 Method for establishing and using dynamic key system
CN112770140A (en) * 2020-12-22 2021-05-07 深圳市特博赛科技有限公司 Stream encryption method and system combining Chen's theorem and RSA depth
CN115529163A (en) * 2022-08-25 2022-12-27 江苏电力信息技术有限公司 Login identification encryption method for digital business hall of electric power system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
姜楠,等: "基于RSA算法的文件加密系统设计", 《大连民族学院学报》 *
李倩: "RSA加密体制的密钥生成技术的研究", 《现代计算机》 *
胡云: "RSA算法研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685660A (en) * 2015-11-07 2017-05-17 上海复旦微电子集团股份有限公司 Method and device for testing large prime number
CN106685660B (en) * 2015-11-07 2020-04-17 上海复旦微电子集团股份有限公司 Method and device for testing large prime number
CN108599941A (en) * 2018-04-28 2018-09-28 陶宁宇 Random asymmetries expand byte encryption of communicated data method
CN109598133A (en) * 2018-11-27 2019-04-09 苏州浪潮智能软件有限公司 The implementation method of data file encryption C language based on RSA Algorithm
CN110838914A (en) * 2019-11-07 2020-02-25 鲜明 Method for establishing and using dynamic key system
CN110838914B (en) * 2019-11-07 2023-04-07 鲜明 Method for establishing and using dynamic key system
CN112770140A (en) * 2020-12-22 2021-05-07 深圳市特博赛科技有限公司 Stream encryption method and system combining Chen's theorem and RSA depth
CN112770140B (en) * 2020-12-22 2021-08-24 深圳市特博赛科技有限公司 Stream encryption method and system combining Chen's theorem and RSA depth
CN115529163A (en) * 2022-08-25 2022-12-27 江苏电力信息技术有限公司 Login identification encryption method for digital business hall of electric power system

Similar Documents

Publication Publication Date Title
Khalique et al. Implementation of elliptic curve digital signature algorithm
Gutoski et al. Hierarchical deterministic bitcoin wallets that tolerate key leakage
CN103701593A (en) 256-system large number-based Ron Rivest, Adi Shamir and Leonard Adleman (RSA) encryption method
CN109039640B (en) Encryption and decryption hardware system and method based on RSA cryptographic algorithm
US20140294177A1 (en) Identity based public key cryptosystem
Khan et al. Data security in cloud computing using elliptic curve cryptography
TW200939115A (en) Representation change of a point on an elliptic curve
CN112930660A (en) Computer-implemented system and method for allocating shares of digitally signed data
US20100082992A1 (en) Cryptographic Applications of Efficiently Evaluating Large Degree Isogenies
US20220166614A1 (en) System and method to optimize generation of coprime numbers in cryptographic applications
CN106788963A (en) A kind of full homomorphic cryptography method of identity-based on improved lattice
JP2023063430A (en) Encryption system, key generation apparatus, encryption apparatus, decryption apparatus, method, and program
Corena et al. Secure and fast aggregation of financial data in cloud-based expense tracking applications
Zhang et al. BDKM: A blockchain-based secure deduplication scheme with reliable key management
CN111798236B (en) Transaction data encryption and decryption methods, devices and equipment
Si et al. An improved RSA signature algorithm based on complex numeric operation function
JP2013130825A (en) Partial match search processing system and method
JP4922139B2 (en) Key sharing method, first device, second device, and program thereof
Al-Haija et al. Cost-effective design for binary Edwards elliptic curves crypto-processor over GF (2N) using parallel multipliers and architectures
Saju et al. Design and execution of highly adaptable elliptic curve cryptographic processor and algorithm on FPGA using Verilog HDL
Raja et al. Secure and efficient text encryption using elliptic curve cryptography
Abu Khadra et al. Towards efficient FPGA implementation of elliptic curve crypto-processor for security in IoT and embedded devices
Ciss et al. Randomness extraction in elliptic curves and secret key derivation at the end of Diffie-Hellman protocol
Panja et al. An Efficient And Secure Fingerprint Based Authentication Scheme Using Elliptic Curve Cryptography.
Do et al. Digital signature schemes from two hard problems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140402

RJ01 Rejection of invention patent application after publication