CN109308420A - A kind of data ciphering method, terminal device and computer readable storage medium - Google Patents
A kind of data ciphering method, terminal device and computer readable storage medium Download PDFInfo
- Publication number
- CN109308420A CN109308420A CN201810965583.XA CN201810965583A CN109308420A CN 109308420 A CN109308420 A CN 109308420A CN 201810965583 A CN201810965583 A CN 201810965583A CN 109308420 A CN109308420 A CN 109308420A
- Authority
- CN
- China
- Prior art keywords
- data
- preset quantity
- sub
- codomain
- clear data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
Abstract
This application discloses a kind of data ciphering method, terminal device and computer readable storage mediums, are applied to technical field of information encryption, and wherein data ciphering method includes: acquisition text data, and text data includes multiple characters;Each character in text data is converted into multilevel sequence, to obtain clear data;Obtain extension codomain;Clear data is mapped to extension codomain using mapping function;It obtains clear data and is mapped to obtained growth data after extension codomain;Computations are carried out to growth data, to obtain encryption data.Clear data is mapped to extension codomain using mapping function by the application, then computations are carried out to obtain encryption data to the growth data that mapping obtains again, wherein mapping process can make the data distribution difference of growth data and the data distribution of clear data.The original data distribution of clear data can be hidden by then passing through the present processes, prevented the leakage of data in retrieving, improved the safety of data.
Description
Technical field
This application involves field of information security technology more particularly to a kind of data ciphering methods, terminal device and computer
Readable storage medium storing program for executing.
Background technique
The encryption containing specified content is found out when the content of user query encryption file, or in a lot of encryption files
When file, after often encryption file can only be decrypted, the plaintext that could be obtained to decryption is retrieved, this retrieval
Method very takes time and effort.
In order to improve effectiveness of retrieval, there are many search methods, and the retrieval to encryption file may be implemented at present, such as equivalent
Retrieval, range retrieval and fuzzy search etc., so that encryption file is in an encrypted state, content still can be retrieved.
Existing search method although substantially increase encryption file recall precision, but these search methods be all based on it is bright
The retrieval technique of text, i.e., either user query when the keyword or server database submitted in data information be all
It is provided with plaintext version.Then malicious server can exist according to the search key and keyword of multiple users of monitoring
The position in file is encrypted to deduce the entire contents of encryption file.
Therefore, existing data ciphering method may cause in encryption file progress retrieving there is no consideration
Information leakage problem, safety are lower.
Summary of the invention
The embodiment of the present application provides a kind of data ciphering method, can hide the data distribution of clear data, to prevent from retrieving
Leakage of data in the process improves the safety of data.
In a first aspect, the embodiment of the present application provides a kind of data ciphering method, which includes:
Clear data is obtained, the clear data includes multiple multilevel sequences;
Extension codomain is obtained, the extension codomain is equal or different to the codomain of the multilevel sequence;
The clear data is mapped to the extension codomain using mapping function, it is multiple in the clear data to change
Arrangement position between multilevel sequence, and/or each multilevel sequence is mapped as a variety of multilevel sequences;
It obtains the clear data and is mapped to obtained growth data after the extension codomain;
Computations are carried out to the growth data, to obtain encryption data.
With reference to first aspect, described to utilize mapping function by the plaintext in the first implementation of first aspect
Data are mapped to the extension codomain, comprising:
The clear data is divided into the sub- clear data of preset quantity;
The mapping function for obtaining the preset quantity, by the son of the mapping function of the preset quantity and the preset quantity
Clear data corresponds;
The sub- clear data of the preset quantity is respectively mapped to the expansion using the mapping function of the preset quantity
It opens up in codomain, to obtain the sub- growth data of the preset quantity;
The sub- growth data of the preset quantity is integrated, be expanded data.
With reference to first aspect, described to utilize mapping function by the plaintext in second of implementation of first aspect
Data are mapped to the extension codomain, comprising:
The clear data is divided into the sub- clear data of preset quantity;
By the expanding value regional partition at the son extension codomain of the preset quantity;
The mapping function for obtaining the preset quantity, by the son of the mapping function of the preset quantity and the preset quantity
Clear data corresponds;
The sub- clear data of the preset quantity is respectively mapped to using the mapping function of the preset quantity described pre-
If obtaining the sub- growth data of the preset quantity in the son extension codomain of quantity;
The sub- growth data of the preset quantity is integrated, be expanded data.
Second of implementation with reference to first aspect, it is described to utilize institute in the third implementation of first aspect
The mapping function for stating preset quantity extends the son that the sub- clear data of the preset quantity is respectively mapped to the preset quantity
In codomain, comprising:
The sub- clear data of the preset quantity is sequentially corresponded to the son extension codomain of the preset quantity one by one;It utilizes
The mapping function of the preset quantity expands the son that the sub- clear data of the preset quantity is respectively mapped to the preset quantity
Open up codomain;Or
By the sub- clear data of the preset quantity, the out-of-order son for corresponding to the preset quantity extends codomain one by one;It utilizes
The mapping function of the preset quantity expands the son that the sub- clear data of the preset quantity is respectively mapped to the preset quantity
Open up codomain.
The third implementation with reference to first aspect, in the 4th implementation of first aspect, described in the integration
The sub- growth data of preset quantity, comprising:
According to the sequence of the sub- clear data of the preset quantity, the sub- growth data is integrated;Or
The sub- growth data is integrated according to random sequence.
Second aspect, the embodiment of the present application provide a kind of terminal device, which includes for executing above-mentioned
The unit of the data ciphering method of one side, the terminal device include:
Acquiring unit, for obtaining clear data, the clear data includes multiple multilevel sequences;It is also used to obtain expansion
Codomain is opened up, the extension codomain is equal or different to the codomain of the multilevel sequence;It is also used to obtain the clear data to reflect
It is mapped to obtained growth data after the extension codomain;
Map unit, for the clear data to be mapped to the extension codomain using mapping function, described in changing
Arrangement position in clear data between multiple multilevel sequences, and/or each multilevel sequence is mapped as a variety of multi-systems
Sequence;
Encryption unit, for carrying out computations to the growth data, to obtain encryption data.
In conjunction with second aspect, in the first implementation of second aspect:
Cutting unit, for the clear data to be divided into the sub- clear data of preset quantity;
The acquiring unit is also used to obtain the mapping function of the preset quantity;
Corresponding unit, for the mapping function of the preset quantity and the sub- clear data of the preset quantity one is a pair of
It answers;
The map unit, for utilizing the mapping function of the preset quantity by the sub- clear data of the preset quantity
It is respectively mapped in the extension codomain, to obtain the sub- growth data of the preset quantity;
Integral unit, for integrating the sub- growth data of the preset quantity, be expanded data.
In conjunction with second aspect, in second of implementation of second aspect:
Cutting unit, for the clear data to be divided into the sub- clear data of preset quantity;It is also used to the expansion
Exhibition codomain is divided into the son extension codomain of the preset quantity;
The acquiring unit is also used to obtain the mapping function of the preset quantity;
Corresponding unit, for the mapping function of the preset quantity and the sub- clear data of the preset quantity one is a pair of
It answers;
The map unit, for utilizing the mapping function of the preset quantity by the sub- clear data of the preset quantity
It is respectively mapped in the son extension codomain of the preset quantity, obtains the sub- growth data of the preset quantity;
Integral unit, for integrating the sub- growth data of the preset quantity, be expanded data.
In conjunction with second of implementation of second aspect, in the third implementation of second aspect:
The corresponding unit is also used to the sub- clear data of the preset quantity sequentially corresponding to the present count one by one
The son extension codomain of amount;Correspondingly, the map unit, being also used to will be described default using the mapping function of the preset quantity
The sub- clear data of quantity is respectively mapped to the son extension codomain of the preset quantity;Or
The corresponding unit, is also used to that random ordering corresponds to the present count one by one by the sub- clear data of the preset quantity
The son extension codomain of amount;Correspondingly, the map unit, being also used to will be described default using the mapping function of the preset quantity
The sub- clear data of quantity is respectively mapped to the son extension codomain of the preset quantity.
In conjunction with the third implementation of second aspect, in the 4th kind of implementation of second aspect:
The integral unit integrates the sub- expansion specifically for the sequence of the sub- clear data according to the preset quantity
Open up data;Alternatively, integrating the sub- growth data according to random sequence.
The third aspect, the embodiment of the present application provide another terminal device, including processor and memory, the processing
Device and memory are connected with each other, wherein the memory supports terminal device to execute above-mentioned data ciphering method for storing
Computer program, the computer program include program instruction, and the processor is configured for calling described program instruction, are used
With execute above-mentioned first aspect to first aspect any one implementation data ciphering method.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer storage medium
It is stored with computer program, the computer program includes program instruction, and described program instruction is when being executed by processor, to hold
The data ciphering method of any one implementation of the above-mentioned first aspect of row to first aspect.
After the application obtains the clear data comprising multiple multilevel sequences, clear data is mapped using mapping function
The data that are expanded into extension codomain, then again encrypt growth data to obtain encryption data.Wherein, mapping function
It can be the mapping table replaced for position, the multi-system data mapping then during mapping, in clear data
To after extension codomain, the position in growth data will differ from the position in clear data;In addition to this, letter is mapped
Number is also possible to be the function for changing multi-system data itself, if clear data to be divided into the sub- clear data of multistage, leads to
It crosses different mapping functions and the sub- clear data of the multistage is mapped to extension codomain, then each multi-system sequence in clear data
Column may be expressed as a variety of multi-system data.Then after map operation, multiple multilevel sequences in clear data it
Between the change that puts in order, and/or, each multilevel sequence is mapped as a variety of multilevel sequences.Therefore, it can be seen that plaintext number
The data distribution that the position change of data in will lead to clear data changes;Each multilevel sequence in clear data
It is mapped for multiple multilevel sequences, then rogue program can not find in clear data some multilevel sequence in full text
Distribution, the data distribution that can then regard clear data as are changed.Generally speaking by the encryption method of the embodiment of the present application,
Original data distribution of clear data can be hidden, thus prevent encryption data during being retrieved, malicious server
The entire contents of encryption file, therefore this are deduced according to the distribution of the keyword of retrieval and the keyword in encryption data
Application embodiment can prevent leakage of data, improve the safety of data.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in embodiment description
Attached drawing is briefly described.
Fig. 1 is a kind of schematic flow diagram of data ciphering method provided by the embodiments of the present application;
Fig. 2 is a kind of schematic flow diagram for data ciphering method that another embodiment of the application provides;
Fig. 3 is a kind of schematic diagram of mapping function provided by the embodiments of the present application;
Fig. 4 is a kind of schematic diagram that clear data is mapped to extension codomain provided by the embodiments of the present application;
Fig. 5 is another schematic diagram that clear data is mapped to extension codomain provided by the embodiments of the present application;
Fig. 6 is a kind of schematic diagram that clear data is mapped to extension codomain that another embodiment of the application provides;
Fig. 7 is the schematic diagram of the integration method for the seed growth data that another embodiment of the application provides;
Fig. 8 is the schematic diagram of the integration method for the seed growth data that another embodiment of the application provides;
Fig. 9 is the schematic diagram of the mapping result for the identical multilevel sequence that another embodiment of the application provides;
Figure 10 is a kind of schematic block diagram of terminal device provided by the embodiments of the present application;
Figure 11 is a kind of structural diagram of terminal device provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " and "comprising" instruction
Described feature, entirety, step, operation, the presence of element and/or component, but one or more of the other feature, whole is not precluded
Body, step, operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment
And be not intended to limit the application.As present specification and it is used in the attached claims, unless on
Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is
Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt
Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or
" if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true
It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In the specific implementation, terminal device described in the embodiment of the present application is including but not limited to such as with the sensitive table of touch
Mobile phone, laptop computer or the tablet computer in face (for example, touch-screen display and/or touch tablet) etc it is other
Portable device.It is to be further understood that in certain embodiments, equipment is not portable communication device, but has and touch
The desktop computer of sensing surface (for example, touch-screen display and/or touch tablet).
In following discussion, the terminal device including display and touch sensitive surface is described.However, should manage
Solution, terminal device may include that one or more of the other physical User of such as physical keyboard, mouse and/or control-rod connects
Jaws equipment.
Terminal device supports various application programs, such as one of the following or multiple: drawing application program, demonstration application
Program, word-processing application, website creation application program, disk imprinting application program, spreadsheet applications, game are answered
With program, telephony application, videoconference application, email application, instant messaging applications, forging
Refining supports application program, photo management application program, digital camera application program, digital camera application program, web-browsing to answer
With program, digital music player application and/or video frequency player application program.
At least one of such as touch sensitive surface can be used in the various application programs that can be executed on the terminal device
Public physical user-interface device.It can be adjusted among applications and/or in corresponding application programs and/or change touch is quick
Feel the corresponding information shown in the one or more functions and terminal device on surface.In this way, the public physics frame of terminal device
Structure (for example, touch sensitive surface) can be supported various using journey with user interface intuitive and transparent for a user
Sequence.
It is a kind of schematic flow diagram of data ciphering method provided by the embodiments of the present application, data as shown in the figure referring to Fig. 1
Encryption method can include:
101: obtaining clear data, clear data includes multiple multilevel sequences.
In the embodiment of the present application, first obtain and need the clear data that encrypts, wherein in clear data comprising it is multiple mostly into
Sequence processed, a multilevel sequence represent a text, letter, number, symbol, pixel or loudness etc..It needs, in plain text
Data refer to not encrypted sets of bits, directly by text, bit stream, bitmap, digitized voice or digitized view
The digitlizations such as frequency image convert, and any terminal device is all not required to that clear data is decrypted, can be by directly reading
The clear data is taken just to know the content of the clear data.
102: obtaining extension codomain, the extension codomain is equal or different to the codomain of above-mentioned multilevel sequence.
In the embodiment of the present application, an extension codomain is obtained.Wherein, extension codomain can be the codomain area of arbitrary size
Between, and the extension codomain can be the same or different than the codomain of the multilevel sequence in above-mentioned clear data.For example, on
Stating extension codomain is [0,31], if multilevel sequence in above-mentioned clear data is binary sequence, and the clear data packet
The binary sequence contained all in range 00000~11111, then the codomain of the multilevel sequence of above-mentioned clear data be also [0,
31]。
It should be noted that this step 102 and step 101 are in no particular order, can also be obtained while obtaining clear data
Extend codomain.
103: above-mentioned clear data is mapped to above-mentioned extension codomain using mapping function, it is multiple in clear data to change
Arrangement position between multilevel sequence, and/or each multilevel sequence is mapped as a variety of multilevel sequences.
In the embodiment of the present application, above-mentioned clear data is mapped to extension codomain using mapping function, to be expanded
Open up data.Wherein, the above-mentioned mapping function that clear data is mapped to extension codomain has at least one, when above-mentioned mapping function
Only one when, use the mapping letter to put in order for the multiple multilevel sequences that can upset in above-mentioned clear data
Number, such as position permutation table, it should be noted that position permutation table is used for multiple multilevel sequences in clear data again
Arrangement, and the digit in the permutation table of position is less than or equal to the number of the multilevel sequence of clear data, such as clear data packet
Containing 64 multilevel sequences, then the size of position permutation table can be less than or equal to 8*8, as shown in Figure 3.To work as mapping function
When the mapping function to put in order for multiple multilevel sequences for upsetting in above-mentioned clear data, above-mentioned extension codomain with it is upper
The codomain for stating clear data is equal, and mapping process only changes the data assignment in clear data, the codomain without changing data.
For example, if clear data is 64 data, and above-mentioned mapping function is to replace less than or equal to the position 8*8
Table, as shown in Figure 3.Input includes the clear data L of 64 multilevel sequences0Later, control site permutation table, L0More than the 1st
System sequence is arranged the 6th in the position of the position table of comparisons for the 8th and is arranged, i.e., and the 62nd, then by L0The 1st multilevel sequence position
It sets and is adjusted to the 62nd, in the position for determining the 1st multilevel sequence and then according to the position table of comparisons, search clear data
In the position ... that is adjusted respectively of 64 multilevel sequences then script clear data L0=(D1, D2, D3,
D4.......D61, D62, D63, D64) after being mapped according to the position table of comparisons, become growth data L1=(D63,
D58, D60, D62.......D8, D1, D3, D5), it can be seen that the data distribution of growth data has been different from above-mentioned plaintext number
According to data distribution, after then passing through mapping, the data distribution of clear data is changed.
It should be noted that data distribution describes the distribution trend of data, the central tendency including data distribution, instead
Reflect each data degree that center value is drawn close or assembled thereto;The dispersion degree of data distribution reflects each data far from its central value
Trend;The shape of data distribution reflects the skewness and kurtosis of data distribution.
Optionally, clear data is divided into the sub- clear data of preset quantity;The mapping function of preset quantity is obtained, it will
The mapping function of preset quantity and the sub- clear data of preset quantity correspond;It will be preset using the mapping function of preset quantity
The sub- clear data of quantity is respectively mapped in extension codomain, to obtain the sub- growth data of preset quantity;Integrate preset quantity
Sub- growth data, be expanded data.
In the embodiment of the present application, the above-mentioned mapping function that clear data is mapped to extension codomain can also be multiple,
Clear data is so divided into the sub- clear data of preset quantity, then obtain preset quantity mapping function come with it is above-mentioned pre-
If the sub- clear data of quantity corresponds, then utilize the mapping function of the preset quantity by the sub- plaintext number of the preset quantity
According to being mapped in the same extension codomain respectively.Wherein, the mapping function of above-mentioned preset quantity may include for upsetting plaintext number
The mapping function to put in order between multilevel sequence in also may include for by each multi-system in clear data
Sequence is expressed as the mapping function of a variety of multilevel sequences, wherein each multilevel sequence is mapped in order to more in clear data
A multilevel sequence, then rogue program can not find some multilevel sequence in clear data and then may be used in the distribution of full text
It is changed with regarding the data distribution of clear data as.Then it is used for the same mapping function compared to entire clear data,
The original data distribution of clear data can be upset to a greater extent using multiple mapping functions, so that clear data maps it
The data distribution of the growth data and clear data that obtain afterwards is entirely different.
For example, as shown in figure 4, clear data is divided into the first sub- clear data, the second sub- clear data and third
This three cross-talks clear data of sub- clear data, is then mapped to extension codomain according to mapping function 1 for the first sub- clear data, will
Second sub- clear data is mapped to extension codomain according to mapping function 2, and the sub- clear data of third is mapped to according to mapping function 3
Extend codomain, wherein the first mapping function, the second mapping function and third mapping function two-by-two can not be identical.
Optionally, clear data is divided into the sub- clear data of preset quantity;By expanding value regional partition at preset quantity
Son extension codomain;The mapping function for obtaining preset quantity, by the sub- plaintext number of the mapping function of preset quantity and preset quantity
According to one-to-one correspondence;The sub- clear data of preset quantity is respectively mapped to the son of preset quantity using the mapping function of preset quantity
It extends in codomain, obtains the sub- growth data of preset quantity;The sub- growth data of preset quantity is integrated, be expanded data.
In the embodiment of the present application, clear data is divided into the sub- clear data of preset quantity, and also by expanding value
The son extension codomain of the equal preset quantity of regional partition Cheng Yuzi clear data number of segment, then obtains the mapping letter of preset quantity
Number utilizes reflecting for the preset quantity after corresponding the sub- clear data of preset quantity and the mapping function of preset quantity
The son extension codomain that the sub- clear data of preset quantity is respectively mapped to above-mentioned preset quantity by function is penetrated, preset quantity is obtained
Sub- growth data, the sub- growth data for finally integrating the preset quantity are expanded data.
It should be noted that since expanding value regional partition is at the son extension codomain of preset quantity, the then son of preset quantity
Clear data mapping is respectively mapped to after the son extension codomain of preset quantity, and the son of the preset quantity obtained after mapping expands
The codomain of multilevel sequence in exhibition data also becomes different, then the length of the multilevel sequence in every sub- growth data
Also become different, be expanded data after then finally combining sub- growth data, due to mapping after mostly into
The length of sequence processed is different, in being comparable to carry out non-uniform stretching or compression to clear data, so that data
Data distribution in growth data is different from the data distribution in clear data.
Further, the sub- clear data of preset quantity is respectively mapped to pre- by the above-mentioned mapping function using preset quantity
If referring to that the son that the sub- clear data of preset quantity is sequentially corresponded to preset quantity one by one expands in the son extension codomain of quantity
Open up codomain;The son that the sub- clear data of preset quantity is respectively mapped to preset quantity is extended using the mapping function of preset quantity
Codomain.
In the embodiment of the present application, the corresponding pass of the sub- clear data of preset quantity and the son extension codomain of preset quantity
System is that sequence is corresponding, for example, as shown in figure 5, it is bright that the data in clear data are divided into the first son in sequence
This three cross-talks clear data of literary data, the second sub- clear data and the sub- clear data of third;Then it will extend represented by codomain again
Codomain [1,1023] be divided into the first son extension codomain [0,255], the second son extension codomain [256,511] and the sub- expanding value of third
Domain [512,1023];The first sub- clear data is finally mapped to the first son extension codomain according to mapping function 1, the second son is bright
Literary data are mapped to the second son extension codomain according to mapping function 2, and the sub- clear data of third is mapped to the according to mapping function 3
Three son extension codomains, wherein the first mapping function, the second mapping function and third mapping function two-by-two can not be identical.
Optionally, the sub- clear data of preset quantity is respectively mapped to preset by the above-mentioned mapping function using preset quantity
Refer to that random ordering corresponds to the preset quantity one by one by the sub- clear data of the preset quantity in the son extension codomain of quantity
Son extension codomain;The sub- clear data of the preset quantity is respectively mapped to institute using the mapping function of the preset quantity
State the son extension codomain of preset quantity.
In the embodiment of the present application, the corresponding pass of the sub- clear data of preset quantity and the son extension codomain of preset quantity
System is out-of-order corresponding, for example, as shown in fig. 6, it is bright that the data in clear data are divided into the first son in sequence
This three cross-talks clear data of literary data, the second sub- clear data and the sub- clear data of third;Then it will extend represented by codomain again
Codomain [1,1023] be divided into the first son extension codomain [0,255], the second son extension codomain [256,511] and the sub- expanding value of third
Domain [512,1023];The first sub- clear data is finally mapped to third extension codomain according to mapping function 1, the second son is bright
Literary data are mapped to the first son extension codomain according to mapping function 2, and the sub- clear data of third is mapped to the according to mapping function 3
Two son extension codomains, wherein the first mapping function, the second mapping function and third mapping function two-by-two can not be identical.
Further, the above-mentioned sub- growth data for integrating preset quantity refers to the sub- clear data according to preset quantity
Sequence, integron growth data.As shown in fig. 7, by three cross-talk clear datas be respectively mapped to three son extension codomains it
Afterwards, the first sub- growth data, the second sub- growth data and the sub- growth data of third are obtained, then according to the first sub- growth data,
The sequence of second sub- growth data and the sub- growth data of third combines three sub- growth datas.
Optionally, the above-mentioned sub- growth data for integrating preset quantity, which is referred to, integrates the sub- extension according to random sequence
Data.As shown in figure 8, obtaining the first son extension after three cross-talk clear datas to be respectively mapped to three son extension codomains
Data, the second sub- growth data and the sub- growth data of third, then according to the sub- growth data of third, the first sub- growth data and
The sequence of two sub- growth datas combines three sub- growth datas.
It should be noted that above-mentioned sub- growth data is combined according to random sequence, it is equivalent to and upsets plaintext number
According to the sequence between neutron clear data, then it is beneficial to further change the data distribution of clear data.
104: obtaining above-mentioned clear data and be mapped to obtained growth data after above-mentioned extension codomain.
In the embodiment of the present application, obtain by clear data be mapped to extension codomain after obtained growth data, should
Growth data includes multiple multilevel sequences.
105: computations being carried out to above-mentioned growth data, to obtain encryption data.
In the embodiment of the present application, the sub- growth data of above-mentioned preset quantity combine be expanded data it
Afterwards, which is encrypted according to Encryption Algorithm, Encryption Algorithm include symmetric encipherment algorithm, rivest, shamir, adelman and
Hash algorithm.Wherein, symmetric encipherment algorithm includes data encryption algorithm (DES, Data Encryption Algorithm), three
Heavy data encryption algorithm (TDEA, Triple Data Encryption Algorithm) and Advanced Encryption Standard (AES,
Advanced Encryption Standard) etc., rivest, shamir, adelman include Peter Lonard-Shamir-A Deman (RSA,
Rivest-Shamir-Adleman) Encryption Algorithm, elliptic curve encryption algorithm (ECC, Elliptic Curve Cryptography)
With Digital Signature Algorithm (DSA, Digital Signature Algorithm), hash algorithm includes md5-challenge 2
(MD2, Message-Digest Algorithm 2), (MD5, the Message-Digest Algorithm of md5-challenge 4
And Message-Digest Algorithm 5 (MD5, Message-Digest Algorithm 5) etc. 4).
It should be noted that the embodiment of the present application is by being mapped to extension codomain for clear data, thus it is possible to vary plaintext number
The numerical value of data in and position obtain the different binary system of three segment length as shown in figure 9, clear data is split
Sequence, i.e., the first sub- clear data, the second sub- clear data and the sub- clear data of third, and sub- clear data every six represent one
A character, codomain are (0~63)10.Assuming that all containing character a in every section of sequence, corresponding binary sequence is (101001)2.And
The codomain for extending codomain is (0~1023)10, one character of every ten expressions.Then by the expanding value regional partition at plaintext number
According to the section that the equal length of the number of segment being divided into is random, that is, it is divided into the first sub- extending space, the second sub- extending space and
The length of three sub- extending spaces, every sub- extending space is random, and the codomain in each section is unequal.First sub- extending space,
The codomain of second sub- extending space and the sub- extending space of third is respectively (0~255)10, (256~511)10(512~
1023)10.It is empty that the first sub- clear data, the second sub- clear data and the sub- clear data of third are mapped to the first son extension respectively
Between, after the second sub- extending space and the sub- extending space of third, due to the mapping function that is respectively adopted and son extension codomain
Codomain is different, the character a (101001) in the first sub- clear data, the second sub- clear data and the sub- clear data of third2, respectively
It is mapped to the first sub- extending space, the second sub- extending space and the sub- extending space of third and is expressed as (0001101001) later2,
(0110100001)2, (1101001010)2.As can be seen that identical characters are mapped to different value by different mapping functions
After the son extension codomain in domain, it is expressed as different numerical value, the embodiment of the present application is by being mapped to expanding value for clear data
Domain, and change the numerical value of the data in clear data, and identical multilevel sequence can be expressed as different multi-system sequences
Column.
It needs, if different mappings function used in the above-mentioned sub- clear data of difference is for changing Data Position
Function, then the growth data that clear data obtains after mapping is different from the Data Position in clear data, such as position
Permutation table;If different mappings function used in the above-mentioned sub- clear data of difference is the function for changing data value, bright
The growth data that literary data obtain after mapping is different from the data value of the same position in clear data, such as substantially just
Equal functions etc.;If different mappings function used in the above-mentioned sub- clear data of difference is the letter for changing data value and position
Number, then the value of the data for the expression identical meanings in growth data and clear data that clear data obtains after mapping and
Position is all different, such as the combination of position permutation table and basic elementary functions, the embodiment of the present application to mapping function without limitation.
After the embodiment of the present application obtains the clear data comprising multiple multilevel sequences, using mapping function by plaintext number
According to being mapped in extension codomain and the data that are expanded, then growth data is encrypted again to obtain encryption data.Wherein, it reflects
Penetrating function may be the mapping table for position displacement, the multi-system number then during mapping, in clear data
After being mapped to extension codomain, the position in growth data will differ from the position in clear data;In addition to this,
Mapping function is also possible to be the function for changing multi-system data itself, if clear data to be divided into the sub- plaintext number of multistage
According to every cross-talk clear data using different mapping functions, then each multilevel sequence in clear data may be expressed
At a variety of multi-system data.Then after map operation, putting in order between multiple multilevel sequences in clear data
Change, and/or, each multilevel sequence is mapped as a variety of multilevel sequences.Therefore, it can be seen that data in clear data
The data distribution that position change will lead to clear data changes;Each multilevel sequence is mapped in order to more in clear data
A multilevel sequence, then rogue program can not find some multilevel sequence in clear data and then may be used in the distribution of full text
It is changed with regarding the data distribution of clear data as.Generally speaking by the encryption method of the embodiment of the present application, can hide bright
Original data distribution of literary data, to prevent encryption data during being retrieved, malicious server is according to retrieval
Keyword and the keyword being distributed to deduce the entire contents of encryption file, therefore the embodiment of the present application in encryption data
Leakage of data can be prevented, the safety of data is improved.
Referring to fig. 2, it is the schematic flow diagram of another data ciphering method provided by the embodiments of the present application, counts as shown in the figure
According to encryption method can include:
201: obtaining clear data, clear data includes multiple multilevel sequences.
202: obtaining extension codomain, extension codomain is equal or different to the codomain of above-mentioned multilevel sequence.
203: above-mentioned clear data and above-mentioned growth data being divided into the sub- clear data of preset quantity respectively and preset
The son extension codomain of quantity.
In the embodiment of the present application, clear data is divided into the sub- clear data of preset quantity, and also by expanding value
The equal preset quantity of regional partition Cheng Yuzi clear data number of segment son extension codomain so that extension codomain and plaintext section all by
It is divided into identical number of segment.Wherein, the length of every cross-talk clear data can be same or different, the value of every section of son extension codomain
The width in domain can be same or different, and preset quantity can be to be arbitrarily large in the integer value for being equal to one.
For example, as shown in figure 5, clear data and extension codomain have been respectively divided into three sections, wherein clear data quilt
It has been divided into the first sub- clear data, the second sub- clear data and the sub- clear data of third, and has extended codomain and be divided into the first son
It extends codomain, the second son extension codomain and third and extends codomain.As can be seen that the section that clear data and extension codomain are divided into
Number is equal.
204: the mapping function of preset quantity is obtained, by the son plaintext of the mapping function of preset quantity and above-mentioned preset quantity
Data correspond.
In the embodiment of the present application, the mapping function for obtaining preset quantity by the sub- clear data of preset quantity and is preset
The mapping function of quantity corresponds, as shown in figure 5, corresponding three cross-talk clear datas, there are three mapping functions, wherein first
Sub- clear data correspondence mappings function 1, the second sub- clear data correspondence mappings function 2, the sub- clear data correspondence mappings letter of third
Number 3.
205: the sub- clear data of preset quantity being respectively mapped to preset quantity using the mapping function of preset quantity
In son extension codomain, the sub- growth data of preset quantity is obtained.
In the embodiment of the present application, the sub- clear data of preset quantity is mapped respectively using the mapping function of preset quantity
To the son extension codomain of above-mentioned preset quantity, the sub- growth data of preset quantity is obtained.As shown in figure 5, will using mapping function 1
First sub- clear data is mapped to the first son extension codomain, and second sub- clear data is mapped to the second son using mapping function 2
Codomain is extended, the sub- clear data of third is mapped to third extension codomain using mapping function 3.
Further, the sub- clear data of preset quantity is sequence with the corresponding relationship of the son extension codomain of preset quantity
It is corresponding, for example, as shown in figure 5, the data in clear data are divided into the first sub- clear data, in sequence
Two sub- clear datas and the sub- clear data of third this three cross-talks clear data;Then again will extension codomain represented by codomain [1,
1023] be divided into first son extension codomain [0,255], second son extension codomain [256,511] and third extend codomain [512,
1023];The first sub- clear data is finally mapped to the first son extension codomain according to mapping function 1, by the second sub- clear data
It is mapped to the second son extension codomain according to mapping function 2, the sub- clear data of third is mapped to third according to mapping function 3 and is expanded
Open up codomain, wherein the first mapping function, the second mapping function and third mapping function two-by-two can not be identical.
Optionally, above-mentioned that the sub- clear data of preset quantity is respectively mapped to preset quantity using different mapping functions
Son extension codomain in refer to using different mapping functions by the sub- clear data of preset quantity respectively random ordering be mapped to it is pre-
If the son extension codomain of quantity, to obtain the son extension codomain of preset quantity.
In the embodiment of the present application, the corresponding pass of the sub- clear data of preset quantity and the son extension codomain of preset quantity
System is out-of-order corresponding, for example, as shown in fig. 6, it is bright that the data in clear data are divided into the first son in sequence
This three cross-talks clear data of literary data, the second sub- clear data and the sub- clear data of third;Then it will extend represented by codomain again
Codomain [1,1023] be divided into the first son extension codomain [0,255], the second son extension codomain [256,511] and the sub- expanding value of third
Domain [512,1023];The first sub- clear data is finally mapped to third extension codomain according to mapping function 1, the second son is bright
Literary data are mapped to the first son extension codomain according to mapping function 2, and the sub- clear data of third is mapped to the according to mapping function 3
Two son extension codomains, wherein the first mapping function, the second mapping function and third mapping function two-by-two can not be identical.
206: integrating the sub- growth data of preset quantity, be expanded data.
In the embodiment of the present application, when the sub- expanding value that the sub- clear data of preset quantity is respectively mapped to preset quantity
After domain, the sub- growth data of preset quantity is obtained, then the sub- growth data of this preset quantity is combined and is just obtained
Growth data.
Further, the above-mentioned sub- growth data for integrating preset quantity refers to the sub- clear data according to preset quantity
Put in order and integrate the sub- growth data.As shown in fig. 7, three cross-talk clear datas are respectively mapped to three son extensions
After codomain, the first sub- growth data, the second sub- growth data and the sub- growth data of third are obtained, is then extended according to the first son
The sequence of data, the second sub- growth data and the sub- growth data of third combines three sub- growth datas.
Optionally, the above-mentioned sub- growth data for integrating preset quantity, which is referred to, integrates the sub- extension according to random disorder
Data.As shown in figure 8, obtaining the first son extension after three cross-talk clear datas to be respectively mapped to three son extension codomains
Data, the second sub- growth data and the sub- growth data of third, then according to the sub- growth data of third, the first sub- growth data and
The sequence of two sub- growth datas combines three sub- growth datas.
207: obtaining above-mentioned clear data and be mapped to obtained growth data after above-mentioned extension codomain.
In the embodiment of the present application, it obtains above-mentioned clear data and is mapped to obtained spreading number after above-mentioned extension codomain
According to the growth data obtained after that is, above-mentioned integration by sub- growth data.
208: computations being carried out to above-mentioned growth data, to obtain encryption data.
In the embodiment of the present application, the sub- growth data of above-mentioned preset quantity combine be expanded data it
Afterwards, which is encrypted according to Encryption Algorithm, Encryption Algorithm include symmetric encipherment algorithm, rivest, shamir, adelman and
Hash algorithm.Wherein, symmetric encipherment algorithm includes data encryption algorithm (DES, Data Encryption Algorithm), three
Heavy data encryption algorithm (TDEA, Triple Data Encryption Algorithm) and Advanced Encryption Standard (AES,
Advanced Encryption Standard) etc., rivest, shamir, adelman include Peter Lonard-Shamir-A Deman (RSA,
Rivest-Shamir-Adleman) Encryption Algorithm, elliptic curve encryption algorithm (ECC, Elliptic Curve Cryptography)
With Digital Signature Algorithm (DSA, Digital Signature Algorithm), hash algorithm includes md5-challenge 2
(MD2, Message-Digest Algorithm 2), (MD5, the Message-Digest Algorithm of md5-challenge 4
And Message-Digest Algorithm 5 (MD5, Message-Digest Algorithm 5) etc. 4).
It should be noted that the embodiment of the present application is by being mapped to extension codomain for clear data, thus it is possible to vary plaintext number
The numerical value of data in and position obtain the different binary system of three segment length as shown in figure 9, clear data is split
Sequence, i.e., the first sub- clear data, the second sub- clear data and the sub- clear data of third, and sub- clear data every six represent one
A character, codomain are (0~63)10.Assuming that all containing character a in every section of sequence, corresponding binary sequence is (101001)2.And
The codomain for extending codomain is (0~1023)10, one character of every ten expressions.Then by the expanding value regional partition at plaintext number
According to the section that the equal length of the number of segment being divided into is random, that is, it is divided into the first sub- extending space, the second sub- extending space and
The length of three sub- extending spaces, every sub- extending space is random, and the codomain in each section is unequal.First sub- extending space,
The codomain of second sub- extending space and the sub- extending space of third is respectively (0~255)10, (256~511)10(512~
1023)10.It is empty that the first sub- clear data, the second sub- clear data and the sub- clear data of third are mapped to the first son extension respectively
Between, after the second sub- extending space and the sub- extending space of third, due to the mapping function that is respectively adopted and son extension codomain
Codomain is different, the character a (101001) in the first sub- clear data, the second sub- clear data and the sub- clear data of third2, respectively
It is mapped to the first sub- extending space, the second sub- extending space and the sub- extending space of third and is expressed as (0001101001) later2,
(0110100001)2, (1101001010)2.As can be seen that identical characters are mapped to different value by different mapping functions
After the son extension codomain in domain, it is expressed as different numerical value, the embodiment of the present application is by being mapped to expanding value for clear data
Domain, and change the numerical value of the data in clear data, and identical multilevel sequence can be expressed different multilevel sequences.
It needs, if different mappings function used in the above-mentioned sub- clear data of difference is for changing Data Position
Function, then the growth data that clear data obtains after mapping is different from the Data Position in clear data, such as position
Permutation table;If different mappings function used in the above-mentioned sub- clear data of difference is the function for changing data value, bright
The growth data that literary data obtain after mapping is different from the data value of the same position in clear data, such as substantially just
Equal functions etc.;If different mappings function used in the above-mentioned sub- clear data of difference is the letter for changing data value and position
Number, then the value of the data for the expression identical meanings in growth data and clear data that clear data obtains after mapping and
Position is all different, such as the combination of position permutation table and basic elementary functions, the embodiment of the present application to mapping function without limitation.
In the embodiment of the present application, codomain is extended at the son of preset quantity due to expanding value regional partition, then preset quantity
The mapping of sub- clear data be respectively mapped to after the son extension codomain of preset quantity, the preset quantity obtained after mapping
The codomain of multilevel sequence in sub- growth data also becomes different, then multilevel sequence in every sub- growth data
Length also becomes different, and be expanded data after finally combining sub- growth data, due to mapping after mostly into
The length of sequence processed is different, in being comparable to carry out non-uniform stretching or compression to clear data, so that data
Data distribution in growth data is different from the data distribution in clear data, is then carrying out encryption meter to growth data
After calculation obtains encryption data, it cannot make out the original data distribution of clear data from the encryption data, then pass through this Shen
Please embodiment can hide original data distribution of clear data, to further prevent the data in retrieving from letting out
It is close, improve the safety of data.
It is there are one beneficial effect, since identical multilevel sequence can be represented as different multilevel sequences, in
It is other users when being retrieved to encryption data, the keyword retrieved corresponds to a variety of multilevel sequences, so that disliking
Meaning server is difficult to speculate encryption rule according to the corresponding multilevel sequence of each keyword searched, and due in plain text
The segmentation of data, the segmentation for extending codomain, mapping function, sub- clear data and son extend the corresponded manner of codomain, and son expands
The Integration Mode for opening up codomain is all secrecy, and the secret key being equivalent in conventional encryption technique increases together again for encryption file
Defence line improves the safety of data so that increase ciphertext cracks difficulty.
It should be noted that tending to emphasize the difference between each embodiment to the description of each embodiment above
Place, same or similar place can refer to mutually, for sake of simplicity, repeats no more herein.
The embodiment of the present application also provides a kind of terminal device, which is used to execute any one of aforementioned data encryption
The unit of method.It specifically, is a kind of schematic block diagram of terminal device provided by the embodiments of the present application referring to Figure 10.This implementation
The terminal device of example includes acquiring unit 1010, map unit 1020 and encryption unit 1030, specific:
Acquiring unit 1010, for obtaining clear data, the clear data includes multiple multilevel sequences;It is also used to obtain
Extension codomain is taken, the extension codomain is equal or different to the codomain of the multilevel sequence;It is also used to obtain the plaintext number
According to being mapped to obtained growth data after the extension codomain;
Map unit 1020, for the clear data to be mapped to the extension codomain using mapping function, to change
Arrangement position in the clear data between multiple multilevel sequences, and/or each multilevel sequence is mapped as a variety of more
System sequence;
Encryption unit 1030, for carrying out computations to the growth data, to obtain encryption data.
Further, above-mentioned terminal device further includes cutting unit 1040, default for the clear data to be divided into
The sub- clear data of quantity;Above-mentioned acquiring unit 1010, is also used to obtain the mapping function of the preset quantity;Above-mentioned terminal is set
Standby further includes corresponding unit 1050, for by the sub- clear data one of the mapping function of the preset quantity and the preset quantity
One is corresponding;Above-mentioned map unit 1020 is also used to using the mapping function of the preset quantity that the son of the preset quantity is bright
Literary data are respectively mapped in the extension codomain, to obtain the sub- growth data of the preset quantity;Above-mentioned terminal device is also
Including integral unit 1060, for integrating the sub- growth data of the preset quantity, be expanded data.
Optionally, above-mentioned cutting unit 1040, for the clear data to be divided into the sub- clear data of preset quantity,
And for the son extension codomain by the expanding value regional partition at the preset quantity;Above-mentioned acquiring unit 1010, is also used to
Obtain the mapping function of the preset quantity;Above-mentioned corresponding unit 1050, for by the mapping function of the preset quantity and institute
The sub- clear data for stating preset quantity corresponds;The map unit 1020, for the mapping letter using the preset quantity
The sub- clear data of the preset quantity is respectively mapped in the son extension codomain of the preset quantity by number, is obtained described default
The sub- growth data of quantity;Above-mentioned integral unit 1060, for integrating the sub- growth data of the preset quantity, be expanded number
According to
Specifically, above-mentioned corresponding unit, described for sequentially corresponding to the sub- clear data of the preset quantity one by one
The son extension codomain of preset quantity;Alternatively, for by the sub- clear data of the preset quantity one by one random ordering correspond to it is described pre-
If the son extension codomain of quantity.
Specifically, above-mentioned integral unit 1060, whole specifically for the sequence of the sub- clear data according to the preset quantity
Close the sub- growth data;Alternatively, integrating the sub- growth data according to random sequence.
After the embodiment of the present application obtains the clear data comprising multiple multilevel sequences by acquiring unit, by reflecting
It penetrates unit and is mapped to clear data in extension codomain and the data that are expanded using mapping function, then pass through encryption unit again
Growth data is encrypted to obtain encryption data.Wherein, mapping function may be the mapping table for position displacement, in
It is that multi-system data during mapping, in clear data are mapped to after extension codomain, the position in growth data
Set the position that will differ from clear data;In addition to this, mapping function is also possible to be for changing multi-system data itself
Function, if clear data to be divided into the sub- clear data of multistage, to every cross-talk clear data use different mapping functions,
Then each multilevel sequence in clear data may be expressed as a variety of multi-system data.Then bright after map operation
The change that puts in order between multiple multilevel sequences in literary data, and/or, each multilevel sequence be mapped as it is a variety of mostly into
Sequence processed.Therefore, it can be seen that the data distribution that the position change of the data in clear data will lead to clear data changes
Become;Each multilevel sequence is mapped for multiple multilevel sequences in clear data, then rogue program can not be found in plain text
In the distribution of full text, the data distribution that can then regard clear data as is changed some multilevel sequence in data.Total comes
It says the encryption method by the embodiment of the present application, original data distribution of clear data can be hidden, to prevent from retrieving
Leakage of data in journey improves the safety of data.
It is a kind of structural block diagram for terminal device that another embodiment of the application provides referring to Figure 11.Sheet as shown in the figure
Terminal device in embodiment may include: one or more processors 1110 and memory 1120.Above-mentioned 1110 He of processor
Memory 1120 is connected by bus 1130.For memory 1120 for storing computer program, computer program includes that program refers to
It enables, processor 1110 is used to execute the program instruction of the storage of memory 1120.
Processor 1110 is used to execute the function of acquiring unit 1010, for obtaining clear data, the clear data packet
Containing multiple multilevel sequences;It is also used to obtain extension codomain, the extension codomain is equal or different to the multilevel sequence
Codomain;It is also used to obtain the clear data and is mapped to obtained growth data after the extension codomain;It is also used to execute
The function of map unit 1020, for the clear data to be mapped to the extension codomain using mapping function, to change
State the arrangement position in clear data between multiple multilevel sequences, and/or by each multilevel sequence be mapped as it is a variety of mostly into
Sequence processed;It is also used to execute the function of encryption unit 1030, for carrying out computations to the growth data, to be encrypted
Data.
Further, above-mentioned processor 1110 is also used to execute the function of cutting unit 1040, is used for the plaintext number
According to the sub- clear data for being divided into preset quantity;It is also used to obtain the mapping function of the preset quantity;It is also used to execute correspondence
The function of unit 1050, for the mapping function of the preset quantity and the sub- clear data of the preset quantity one is a pair of
It answers;It is also used to that the sub- clear data of the preset quantity is respectively mapped to the expansion using the mapping function of the preset quantity
It opens up in codomain, to obtain the sub- growth data of the preset quantity;It is also used to execute the function of integral unit 1060, for integrating
The sub- growth data of the preset quantity, be expanded data.
Optionally, above-mentioned processor 1110 is used to for the clear data being divided into the sub- clear data of preset quantity, with
And for the son extension codomain by the expanding value regional partition at the preset quantity;For obtaining the mapping of the preset quantity
Function;For the sub- clear data of the mapping function of the preset quantity and the preset quantity to be corresponded;For utilizing
The mapping function of the preset quantity expands the son that the sub- clear data of the preset quantity is respectively mapped to the preset quantity
It opens up in codomain, obtains the sub- growth data of the preset quantity;For integrating the sub- growth data of the preset quantity, expanded
Open up data
Specifically, above-mentioned processor 1110, specifically for the sub- clear data of the preset quantity is sequentially corresponding one by one
To the son extension codomain of the preset quantity;Alternatively, for by the sub- clear data of the preset quantity, random ordering to be corresponded to one by one
The son extension codomain of the preset quantity.
Specifically, above-mentioned processor 1110, specifically for the sequence of the sub- clear data according to the preset quantity, integration
The sub- growth data;Alternatively, integrating the sub- growth data according to random sequence.
It should be appreciated that in the embodiment of the present application, alleged processor 1110 can be central processing unit (Central
Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital
Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at
Reason device is also possible to any conventional processor etc..
The memory 1120 may include read-only memory and random access memory, and provide instruction to processor 1110
And data.The a part of of memory 1120 can also include nonvolatile RAM.For example, memory 1120 may be used also
With the information of storage device type.
In the specific implementation, number provided by the embodiments of the present application can be performed in processor 1110 described in the embodiment of the present application
Implementation described in first embodiment and second embodiment according to encryption method also can be performed the embodiment of the present application and be retouched
The implementation for the terminal device stated, details are not described herein.
A kind of computer readable storage medium is provided in another embodiment of the application, computer readable storage medium is deposited
Computer program is contained, computer program includes program instruction, and program instruction is executed by processor.
Computer readable storage medium can be the internal storage unit of the terminal device of aforementioned any embodiment, such as eventually
The hard disk or memory of end equipment.Computer readable storage medium is also possible to the External memory equipment of terminal device, such as terminal
The plug-in type hard disk being equipped in equipment, intelligent memory card (Smart Media Card, SMC), secure digital (Secure
Digital, SD) card, flash card (Flash Card) etc..Further, computer readable storage medium can also both include eventually
The internal storage unit of end equipment also includes External memory equipment.Computer readable storage medium for store computer program with
And other programs and data needed for terminal device.Computer readable storage medium can be also used for temporarily storing and export
Or the data that will be exported.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure
Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware
With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This
A little functions are implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Specially
Industry technical staff can realize described function to each specific application using different data encryption method, but this
Kind is realized it is not considered that exceeding scope of the present application.
It is apparent to those skilled in the art that for convenience of description and succinctly, the end of foregoing description
The specific work process of end equipment and unit, can be with reference to the corresponding process in aforementioned data encryption method embodiment, herein not
It repeats again.
In several embodiments provided herein, it should be understood that disclosed terminal device and data encryption side
Method may be implemented in other ways.For example, the apparatus embodiments described above are merely exemplary, for example, unit
Division, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or group
Part can be combined or can be integrated into another system, or some features can be ignored or not executed.In addition, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, be also possible to electricity, mechanical or other forms connections.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple networks
On unit.It can select some or all of unit therein according to the actual needs to realize the mesh of the embodiment of the present application scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, is also possible to two or more units and is integrated in one unit.It is above-mentioned integrated
Unit both can take the form of hardware realization, can also realize in the form of software functional units.
It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product
To be stored in a computer readable storage medium.Based on this understanding, the technical solution of the application substantially or
Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products
Out, which is stored in a storage medium, including some instructions are used so that a computer equipment
(can be personal computer, server or the network equipment etc.) executes the complete of each embodiment data ciphering method of the application
Portion or part steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
Claims (10)
1. a kind of data ciphering method characterized by comprising
Clear data is obtained, the clear data includes multiple multilevel sequences;
Extension codomain is obtained, the extension codomain is equal or different to the codomain of the multilevel sequence;
The clear data is mapped to the extension codomain using mapping function, with change in the clear data it is multiple mostly into
Arrangement position between sequence processed, and/or each multilevel sequence is mapped as a variety of multilevel sequences;
It obtains the clear data and is mapped to obtained growth data after the extension codomain;
Computations are carried out to the growth data, to obtain encryption data.
2. the method according to claim 1, wherein described be mapped to the clear data using mapping function
The extension codomain, comprising:
The clear data is divided into the sub- clear data of preset quantity;
The mapping function for obtaining the preset quantity, by the son plaintext of the mapping function of the preset quantity and the preset quantity
Data correspond;
The sub- clear data of the preset quantity is respectively mapped to the expanding value using the mapping function of the preset quantity
In domain, to obtain the sub- growth data of the preset quantity;
The sub- growth data of the preset quantity is integrated, be expanded data.
3. the method according to claim 1, wherein described be mapped to the clear data using mapping function
The extension codomain, comprising:
The clear data is divided into the sub- clear data of preset quantity;
By the expanding value regional partition at the son extension codomain of the preset quantity;
The mapping function for obtaining the preset quantity, by the son plaintext of the mapping function of the preset quantity and the preset quantity
Data correspond;
The sub- clear data of the preset quantity is respectively mapped to the present count using the mapping function of the preset quantity
In the son extension codomain of amount, the sub- growth data of the preset quantity is obtained;
The sub- growth data of the preset quantity is integrated, be expanded data.
4. according to the method described in claim 3, it is characterized in that, the mapping function using the preset quantity will be described
The sub- clear data of preset quantity is respectively mapped in the son extension codomain of the preset quantity, comprising:
The sub- clear data of the preset quantity is sequentially corresponded to the son extension codomain of the preset quantity one by one;Using described
The sub- clear data of the preset quantity is respectively mapped to the sub- expanding value of the preset quantity by the mapping function of preset quantity
Domain;Or
By the sub- clear data of the preset quantity, the out-of-order son for corresponding to the preset quantity extends codomain one by one;Using described
The sub- clear data of the preset quantity is respectively mapped to the sub- expanding value of the preset quantity by the mapping function of preset quantity
Domain.
5. according to the method described in claim 4, it is characterized in that, the sub- growth data of the integration preset quantity, packet
It includes:
According to the sequence of the sub- clear data of the preset quantity, the sub- growth data is integrated;Or
The sub- growth data is integrated according to random sequence.
6. a kind of terminal device characterized by comprising
Acquiring unit, for obtaining clear data, the clear data includes multiple multilevel sequences;It is also used to obtain expanding value
Domain, the extension codomain are equal or different to the codomain of the multilevel sequence;It is also used to obtain the clear data to be mapped to
Obtained growth data after the extension codomain;
Map unit, for the clear data to be mapped to the extension codomain using mapping function, to change the plaintext
Arrangement position in data between multiple multilevel sequences, and/or each multilevel sequence is mapped as a variety of multilevel sequences;
Encryption unit, for carrying out computations to the growth data, to obtain encryption data.
7. terminal device according to claim 6 characterized by comprising
Cutting unit, for the clear data to be divided into the sub- clear data of preset quantity;
The acquiring unit is also used to obtain the mapping function of the preset quantity;
Corresponding unit, for corresponding the sub- clear data of the mapping function of the preset quantity and the preset quantity;
The map unit distinguishes the sub- clear data of the preset quantity for the mapping function using the preset quantity
It is mapped in the extension codomain, to obtain the sub- growth data of the preset quantity;
Integral unit, for integrating the sub- growth data of the preset quantity, be expanded data.
8. terminal device according to claim 6 characterized by comprising
Cutting unit, for the clear data to be divided into the sub- clear data of preset quantity;It is also used to the expanding value
Regional partition extends codomain at the son of the preset quantity;
The acquiring unit is also used to obtain the mapping function of the preset quantity;
Corresponding unit, for corresponding the sub- clear data of the mapping function of the preset quantity and the preset quantity;
The map unit distinguishes the sub- clear data of the preset quantity for the mapping function using the preset quantity
It is mapped in the son extension codomain of the preset quantity, obtains the sub- growth data of the preset quantity;
Integral unit, for integrating the sub- growth data of the preset quantity, be expanded data.
9. a kind of terminal device, which is characterized in that including processor and memory, the processor and memory are connected with each other,
Wherein, the memory is for storing computer program, and the computer program includes program instruction, and the processor is configured
For calling described program to instruct, to execute the method according to claim 1 to 5.
10. a kind of computer readable storage medium, which is characterized in that the computer storage medium is stored with computer program,
The computer program includes program instruction, and described program instruction makes the processor execute such as right when being executed by a processor
It is required that the described in any item methods of 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810965583.XA CN109308420B (en) | 2018-08-22 | 2018-08-22 | Data encryption method, terminal equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810965583.XA CN109308420B (en) | 2018-08-22 | 2018-08-22 | Data encryption method, terminal equipment and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109308420A true CN109308420A (en) | 2019-02-05 |
CN109308420B CN109308420B (en) | 2023-04-07 |
Family
ID=65223879
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810965583.XA Active CN109308420B (en) | 2018-08-22 | 2018-08-22 | Data encryption method, terminal equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109308420B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115801228A (en) * | 2023-01-09 | 2023-03-14 | 佰聆数据股份有限公司 | Method and device for encrypting interactive information, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1852088A (en) * | 2005-10-13 | 2006-10-25 | 华为技术有限公司 | Enciphering-deciphering method for flow medium transmission code flow and module |
WO2007075154A2 (en) * | 2004-12-06 | 2007-07-05 | The Trustees Of The Stevens Institute Of Technology | Method and apparatus for maintaining data integrity for block-encryption algorithms |
CN104766264A (en) * | 2015-01-22 | 2015-07-08 | 西北工业大学 | Partitioning double-layer self-adaptation diffusion image encryption method |
CN105099652A (en) * | 2014-05-04 | 2015-11-25 | 博雅网络游戏开发(深圳)有限公司 | Data encryption and decryption method and devices |
CN105790930A (en) * | 2016-04-29 | 2016-07-20 | 南京酷派软件技术有限公司 | Information encryption method and information encryption device used for mobile terminal and mobile terminal |
-
2018
- 2018-08-22 CN CN201810965583.XA patent/CN109308420B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007075154A2 (en) * | 2004-12-06 | 2007-07-05 | The Trustees Of The Stevens Institute Of Technology | Method and apparatus for maintaining data integrity for block-encryption algorithms |
CN1852088A (en) * | 2005-10-13 | 2006-10-25 | 华为技术有限公司 | Enciphering-deciphering method for flow medium transmission code flow and module |
CN105099652A (en) * | 2014-05-04 | 2015-11-25 | 博雅网络游戏开发(深圳)有限公司 | Data encryption and decryption method and devices |
CN104766264A (en) * | 2015-01-22 | 2015-07-08 | 西北工业大学 | Partitioning double-layer self-adaptation diffusion image encryption method |
CN105790930A (en) * | 2016-04-29 | 2016-07-20 | 南京酷派软件技术有限公司 | Information encryption method and information encryption device used for mobile terminal and mobile terminal |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115801228A (en) * | 2023-01-09 | 2023-03-14 | 佰聆数据股份有限公司 | Method and device for encrypting interactive information, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109308420B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10212155B2 (en) | Table-connected tokenization | |
CN107294709A (en) | A kind of block chain data processing method, apparatus and system | |
CN110347723A (en) | A kind of data query method, system and electronic equipment and storage medium | |
CN111835511A (en) | Data security transmission method and device, computer equipment and storage medium | |
CN104685825B (en) | A kind of method of secure communication, computing device and non-transient computer readable storage medium storing program for executing | |
CN114398427A (en) | Improving searching ability of special encrypted data | |
CN109214201B (en) | Data sharing method, terminal equipment and computer readable storage medium | |
CN103378971B (en) | A kind of data encryption system and method | |
CN108400868B (en) | Seed key storage method and device and mobile terminal | |
US8769302B2 (en) | Encrypting data and characterization data that describes valid contents of a column | |
CN105809042A (en) | Information protection method and device, information display method and device, and terminal | |
CN107078899A (en) | The method of obfuscated data | |
US10476661B2 (en) | Polynomial-based homomorphic encryption | |
CN107302521A (en) | The sending method and method of reseptance of a kind of privacy of user data | |
CN109308420A (en) | A kind of data ciphering method, terminal device and computer readable storage medium | |
CN110990846B (en) | Information storage method, device and computer readable storage medium | |
CN113434906A (en) | Data query method and device, computer equipment and storage medium | |
CN105119917B (en) | Strengthen the method and system of Information Security | |
CN111368317A (en) | Computer data encryption system and method | |
WO2019134278A1 (en) | Chat encryption method and apparatus, chat decryption method and apparatus, electronic terminal and readable storage medium | |
WO2021109810A1 (en) | Access password configuration method, and device | |
WO2021052033A1 (en) | Data calling method and apparatus, and device and computer readable storage medium | |
CN110458566A (en) | A kind of account address generating method, system, device and the computer readable storage medium of block chain | |
US20140145992A1 (en) | Information Input Method and Touchscreen Terminal | |
CN113179161B (en) | Method and device for replacing secret key, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |