CN102063598A - Data encryption and decryption methods and devices - Google Patents

Data encryption and decryption methods and devices Download PDF

Info

Publication number
CN102063598A
CN102063598A CN2009102381702A CN200910238170A CN102063598A CN 102063598 A CN102063598 A CN 102063598A CN 2009102381702 A CN2009102381702 A CN 2009102381702A CN 200910238170 A CN200910238170 A CN 200910238170A CN 102063598 A CN102063598 A CN 102063598A
Authority
CN
China
Prior art keywords
data
positional information
information
length
pairing
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
CN2009102381702A
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.)
Peking University Founder Group Co Ltd
Beijing Founder Apabi Technology Co Ltd
Original Assignee
Peking University Founder Group Co Ltd
Beijing Founder Apabi Technology 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 Peking University Founder Group Co Ltd, Beijing Founder Apabi Technology Co Ltd filed Critical Peking University Founder Group Co Ltd
Priority to CN2009102381702A priority Critical patent/CN102063598A/en
Publication of CN102063598A publication Critical patent/CN102063598A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The invention discloses data encryption and decryption methods, which are used for locally encrypting data to improve encryption efficiency and realizing a corresponding decryption scheme. The data encryption method comprises the following steps of: receiving data in a data stream form; and in the process of receiving data, encrypting data corresponding to preset position information and length information, wherein the data to be encrypted is partial data in file data. The data decryption method comprises the following steps of: receiving data in a data stream form; and in the process of receiving the data, decrypting data corresponding to preset position information and length information, wherein the data to be decrypted is partial data in file data. The invention also discloses devices for implementing the methods.

Description

