[go: up one dir, main page]

CN102546152B - Method for achieving multi-stage encryption and decryption of data - Google Patents

Method for achieving multi-stage encryption and decryption of data Download PDF

Info

Publication number
CN102546152B
CN102546152B CN201210078372.7A CN201210078372A CN102546152B CN 102546152 B CN102546152 B CN 102546152B CN 201210078372 A CN201210078372 A CN 201210078372A CN 102546152 B CN102546152 B CN 102546152B
Authority
CN
China
Prior art keywords
data
deciphering
encryption
data segment
order
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.)
Active
Application number
CN201210078372.7A
Other languages
Chinese (zh)
Other versions
CN102546152A (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.)
Shandong Taixin Electronics Co Ltd
Original Assignee
Shandong Taixin Electronics Co 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 Shandong Taixin Electronics Co Ltd filed Critical Shandong Taixin Electronics Co Ltd
Priority to CN201210078372.7A priority Critical patent/CN102546152B/en
Publication of CN102546152A publication Critical patent/CN102546152A/en
Application granted granted Critical
Publication of CN102546152B publication Critical patent/CN102546152B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses a method for achieving multi-stage encryption and decryption of data, which includes that S101 an encryption module receives an encryption root secret key and data to be encrypted; S102 the encryption module analyzes the data to be encrypted, obtains length, encryption algorithm, encryption order and encryption data of each data segment and divides the data to be encrypted into a plurality of data segments; S103 the method judges whether the number of the data segments is larger than 1, if the number is larger than 1, S105 is conducted, otherwise, S104 is conducted; S104, the encryption root secret key is utilized to conduct encryption on the data to be encrypted; S105 the encryption root secret key is utilized to conduct encryption on a first encryption order data segment; S106 the data segments with front encryption order are sequentially utilized to conduct encryption on the data segments with back encryption order; S107 the method judges whether all the data segments finish encryption, if the data segments finish encryption, S108 is conducted, if not, S 106 is conducted; S108 encryption results of the data segments are combined and output according to orders of the data segments in the data to be encrypted. The method has the advantages of being high in safety, convenient to achieve and the like.

Description

A kind of method that realizes data multilevel encryption, deciphering
Technical field
The invention belongs to data security field, relate in particular to a kind of method that data multilevel is encrypted, deciphered that realizes.
Background technology
Along with the fast development of information technology and network technology, it is more and more important that data security becomes.Data security mainly refers to the safety of data itself and the safety of transfer of data.Data transmission security refers to that data must guarantee the fail safe of data in transmitting procedure, integrality and can not tamper.Data encryption is acknowledged as the effective ways of method and the protection storage data security of the only practicality of protected data transmission security, is data protection most important defence line technically.Data encryption refers to according to specific cryptographic algorithm and key responsive clear data is transformed into impalpable encrypt data.When needed, can use with encrypting corresponding cryptographic algorithm and key encrypt data is reduced into clear data, be i.e. data deciphering.By at transmitting terminal, data being encrypted, at receiving terminal, the encrypt data of receiving is decrypted, can ensure the fail safe of data in transmitting procedure.
At present, for the data of transmission, transmitting terminal mostly adopts once and encrypts, and receiving terminal is once deciphered the data that can obtain wanting to the ciphertext of receiving, can guarantee data security to a certain extent like this, can reduce again encryption, decrypting process.But owing to only data once being encrypted, Information Security is lower, hacker or malicious attacker be probably by the ciphertext of intercepting and capturing is cracked, and then obtain data expressly, causes data security hidden danger.In addition, even if the scheme that has pair data repeatedly to encrypt is at present also generally the encryption of employing fixed number of times, in the time that needs change encryption number of times, just need to change encrypting module, also need to change corresponding deciphering module, realize complexity, cost is high simultaneously.
Summary of the invention
The present invention be exactly for solve the data single cryptographic security existing in prior art low, repeatedly encrypt complicated etc. the problem that realizes, propose one and realized data multilevel encryption, decryption method, it can be realized data are repeatedly encrypted, and can be in the situation that not changing encrypting module and deciphering module, change encryption number of times, the cryptographic algorithm to data and encrypt order, improved the fail safe of data, it is convenient to realize, and complexity is low.
To achieve these goals, the present invention adopts following technical scheme:
Realize the method that data multilevel is encrypted, its step is:
S101: encrypting module receives the data of encrypting root key and will encrypt;
S102: encrypting module is resolved the data that will encrypt, ready-portioned multiple data segment in the data that acquisition will be encrypted, wherein each data segment is by encrypting descriptor and data message forms, the length of this data segment data message that each data segment encryption descriptor at least comprises, the cryptographic algorithm that this data segment adopts and encryption order information, the data message that encryption order comes last data segment is desired data;
S103: judge that whether the number of resolving the data segment obtaining is greater than 1, if so, performs step S105; Otherwise, execution step S104;
S104: data segment number is 1, according to the cryptographic algorithm of this data segment, with encrypt root key to the data message of this data segment and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained with describe the data after encrypting with the deciphering descriptor combination of this enciphered data relevant information and export;
S105: according to the cryptographic algorithm of the first encryption order data segment, with encrypt root key to the data message of the first encryption order data segment and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result of the first encryption order data segment;
S106: successively according to encrypting the cryptographic algorithm of encrypting the posterior data segment of order in two data segments that order is adjacent, utilize the data message encrypted in order preceding data segment or full detail as encryption key to the data message of the posterior data segment of described encryption order and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result of the posterior data segment of described encryption order;
S107: judge that whether all data segments have all completed encryption, if so, perform step S108; Otherwise, execution step S106;
S108: the precedence in the data that will encrypt combines the data output after encrypting successively according to each data segment using the encrypted result of each data segment.
Described deciphering descriptor at least comprises decipherment algorithm corresponding to the cryptographic algorithm of encrypting the length of the enciphered data that obtains, use while encrypting with this enciphered data, the deciphering order corresponding with this enciphered data encryption order.
Described encrypting module is at least supported a kind of cryptographic algorithm in AES, 3DES, SMS4.
A method that realizes data multilevel deciphering, its step is:
S201: deciphering module receiving and deciphering root key and data to be decrypted;
S202: deciphering module is resolved data to be decrypted, obtain deciphering descriptor and the enciphered data of wanting each data segment in data decryption, deciphering descriptor at least comprises decipherment algorithm and the deciphering order information of the enciphered data of length, this data segment of the enciphered data of this data segment, and then deciphering module is divided into multiple data segments according to the length of the enciphered data of each data segment by data to be decrypted;
S203: judge that whether data segment number is greater than 1, if so, performs step S205; Otherwise, execution step S204;
S204: data hop count is 1, according to the decipherment algorithm of this data segment, utilizes deciphering root key to be decrypted the enciphered data in data segment, the data after output deciphering;
S205: according to the decipherment algorithm of the first deciphering order data segment, utilize deciphering root key to be decrypted the enciphered data of the first deciphering order data segment, obtain decrypted result;
S206: successively according to the decipherment algorithm of deciphering the posterior data segment of order in two adjacent data segments of deciphering order, utilize data division corresponding to encryption key that enciphered data uses that generate when encrypting in the decrypted result of deciphering order preceding data segment as decruption key, the enciphered data in the posterior data segment of described deciphering order to be decrypted, obtain the decrypted result of the posterior data segment of described deciphering order;
S207: judge that whether all data segments have all completed deciphering, if so, perform step S208; Otherwise, execution step S206;
S208: the data of output deciphering order after the decrypted result of last data segment is as deciphering.
Described deciphering module is at least supported a kind of algorithm in AES, 3DES, SMS4.
The invention has the beneficial effects as follows: the present invention describes this data segment, length, cryptographic algorithm and encrypts order information by increasing before the valid data of wanting the each data segment in enciphered data, having realized every segment data all can adopt different algorithms to be encrypted, and the encryption order of every segment data is unfixing, the fail safe that has improved data; Need to changing the cryptographic algorithm of each data segment and encrypting when order, without change encrypting module and deciphering module, only need to describe before change data segment the information of this data segment, have safely, realize convenient, flexiblely, complexity is low, is easy to the advantages such as expansion.
Brief description of the drawings
Fig. 1 is encrypting module connection diagram;
Fig. 2 is the schematic flow sheet that data multilevel is encrypted of realizing of the present invention;
Fig. 3 is the data structure schematic diagram that will encrypt;
Fig. 4 is the structural representation of each data segment in the data that will encrypt;
Fig. 5 is deciphering module connection diagram;
Fig. 6 is the structural representation of data to be decrypted;
Fig. 7 is the structural representation of each data segment in data to be decrypted;
Fig. 8 is the schematic flow sheet of realizing data multilevel deciphering of the present invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment, the present invention will be further described.
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and illustrated embodiment of the present invention and explanation thereof are used for explaining the present invention, and improper restriction of the present invention not in pairs.
As shown in Figure 1, encrypting module receives and encrypts root key and the data input that will encrypt, the data after output is encrypted.
As shown in Figure 2, the data that encrypt are made up of the multiple data segments that will encrypt.
As shown in Figure 3, the each data segment that will encrypt, by encrypting descriptor and data message forms, wherein, is encrypted descriptor and is at least comprised the length of this data segment data message, the encryption order that this data segment will adopt cryptographic algorithm and this data segment.
As shown in Figure 4, realize the method that data multilevel is encrypted, its step is:
S101: encrypting module receives the data DATA that encrypts root key RKEY and will encrypt;
S102: encrypting module is resolved the data DATA that will encrypt, obtain a ready-portioned n data segment in DATA, wherein, each data segment is by encrypting descriptor and data message forms, the encryption descriptor of each data segment at least comprises the length of this data segment data message, the cryptographic algorithm of this each segment data employing and the encryption order of this each segment data, and the data message that encryption order comes in last data segment is desired data;
S103: judge that whether the number n that resolves the data segment obtaining is greater than 1, if so, performs step S105; Otherwise, execution step S104;
S104: data segment number is 1, the cryptographic algorithm adopting according to this data segment, data message in the data DATA that will encrypt data segment with encryption root key RKEY and at least one of encrypting in descriptor are encrypted, the enciphered data that encryption is obtained and the deciphering descriptor combination of describing this enciphered data relevant information, as the data EDATA output after encrypting;
S105: the encryption order of the each data segment obtaining according to parsing, is labeled as D successively by each data segment 1..., D n, wherein n is greater than 1 natural number, according to the first encryption order data segment D 1cryptographic algorithm, with encrypting root key RKEY to the first encryption order data segment D 1in data message and at least one of encrypting in descriptor be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result ED of the first encryption order data segment 1;
S106: according to encrypting the posterior data segment D of order m+1cryptographic algorithm, utilize and encrypt order preceding data segment D min data message or full detail as encryption key to encrypting order posterior data segment D m+1in data message and at least one of encrypting in descriptor be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result ED of the posterior data segment of encryption order m+1, wherein m is more than or equal to 1 and be less than the natural number of n;
S107: judge that whether all data segments have all completed encryption, if so, perform step S108; Otherwise m value increases by 1, execution step S106;
S108: by each data segment D 1..., D nencrypted result ED 1..., ED nafter combining successively, precedence according to each data segment in the data that will encrypt exports as the data EDATA after encrypting.
Described deciphering descriptor at least comprises decipherment algorithm corresponding to the cryptographic algorithm of encrypting the length of the enciphered data that obtains, use while encrypting with this enciphered data, the deciphering order corresponding with this enciphered data encryption order.
Described encrypting module is at least supported a kind of cryptographic algorithm in AES, 3DES, SMS4.
As shown in Figure 5, deciphering module receives data to be decrypted EDATA and conciliates heave root key RKEY input, exports the data after deciphering.
As shown in Figure 6, data to be decrypted is made up of multiple data to be decrypted sections.
As shown in Figure 7, data to be decrypted section is by deciphering descriptor and enciphered data forms, and wherein, deciphering descriptor at least comprises the length of enciphered data in this data segment, decipherment algorithm that this data segment adopts and the deciphering order of this data segment.
As shown in Figure 8, realize the method for data multilevel deciphering, its step is:
S201: deciphering module receiving and deciphering root key RKEY and data to be decrypted EDATA;
S202: deciphering module is resolved data to be decrypted EDATA, obtain deciphering descriptor and the enciphered data of each data segment in EDATA, deciphering descriptor at least comprises decipherment algorithm and the deciphering order information of the enciphered data of length, this data segment of the enciphered data of this data segment, and then deciphering module is divided into n data segment according to the length of the enciphered data of each data segment by data to be decrypted EDATA;
S203: judge that whether data segment number n is greater than 1, if so, performs step S205; Otherwise, execution step S204;
S204: data hop count is 1, is the decipherment algorithm of data to be decrypted EDATA according to this data segment, utilizes deciphering root key RKEY to be decrypted the enciphered data in data segment, the data DATA after output deciphering;
S205: the deciphering order of the each data segment obtaining according to parsing, is labeled as ED successively by each data segment 1..., ED n, wherein, n is greater than 1 natural number, according to the first deciphering order data segment ED 1decipherment algorithm, utilize deciphering root key RKEY to the first deciphering order data segment ED 1in enciphered data be decrypted, obtain D 1, m=1 is set;
S206: according to the posterior data segment ED of deciphering order m+1decipherment algorithm, utilize deciphering order preceding data segment ED mdecrypted result D min generate when encrypting data division corresponding to encryption key that enciphered data uses as decruption key to the posterior data segment ED of deciphering order m+1in enciphered data be decrypted, obtain D m+1;
S207: judge that whether all data segments have all completed deciphering, if so, perform step S208; Otherwise m value increases by 1, execution step S206;
S208: output deciphering order is at last data segment ED ndecrypted result D n, i.e. data DATA after deciphering.
Described deciphering module is at least supported a kind of algorithm in AES, 3DES, SMS4.
Above-described embodiment is of the present inventionly more preferably to select, other embodiment that modifies on basis of the present invention or expand, and relevant technical staff in the field can be easy to expect and realize, the present invention repeats no more.