A kind of data encryption, decryption method and device
Technical field
The present invention relates to computing machine and information security field, particularly relate to data encryption, decryption method and device.
Background technology
Along with popularizing of network application, information security more and more receives publicity.Data are encrypted, and are the conventional means that improves security.
Prior art is that whole file is encrypted mostly, and especially to the encryption of picture, ciphering process relates to each pixel in the picture.More when picture number, or the size of picture is when big, and the efficient of encryption will be very low.
In recent years, the high resolving power of picture is partly encrypted have been appearred in prior art, and under situation about not being decrypted, the user can see the picture of low resolution, and just picture is not very clear.After deciphering, can obtain high-quality picture.This method has realized the partial data of picture is encrypted, but encryption method still relates to each pixel in the picture, and obtains the picture of low resolution after encrypting, and this picture still as seen.
To sum up, prior art is carried out bulk encryption to picture and is had the low problem of encryption efficiency, picture is carried out local refinement have the still visible problem of back picture of encrypting.
Summary of the invention
The embodiment of the invention provides a kind of data encryption, decryption method and device, is used to realize the local refinement to data, improves encryption efficiency, and realizes corresponding decrypt scheme.
A kind of data ciphering method may further comprise the steps:
Receive data with the data stream form;
In receiving data procedures, default positional information and the pairing data of length information are encrypted; Wherein carry out ciphered data and be the partial data in the file data.
Positional information is a plurality of; Carry out ciphered data and comprise multiple segment data.
Described positional information is generated by the position maker.
The step that default positional information and the pairing data of length information are encrypted comprises: according to the key after encrypting, default positional information and the pairing data of length information are encrypted.
A kind of data decryption method may further comprise the steps:
Receive data with the data stream form;
In receiving data procedures, default positional information and the pairing data of length information are decrypted; The data that wherein are decrypted are the partial data in the file data.
Positional information is a plurality of; The data that are decrypted comprise multiple segment data.
Described positional information is generated by the position maker identical with encrypting end.
The step that default positional information and the pairing data of length information are decrypted comprises: the key according to after encrypting is decrypted default positional information and the pairing data of length information.
A kind of encryption device comprises:
Interface module is used for receiving data with the data stream form;
Encrypting module is used for receiving data procedures default positional information and the pairing data of length information being encrypted; Wherein carry out ciphered data and be the partial data in the file data.
A kind of decryption device comprises:
Interface module is used for receiving data with the data stream form;
Deciphering module is used for receiving data procedures default positional information and the pairing data of length information being decrypted; The data that wherein are decrypted are the partial data in the file data.
The embodiment of the invention is encrypted the partial data of file, has both reached the encryption purpose, makes the content of file invisible, has avoided again whole file is encrypted the problem that is produced, and has improved encryption efficiency.And the receiving course of ciphering process and data is parallel to carry out, and has further improved encryption efficiency.Accordingly, deciphering efficient also increases.And the receiving course of decrypting process and data is parallel to carry out, and has further improved deciphering efficient.
Description of drawings
Fig. 1 is the main method process flow diagram of data encryption in the embodiment of the invention;
Fig. 2 is the detailed method process flow diagram of data encryption in the embodiment of the invention;
Fig. 3 is the main method process flow diagram of data decryption in the embodiment of the invention;
Fig. 4 is the detailed method process flow diagram of data decryption in the embodiment of the invention;
Fig. 5 is the primary structure figure of encryption device in the embodiment of the invention;
Fig. 6 is the detailed structure view of encryption device in the embodiment of the invention;
Fig. 7 is the primary structure figure of decryption device in the embodiment of the invention;
Fig. 8 is the detailed structure view of decryption device in the embodiment of the invention.
Embodiment
The embodiment of the invention is encrypted data when receiving data, and receiving course and ciphering process are carried out simultaneously, raises the efficiency.And only the partial data of file is encrypted, both reached the purpose of encrypting, make the file after the encryption invisible, shortened the encryption time again.
File in the present embodiment can be a picture file etc.Carry out ciphered data and can be any data in the file, all can reach and encrypt the sightless purpose of back file.The every algorithm that can realize that local data's (being a few bytes) encrypts all is applicable to present embodiment.
Referring to Fig. 1, the main method flow process of data encryption in the present embodiment is as follows:
Step 101: receive data with the data stream form.The process of these reception data can receive data from external unit or network, also can be reading of data from the memory device of this locality.
Step 102: in receiving data procedures, default positional information and the pairing data of length information are encrypted; Wherein carry out ciphered data and be the partial data in the file data.The length of length information indication is less than the total length of file data.
In order to improve security, positional information can be generated by the position maker, does not adopt fixing positional information.Specific implementation has multiple, can generate positional information at random as the position maker, perhaps generates positional information etc. in proper order according to default a plurality of discrete values and value.The corresponding length information of positional information, different positional informations can corresponding different length informations.Length information can be generated by the length maker.The length maker can generate length information at random, perhaps generates length information etc. in proper order according to default a plurality of discrete values and value.Because positional information and length information all can be generated by maker in the present embodiment, excessive for fear of the positional information that generates, exceed the file total length, so that can't encrypt, therefore can increase by a determining step, judge described positional information whether greater than the total length of data, and/or, judge whether total length greater than data according to positional information and length information, just last position adds whether its corresponding length exceeds the total length of data; When judgement is not, default positional information and the pairing data of length information are encrypted; When at least one is judged as when being, regenerate positional information and length information.
Introduce data encryption process in detail below by embodiment.
Referring to Fig. 2, the detailed method flow process of data encryption in the present embodiment is as follows:
Step 201: receive data with the data stream form.
Step 202: generate 24 random keys.Generate key according to the cryptographic algorithm that adopts, present embodiment adopts 24 random keys.In order to improve security, can be to re-using this secret key encryption after the secret key encryption.This key can be kept in the crypto key memory, uses during for deciphering; Perhaps adopt the algorithm identical to generate key with encrypting end by decrypting end.
Step 203: in receiving data procedures, extract default positional information and the pairing data of length information.For example, positional information is 10,30,50...... totally 32 positional informations, that is to say and need encrypt 32 segment datas that length information is 16, begins to extract data from the 10th byte of data, extracts the 10th to the 126th byte; Extract the 30th to the 46th byte then, the rest may be inferred.
Step 204: the data of extracting are encrypted according to the key that generates.According to the cryptographic algorithm that adopts, per 16 bytes are encrypted once in the present embodiment, so just can carry out one time ciphering process during 16 bytes of every extraction, realize and receive data parallel and carry out.
The ciphering process that present embodiment adopts comprises: generate 4 * 4 matrixes according to 16 bytes; Each byte in the matrix is all done the XOR computing with this time round-robin sub-key (round key), and each sub-key is produced by key generation scheme; See through a nonlinear replacement function, each byte is replaced to the byte of correspondence with the mode of look-up table; Circulating displacement is carried out in each line in the matrix.After encrypting in the present embodiment
Figure B2009102381702D0000051
Referring to Fig. 3, the main method flow process of data decryption is as follows in the present embodiment:
Step 301: receive data with the data stream form.
Step 302: in receiving data procedures, default positional information and the pairing data of length information are decrypted; The data that wherein are decrypted are the partial data in the file data.
Decrypting end needs positional information and the length information identical with encrypting end, and the decipherment algorithm corresponding with cryptographic algorithm arranged.As, decrypting end adopts position maker and the length maker identical with encrypting end.
Referring to Fig. 4, the detailed method flow process of data decryption is as follows in the present embodiment:
Step 401: receive data with the data stream form.The process of these reception data can receive data from external unit or network, also can be reading of data from the memory device of this locality.
Step 402: obtain 24 random keys identical with encrypting end.Present embodiment adopts 24 random keys.In order to improve security, can be to re-using this secret key encryption after the secret key encryption.The mode that obtains key comprise from crypto key memory obtain, by the key generator generation etc.
Step 403: in receiving data procedures, extract default positional information and the pairing data of length information.For example, positional information is 10,30,50...... totally 32 positional informations, that is to say and need be decrypted 32 segment datas that length information is 16, begins to extract data from the 10th byte of data, extracts the 10th to the 126th byte; Extract the 30th to the 46th byte then, the rest may be inferred.
Wherein, step 402 is processes independently with respect to step 401 and 403, does not have strict execution successively.
Step 404: the data of extracting are decrypted according to the key that generates.According to the decipherment algorithm that adopts, per 16 bytes deciphering once so just can carry out one time decrypting process during 16 bytes of every extraction, realizes and receives data parallel and carry out in the present embodiment.
More than be the description to data encryption flow and data decryption flow process, this process can realize that inner structure and the function to these two devices is introduced below by encryption device and decryption device.
Referring to Fig. 5, encryption device comprises in the present embodiment: interface module 501 and encrypting module 502.
Interface module 501 is used for receiving data with the data stream form.
Encrypting module 502 is used for receiving data procedures default positional information and the pairing data of length information being encrypted; Wherein carry out ciphered data and be the partial data in the file data.Concrete, encrypting module 502 extracts default positional information and the pairing data of length information and encrypts.
Encryption device also comprises: position maker 503, length maker 504, key generator 505 and storer 506 etc., and referring to shown in Figure 6.
Position maker 503 is used to generate positional information.
Length maker 504 is used to generate length information.
Key generator 505 is used to generate key.
Storer 506 is used to preserve before the encryption and various information such as file after encrypting and key.
Encryption device also can comprise verification module (this figure does not look out), be used to judge that described positional information is whether greater than the total length of data, and/or, judge whether total length greater than data according to positional information and length information, just last position adds whether its corresponding length exceeds the total length of data.When judgement was not, 502 pairs of default positional informations of encrypting module and the pairing data of length information were encrypted; When at least one is judged as when being, indicating positions maker 503 and length maker 504 regenerate positional information and length information.
Referring to Fig. 7, decryption device comprises in the present embodiment: interface module 701 and deciphering module 702.
Interface module 701 is used for receiving data with the data stream form.
Deciphering module 702 is used for receiving data procedures default positional information and the pairing data of length information being decrypted; The data that wherein are decrypted are the partial data in the file data.Concrete, deciphering module 702 extracts default positional information and the pairing data of length information and is decrypted.
Decryption device also comprises: position maker 703, length maker 704, key generator 705 and storer 706 etc., and referring to shown in Figure 8.
Position maker 703 is used to generate positional information.
Length maker 704 is used to generate length information.
Key generator 705 is used to generate key.
Storer 706 is used to preserve before the deciphering and various information such as file after the deciphering and key.
Be used to realize that the software of the embodiment of the invention can be stored in storage mediums such as floppy disk, hard disk, CD and flash memory.
The embodiment of the invention is encrypted the partial data of file, has both reached the encryption purpose, makes the content of file invisible, has avoided again whole file is encrypted the problem that is produced, and has improved encryption efficiency.And the receiving course of ciphering process and data is parallel to carry out, and has further improved encryption efficiency.Accordingly, deciphering efficient also increases.And the receiving course of decrypting process and data is parallel to carry out, and has further improved deciphering efficient.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (11)