Claims (3)

1. realize the method that data multilevel is encrypted, it is characterized in that, its step is:
S101: encrypting module receives the data of encrypting root key and will encrypt;
S102: encrypting module is resolved the data that will encrypt, ready-portioned multiple data segment in the data that acquisition will be encrypted, wherein each data segment is by encrypting descriptor and data message forms, the length of this data segment data message that each data segment encryption descriptor at least comprises, the cryptographic algorithm that this data segment adopts and encryption order information, the data message that encryption order comes last data segment is desired data;
S103: judge that whether the number of resolving the data segment obtaining is greater than 1, if so, performs step S105; Otherwise, execution step S104;
S104: data segment number is 1, according to the cryptographic algorithm of this data segment, with encrypt root key to the data message of this data segment and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained is exported with the data of the deciphering descriptor combination of describing this enciphered data relevant information after encrypting;
S105: according to the cryptographic algorithm of the first encryption order data segment, with encrypt root key to the data message of the first encryption order data segment and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result of the first encryption order data segment;
S106: successively according to encrypting the cryptographic algorithm of encrypting the posterior data segment of order in two data segments that order is adjacent, utilize the data message encrypted in order preceding data segment or full detail as encryption key to the data message of the posterior data segment of described encryption order and encrypt in descriptor at least one be encrypted, the enciphered data that encryption is obtained with the deciphering descriptor combination of this enciphered data relevant information is described as the encrypted result of the posterior data segment of this encryption order;
S107: judge that whether all data segments have all completed encryption, if so, perform step S108; Otherwise, execution step S106;
S108: the precedence in the data that will encrypt combines the data output after encrypting successively according to each data segment using the encrypted result of each data segment;
Described deciphering descriptor at least comprises decipherment algorithm corresponding to the cryptographic algorithm of encrypting the length of the enciphered data that obtains, use while encrypting with this enciphered data, the deciphering order corresponding with this enciphered data encryption order.
2. the method that realizes data multilevel encryption as claimed in claim 1, is characterized in that, described encrypting module is at least supported a kind of cryptographic algorithm in AES, 3DES, SMS4.
3. a method that realizes data multilevel deciphering, is characterized in that, its step is:
S201: deciphering module receiving and deciphering root key and data to be decrypted;
S202: deciphering module is resolved data to be decrypted, obtain deciphering descriptor and the enciphered data of wanting each data segment in data decryption, deciphering descriptor at least comprises decipherment algorithm and the deciphering order information of the enciphered data of length, this data segment of the enciphered data of this data segment, and then deciphering module is divided into multiple data segments according to the length of the enciphered data of each data segment by data to be decrypted;
S203: judge that whether data segment number is greater than 1, if so, performs step S205; Otherwise, execution step S204;
S204: data hop count is 1, according to the decipherment algorithm of this data segment, utilizes deciphering root key to be decrypted the enciphered data in data segment, the data after output deciphering;
S205: according to the decipherment algorithm of the first deciphering order data segment, utilize deciphering root key to be decrypted the enciphered data of the first deciphering order data segment, obtain decrypted result;
S206: successively according to the decipherment algorithm of deciphering the posterior data segment of order in two adjacent data segments of deciphering order, utilize data division corresponding to encryption key that enciphered data uses that generate when encrypting in the decrypted result of deciphering order preceding data segment as decruption key, the enciphered data in the posterior data segment of described deciphering order to be decrypted, obtain the decrypted result of the posterior data segment of described deciphering order;
S207: judge that whether all data segments have all completed deciphering, if so, perform step S208; Otherwise, execution step S206;
S208: the data of output deciphering order after the decrypted result of last data segment is as deciphering;
Described deciphering module is at least supported a kind of algorithm in AES, 3DES, SMS4.
CN201210078372.7A 2012-03-22 2012-03-22 Method for achieving multi-stage encryption and decryption of data Active CN102546152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210078372.7A CN102546152B (en) 2012-03-22 2012-03-22 Method for achieving multi-stage encryption and decryption of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210078372.7A CN102546152B (en) 2012-03-22 2012-03-22 Method for achieving multi-stage encryption and decryption of data

Publications (2)

Publication Number Publication Date
CN102546152A CN102546152A (en) 2012-07-04
CN102546152B true CN102546152B (en) 2014-11-05

Family

ID=46352175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210078372.7A Active CN102546152B (en) 2012-03-22 2012-03-22 Method for achieving multi-stage encryption and decryption of data

Country Status (1)

Country Link
CN (1) CN102546152B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594548A (en) * 2012-03-22 2012-07-18 山东泰信电子有限公司 Method capable of achieving data sectional encryption and decryption

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106685635B (en) * 2015-11-07 2019-10-18 上海复旦微电子集团股份有限公司 Method of calibration of circling round and device
KR20210028422A (en) * 2019-09-04 2021-03-12 삼성전자주식회사 Electorinc apparatus and control method thereof
CN111654511A (en) * 2020-07-13 2020-09-11 中国银行股份有限公司 Chained data encryption method, chained data decryption method and corresponding systems

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1938980A (en) * 2004-02-13 2007-03-28 Ivi斯马特技术公司 Method and apparatus for cryptographically processing data
CN101401105A (en) * 2006-04-18 2009-04-01 国际商业机器公司 Encryption apparatus and method for providing an encrypted file system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1938980A (en) * 2004-02-13 2007-03-28 Ivi斯马特技术公司 Method and apparatus for cryptographically processing data
CN101401105A (en) * 2006-04-18 2009-04-01 国际商业机器公司 Encryption apparatus and method for providing an encrypted file system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594548A (en) * 2012-03-22 2012-07-18 山东泰信电子有限公司 Method capable of achieving data sectional encryption and decryption
CN102594548B (en) * 2012-03-22 2015-06-10 山东泰信电子股份有限公司 Method capable of achieving data sectional encryption and decryption