1. a data ciphering method is characterized in that, may further comprise the steps:
Receive data with the data stream form;
In receiving data procedures, default positional information and the pairing data of length information are encrypted; Wherein carry out ciphered data and be the partial data in the file data.
2. the method for claim 1 is characterized in that, positional information is a plurality of; Carry out ciphered data and comprise multiple segment data.
3. the method for claim 1 is characterized in that, described positional information is generated by the position maker.
4. the method for claim 1, it is characterized in that, before default positional information and the pairing data of length information are encrypted, judge that described positional information is whether greater than the total length of data, and/or, judge whether total length according to positional information and length information greater than data;
When being judged as not, default positional information and the pairing data of length information are encrypted.
5. the method for claim 1 is characterized in that, the step that default positional information and the pairing data of length information are encrypted comprises: according to the key after encrypting, default positional information and the pairing data of length information are encrypted.
6. a data decryption method is characterized in that, may further comprise the steps:
Receive data with the data stream form;
In receiving data procedures, default positional information and the pairing data of length information are decrypted; The data that wherein are decrypted are the partial data in the file data.
7. method as claimed in claim 6 is characterized in that, positional information is a plurality of; The data that are decrypted comprise multiple segment data.
8. method as claimed in claim 6 is characterized in that, described positional information is generated by the position maker identical with encrypting end.
9. method as claimed in claim 6 is characterized in that, the step that default positional information and the pairing data of length information are decrypted comprises: the key according to after encrypting is decrypted default positional information and the pairing data of length information.
10. an encryption device is characterized in that, comprising:
Interface module is used for receiving data with the data stream form;
Encrypting module is used for receiving data procedures default positional information and the pairing data of length information being encrypted; Wherein carry out ciphered data and be the partial data in the file data.
11. a decryption device is characterized in that, comprising:
Interface module is used for receiving data with the data stream form;
Deciphering module is used for receiving data procedures default positional information and the pairing data of length information being decrypted; The data that wherein are decrypted are the partial data in the file data.
CN2009102381702A 2009-11-17 2009-11-17 Data encryption and decryption methods and devices Pending CN102063598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009102381702A CN102063598A (en) 2009-11-17 2009-11-17 Data encryption and decryption methods and devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009102381702A CN102063598A (en) 2009-11-17 2009-11-17 Data encryption and decryption methods and devices