Also Published As

Publication number Publication date
CN102546152A (en) 2012-07-04

Similar Documents

Publication Publication Date Title
CN102594548B (en) Method capable of achieving data sectional encryption and decryption
CN102594549B (en) Multistage data encryption and decryption methods
CN101753292B (en) Methods and devices for a chained encryption mode
CN101447870B (en) A private key secure storage method based on distributed password technology
CN103905187B (en) A kind of network service encryption method based on content
CN102447698B (en) Encrypting and transmitting method for network communication information
US20170272239A1 (en) Authentication encryption method, authentication decryption method, and information-processing device
CN105681025A (en) Security white box realizing method and device for national cipher standard algorithm SM4
CN105763315A (en) Data encryption and decryption method and apparatus thereof, and communication system
KR101608815B1 (en) Method and system for providing service encryption in closed type network
CN102664740B (en) Remote-authorization-based bidding document encryption and decryption method
CN103716157A (en) Grouped multiple-key encryption method and grouped multiple-key encryption device
CN103152362B (en) Based on the large data files encrypted transmission method of cloud computing
CN107332657A (en) A kind of encryption method and system based on block chain digital signature
CN102223309A (en) Safe communication system and implementation method based on message load segmentation, encryption and reorder
CN105871549A (en) Digital signal encryption processing method
CN101001142A (en) Encipher-decipher method based on iterative random number generator
CN102546152B (en) Method for achieving multi-stage encryption and decryption of data
CN102546151A (en) Data encryption and decryption method
Sarkar et al. A survey on the advanced encryption standard (AES): a pillar of modern cryptography
CN107659405A (en) The encrypting and decrypting method that data communicate between a kind of transformer station boss station
US20150263858A1 (en) Method and device for digital data blocks encryption and decryption
US7773753B2 (en) Efficient remotely-keyed symmetric cryptography for digital rights management
CN101710964A (en) Method for enciphering and deciphering MPEG2 transport stream packets
Nissar et al. Implementation of security enhancement in AES by inducting dynamicity in AES s-box

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: Xinluo Avenue high tech Zone of Ji'nan City, Shandong province 250101 silver bearing No. 2008 building 1-501-1

Applicant after: Shandong Taixin Electronics Co., Ltd.

Address before: Xinluo Avenue high tech Zone of Ji'nan City, Shandong province 250101 silver bearing No. 2008 building 1-501-1

Applicant before: Shandong Taixin Electronics Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: SHANDONG TAIXIN ELECTRONICS CO., LTD. TO: SHANDONG TAIXIN ELECTRONIC CO.,LTD.

C14 Grant of patent or utility model
GR01 Patent grant