Publications (1)

Publication Number Publication Date
CN102063598A true CN102063598A (en) 2011-05-18

Family

ID=43998868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009102381702A Pending CN102063598A (en) 2009-11-17 2009-11-17 Data encryption and decryption methods and devices

Country Status (1)

Country Link
CN (1) CN102063598A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402670A (en) * 2011-08-03 2012-04-04 广东欧珀移动通信有限公司 File encryption and decryption method
CN102739406A (en) * 2012-07-17 2012-10-17 飞天诚信科技股份有限公司 Method for securely transmitting equipment information
CN103164657A (en) * 2011-08-30 2013-06-19 三星电子株式会社 Computing system and method of operating computing system
CN103294961A (en) * 2013-06-07 2013-09-11 北京奇虎科技有限公司 Method and device for file encrypting/decrypting
CN105634727A (en) * 2015-12-31 2016-06-01 江苏小牛电动科技有限公司 Cloud service data encryption and decryption methods and apparatus for electric vehicle
CN105635150A (en) * 2015-12-31 2016-06-01 宇龙计算机通信科技(深圳)有限公司 Encryption method, decryption method, device thereof and terminal thereof
CN105790925A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Data encryption method, data decryption method, data encryption device and data decryption device
CN105791243A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Encryption transmission method and device and decryption playing method and device of multimedia file
CN106133745A (en) * 2014-03-26 2016-11-16 阿尔卡特朗讯公司 The anonymization of flow data
CN107241185A (en) * 2016-03-29 2017-10-10 百度在线网络技术(北京)有限公司 Data transmitting and receiving method and transmission and reception device
CN107786331A (en) * 2017-09-28 2018-03-09 平安普惠企业管理有限公司 Data processing method, device, system and computer-readable recording medium
CN109480818A (en) * 2017-09-12 2019-03-19 中国移动通信有限公司研究院 A kind of physiological data signals treating method and apparatus across hardware platform

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402670A (en) * 2011-08-03 2012-04-04 广东欧珀移动通信有限公司 File encryption and decryption method
US9940265B2 (en) 2011-08-30 2018-04-10 Samsung Electronics Co., Ltd. Computing system and method of operating computing system
CN103164657A (en) * 2011-08-30 2013-06-19 三星电子株式会社 Computing system and method of operating computing system
CN102739406B (en) * 2012-07-17 2014-12-10 飞天诚信科技股份有限公司 Method for securely transmitting equipment information
CN102739406A (en) * 2012-07-17 2012-10-17 飞天诚信科技股份有限公司 Method for securely transmitting equipment information
CN103294961A (en) * 2013-06-07 2013-09-11 北京奇虎科技有限公司 Method and device for file encrypting/decrypting
CN106133745A (en) * 2014-03-26 2016-11-16 阿尔卡特朗讯公司 The anonymization of flow data
CN105790925A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Data encryption method, data decryption method, data encryption device and data decryption device
CN105791243A (en) * 2014-12-24 2016-07-20 北京奇虎科技有限公司 Encryption transmission method and device and decryption playing method and device of multimedia file
CN105634727B (en) * 2015-12-31 2019-01-18 江苏小牛电动科技有限公司 A kind of cloud service data encryption, decryption method and the device of electric vehicle
CN105635150A (en) * 2015-12-31 2016-06-01 宇龙计算机通信科技(深圳)有限公司 Encryption method, decryption method, device thereof and terminal thereof
CN105634727A (en) * 2015-12-31 2016-06-01 江苏小牛电动科技有限公司 Cloud service data encryption and decryption methods and apparatus for electric vehicle
CN105635150B (en) * 2015-12-31 2019-06-11 宇龙计算机通信科技(深圳)有限公司 Encryption method, decryption method and its device and terminal
CN107241185A (en) * 2016-03-29 2017-10-10 百度在线网络技术(北京)有限公司 Data transmitting and receiving method and transmission and reception device
CN109480818A (en) * 2017-09-12 2019-03-19 中国移动通信有限公司研究院 A kind of physiological data signals treating method and apparatus across hardware platform
CN107786331A (en) * 2017-09-28 2018-03-09 平安普惠企业管理有限公司 Data processing method, device, system and computer-readable recording medium
CN107786331B (en) * 2017-09-28 2020-03-17 平安普惠企业管理有限公司 Data processing method, device, system and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN102063598A (en) Data encryption and decryption methods and devices
CN108023724B (en) Data transmission method and device
CN100468438C (en) Encryption and decryption method for realizing hardware and software binding
CN103067170B (en) encrypting method based on EXT2 file system
KR102383829B1 (en) Cryptographic method for securely exchanging messages and device and system for implementing this method
CN105324956A (en) Method and apparatus to encrypt plaintext data
CN102880836A (en) Security device
CN103488915B (en) The resource encryption decryption method of the double secret key encryption that a kind of software and hardware combines
CN111625791B (en) Key management method and system based on software cryptographic module
CN102904712A (en) Information encrypting method
CN102014266A (en) Digital watermarking-based high-definition video encrypted transmitting method and system
CN111404953A (en) Message encryption method, message decryption method, related devices and related systems
CN102594549B (en) Multistage data encryption and decryption methods
CN103544453A (en) USB (universal serial bus) KEY based virtual desktop file protection method and device
CN111431917B (en) Upgrade package encryption method and device and upgrade package decryption method and device
CN103117850A (en) Cryptosystem based on random sequence database
CN103501220A (en) Encryption method and device
CN103605919A (en) Method and device for generating software authentication files and method and device for authenticating software
CN104954362A (en) Serial number encryption-decryption method and device
CN102546152B (en) Method for achieving multi-stage encryption and decryption of data
CN102546151A (en) Data encryption and decryption method
JP6167721B2 (en) ENCRYPTION DEVICE, DECRYPTION DEVICE, ENCRYPTION METHOD, DECRYPTION METHOD, AND PROGRAM
US20160359620A1 (en) Method and system for remotely keyed encrypting/decrypting data with prior checking a token
CN111314052B (en) Data encryption and decryption method
CN106454435B (en) Conditional access method and related equipment and system

Legal Events

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

Application publication date: 20110518