CN104518865B - A kind of data ciphering method based on code book - Google Patents
A kind of data ciphering method based on code book Download PDFInfo
- Publication number
- CN104518865B CN104518865B CN201410767831.1A CN201410767831A CN104518865B CN 104518865 B CN104518865 B CN 104518865B CN 201410767831 A CN201410767831 A CN 201410767831A CN 104518865 B CN104518865 B CN 104518865B
- Authority
- CN
- China
- Prior art keywords
- data
- code book
- character
- encryption
- decimal number
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The invention discloses a kind of data ciphering method based on code book, belong to Computer Data Security technical field.The present invention carries out data encryption using user-defined code book, the sequence for making full use of data storage itself to constitute, need not be by extracting part bit data, or data are inserted between specific bit carry out " upsetting " original data storage sequence, but by carrying out " fixed length cutting " to former data sequence, this " fixed length " is generally more than 8bit, so that ciphertext shows simpler, succinct, the difficulty that user illegally decrypts is increased significantly.Compared to existing technology, the length of ciphertext has been effectively compressed, the speed of data encryption has been improve, the establishment of code book has increased the difficulty that data are illegally decrypted significantly.
Description
Technical field
The present invention relates to a kind of data ciphering method, more particularly to a kind of data ciphering method based on code book, belong to
Computer Data Security technical field.
Background technology
With the appearance and fast development of Internet technology, the life style of the mankind has obtained huge change, but simultaneously
Substantial amounts of business data, the phenomenon of user privacy information leakage also occur therewith, and its leakage mode is varied, the destruction for causing
Property also more and more acutely, even also become no longer safe in the presence of the data on oneself computer or server, so, logarithm
According to ciphering process be particularly important, using which kind of encryption method data are carried out effectively encryption become computer network
The important component of data safety storage in network technology.
Data encryption is currently a kind of most reliable method that computer network is protected to information, and wherein heavy to closing
What is wanted is exactly to realize data encryption with which kind of AES and encryption key.Data encryption is a time-honored safe skill
Art, i.e., be converted into ciphertext by AES and encryption key by data clear text, and can be close by decipherment algorithm and decryption
Key reverts in plain text ciphertext.
Conventional encryption methods have two kinds:Replace and replace.Wherein, key is replaced to turn each character in plaintext
It is changed to a character in ciphertext;Displacement only rearranges the character of plaintext in a different order.But, both approaches
It is all not safe enough that any one is used alone, and usually, both approaches is applied in combination, and DES data encryption standards is just
It is using this combination.
Conventional key algorithm has:DES、3DES、RC2/RC4、IDEA、RSA、DSA、ElGamal、Deffie-Hellman、
ECC etc..Wherein, 3DES carries out Tertiary infilling, strength ratio DES to a block number based on DES according to three different keys
It is higher;RC2/RC4 is then encrypted with variable length key to mass data, and speed is faster than DES;And RSA not only supports variable length key
Public key algorithm, also support encryption file size it is variable;AES is Advanced Encryption Standard, is follow-on AES
Standard, speed is fast, and level of security is high, and a realization of current AES standards is Rijndael algorithms.
Available data AES is increasingly intended to complicate, and the demand for software and hardware resources is also increasing, because
This is necessary to find a kind of data ciphering method simple and easy to apply.
The content of the invention
The technical problems to be solved by the invention are to overcome prior art not enough, there is provided a kind of data based on code book
Encryption method, the method is simple and easy to apply, software and hardware resources is taken few.
The present invention specifically uses following technical scheme:
A kind of data ciphering method based on code book, including data encryption and decryption, the encryption of data is specific as follows:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) decimal number is corresponded, so that
Generation code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree for M binary system subsequence, finally not
1 polishing is all used with 0 or all in the part of foot, and M is the integer more than or equal to 8 and less than or equal to N;It is M's to each length
Binary system subsequence, is scaled decimal number, and replace described two with character corresponding with the decimal number in code book
System subsequence;Character string after the completion of all replacing is encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with decimal number corresponding with the character in code book, and will
Each decimal number is converted to the binary number of M, then using resulting binary sequence according to every 8 as a unit
Divided, and last unnecessary part is given up.
In order to further improve the difficulty that cracks of encryption data, the present invention is further drawn in using code book ciphering process
The method for entering " cyclic shift ", so as to obtain following technical scheme:
A kind of data ciphering method based on code book, including data encryption and decryption, the encryption of data is specific as follows:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) a pair of decimal number 1
Should, so as to generate code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree for M binary system subsequence, finally not
1 polishing is all used with 0 or all in the part of foot, and M is the integer more than or equal to 8 and less than or equal to N;It is M's to each length
Binary system subsequence, is scaled decimal number, and right with the S decimal number institute after the decimal number in code book
The character answered replaces the binary system subsequence, and S is that span is [1,2N- 2] integer;Character after the completion of all replacing
Sequence is encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with it is corresponding with the S character before the character in code book
Decimal number, and each decimal number is converted to the binary number of M, then by resulting binary sequence according to every
8 are divided as a unit, and last unnecessary part is given up.
Preferably, the value of N is that the value of 10, M is 9.
Preferably, M is equal to N.
Preferably, the character is spcial character.
Compared to existing technology, the invention has the advantages that:
The present invention effectively reduces algorithm complex on the premise of guaranteeing data security, and improves data encrypting and deciphering
Efficiency;
The present invention makes full use of user's local resource, it is not necessary to data are carried out with cutting in itself, is extracted, directly using password
This is effectively encrypted to data.
Brief description of the drawings
Fig. 1 is a code book example of the invention.
Specific embodiment
Technical scheme is described in detail below in conjunction with the accompanying drawings:
Thinking of the invention is to carry out data encryption using user-defined code book, makes full use of data storage certainly
The sequence of body composition, it is not necessary to by extracting part bit data, or data " upsetting " original is inserted between specific bit
Data storage sequence, but by carrying out " fixed length cutting " to former data sequence, this " fixed length " is generally more than 8bit, so that
Obtain ciphertext and show simpler, succinct, the difficulty that user illegally decrypts is increased significantly.
Data ciphering method of the present invention based on code book, including data encryption and decryption, the encryption of data is specific such as
Under:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) a pair of decimal number 1
Should, so as to generate code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree for M binary system subsequence, finally not
1 polishing is all used with 0 or all in the part of foot, and M is the integer more than or equal to 8 and less than or equal to N;It is M's to each length
Binary system subsequence, is scaled decimal number, and replace described two with character corresponding with the decimal number in code book
System subsequence;Character string after the completion of all replacing is encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with decimal number corresponding with the character in code book, and will
Each decimal number is converted to the binary number of M, then using resulting binary sequence according to every 8 as a unit
Divided, and last unnecessary part is given up.
In order to further improve the difficulty that cracks of encryption data, the present invention can further in using code book ciphering process
The method for introducing " cyclic shift ", i.e., when in password for inquiry, this is encrypted to data, by the way of " password is moved down ", user
One " password is moved down " value S of setting, clear data is write by the S character after corresponding decimal number in code book;The skill
Art scheme is specific as follows:
A kind of data ciphering method based on code book, including data encryption and decryption, the encryption of data is specific as follows:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) a pair of decimal number 1
Should, so as to generate code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree for M binary system subsequence, finally not
1 polishing is all used with 0 or all in the part of foot, and M is the integer more than or equal to 8 and less than or equal to N;It is M's to each length
Binary system subsequence, is scaled decimal number, and right with the S decimal number institute after the decimal number in code book
The character answered replaces the binary system subsequence, and S is that span is [1,2N- 2] integer;Character after the completion of all replacing
Sequence is encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with it is corresponding with the S character before the character in code book
Decimal number, and each decimal number is converted to the binary number of M, then by resulting binary sequence according to every
8 are divided as a unit, and last unnecessary part is given up.
Using the technical scheme, when being decrypted to ciphertext data, to obtain code book, M values and S values could enter to ciphertext
Row effectively decryption, because code book is simple one-to-one relation, so for authorized user, once obtain password
Originally, M values and S values, decryption are compareed one by one.
For the ease of public understanding, technical solution of the present invention is described in detail with a specific embodiment below.
Be-encrypted data in the present embodiment is the 128bit data shown in table 1 below:
Table 1
0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
0 | 0 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 |
The code book generated in the present embodiment is 512 (i.e. 29) individual mutually different spcial character composition, as shown in Figure 1.
User's setting " breakpoint " M values are 9, demarcate former data according to M=9, and 9 part benefit " 0 ", institute are unsatisfactory for final stage
Obtain result as shown in table 2:
Table 2
Dashed region is the situation that final stage mends " 0 " in table 2, naturally it is also possible to supplied with " 1 ";By former data every 9
Position binary system changes into decimal number;Scheme as being not introduced into " cyclic shift " using the first, i.e. " password is moved down " value S's takes
It is 0 (being effectively equivalent to a special case of the second scheme of introducing " cyclic shift ") to be worth, and control code book is encrypted, plus
Ciphertext after close shows as shown in table 3:
Table 3
Former data decimal form | Code book accordingly shows |
188 | σ |
60 | H |
64 | @ |
323 | ì |
380 | 1/4 |
444 | ò |
387 | à |
449 | O |
32 | L |
65 | ^ |
320 | è |
256 | r |
65 | ^ |
188 | σ |
256 | r |
Therefore, the ciphertext that former data are ultimately formed is the ò à OL^er^ σ r of σ H ì 1/4, i.e., the letter being only made up of spcial character
Breath.
If during S=1, control code book is encrypted, and the ciphertext after encryption shows as shown in table 4:
Table 4
Now, the ciphertext that former data are ultimately formed isThe letter being only made up of spcial character
Breath.
When needing decryption, encryption data is converted to by corresponding decimal number sequence according to code book according to S values, and will be every
Individual decimal number is converted to 9 binary expressions, forms binary sequence, finally to binary sequence according to every 8 as one
Individual unit is divided, and last unnecessary part is given up, that is, the data after being decrypted.
Claims (10)
1. the encryption and decryption of a kind of data ciphering method based on code book, including data, it is characterised in that the encryption of data
It is specific as follows:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) decimal number is corresponded,
So as to generate code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree is the binary system subsequence of M, last not enough
1 polishing is all used with 0 or all in part, and M is the integer more than or equal to 8 and less than or equal to N;Two that each length is M are entered
System sequence, is scaled decimal number, and replace the binary system with character corresponding with the decimal number in code book
Subsequence;Character string after the completion of all replacing is encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with decimal number corresponding with the character in code book, and by each
Decimal number is converted to the binary number of M, then carries out resulting binary sequence as a unit according to every 8
Divide, and last unnecessary part is given up.
2. the data ciphering method of code book is based on as claimed in claim 1, it is characterised in that the value of N is 9 for the value of 10, M.
3. the data ciphering method of code book is based on as claimed in claim 1, it is characterised in that M is equal to N.
4. the data ciphering method of code book is based on as claimed in claim 3, it is characterised in that M is equal to 9.
5. the data ciphering method based on code book as described in any one of Claims 1 to 4, it is characterised in that the character is
Spcial character.
6. the encryption and decryption of a kind of data ciphering method based on code book, including data, it is characterised in that the encryption of data
It is specific as follows:
Step 1, selection 2NIndividual different character, and by this 2NIndividual character and 0~(2N- 1) decimal number is corresponded,
So as to generate code book, N is the integer more than 8;
Step 2, the binary sequence of be-encrypted data is divided into one group long degree is the binary system subsequence of M, last not enough
1 polishing is all used with 0 or all in part, and M is the integer more than or equal to 8 and less than or equal to N;Two that each length is M are entered
System sequence, is scaled decimal number, and with corresponding to the S decimal number after the decimal number in code book
Character replaces the binary system subsequence, and S is that span is [1,2N- 2] integer;Character string after the completion of all replacing
As encryption data;
The decryption of data is specific as follows:
Step 3, each character in encryption data is replaced with code book with the S character corresponding ten before the character
System number, and each decimal number is converted to the binary number of M, then by resulting binary sequence according to every 8
Divided as a unit, and last unnecessary part is given up.
7. the data ciphering method of code book is based on as claimed in claim 6, it is characterised in that the value of N is 9 for the value of 10, M.
8. the data ciphering method of code book is based on as claimed in claim 6, it is characterised in that M is equal to N.
9. the data ciphering method of code book is based on as claimed in claim 8, it is characterised in that M is equal to 9.
10. the data ciphering method based on code book as described in any one of claim 6~9, it is characterised in that the character is
Spcial character.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410767831.1A CN104518865B (en) | 2014-12-12 | 2014-12-12 | A kind of data ciphering method based on code book |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410767831.1A CN104518865B (en) | 2014-12-12 | 2014-12-12 | A kind of data ciphering method based on code book |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104518865A CN104518865A (en) | 2015-04-15 |
CN104518865B true CN104518865B (en) | 2017-06-16 |
Family
ID=52793647
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410767831.1A Active CN104518865B (en) | 2014-12-12 | 2014-12-12 | A kind of data ciphering method based on code book |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104518865B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768617A (en) * | 2018-06-06 | 2018-11-06 | 贵州大学 | A kind of holding format encryption method based on legacy packets password |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106452779A (en) * | 2016-08-31 | 2017-02-22 | 福建联迪商用设备有限公司 | Encryption method and apparatus of fingerprint image data |
CN107659399B (en) * | 2017-10-09 | 2021-02-23 | 四川巧夺天工信息安全智能设备有限公司 | Method for disguising and disguising characters based on non-repeated key |
CN111538969A (en) * | 2020-03-30 | 2020-08-14 | 北京万里红科技股份有限公司 | Document encryption method, document decryption device, electronic equipment and medium |
CN113810174A (en) * | 2021-09-16 | 2021-12-17 | 金蝶软件(中国)有限公司 | Data processing method and related equipment |
CN117408857B (en) * | 2023-12-13 | 2024-03-26 | 深圳市海成智联科技有限公司 | Vehicle running chart compiling method based on regional collaboration |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7055037B2 (en) * | 2002-03-06 | 2006-05-30 | National Kaohsiung First University Of Science And Technology | High performance gray-level watermarking system |
CN101056171A (en) * | 2006-06-20 | 2007-10-17 | 华为技术有限公司 | An encryption communication method and device |
CN102904712A (en) * | 2011-07-25 | 2013-01-30 | 深圳市金溢科技有限公司 | Information encrypting method |
CN103580854A (en) * | 2013-10-30 | 2014-02-12 | 上海朗研光电科技有限公司 | Dynamic codebook management method for quantum secret communication system |
-
2014
- 2014-12-12 CN CN201410767831.1A patent/CN104518865B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7055037B2 (en) * | 2002-03-06 | 2006-05-30 | National Kaohsiung First University Of Science And Technology | High performance gray-level watermarking system |
CN101056171A (en) * | 2006-06-20 | 2007-10-17 | 华为技术有限公司 | An encryption communication method and device |
CN102904712A (en) * | 2011-07-25 | 2013-01-30 | 深圳市金溢科技有限公司 | Information encrypting method |
CN103580854A (en) * | 2013-10-30 | 2014-02-12 | 上海朗研光电科技有限公司 | Dynamic codebook management method for quantum secret communication system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768617A (en) * | 2018-06-06 | 2018-11-06 | 贵州大学 | A kind of holding format encryption method based on legacy packets password |
CN108768617B (en) * | 2018-06-06 | 2021-02-23 | 贵州大学 | Format-preserving encryption method based on traditional block cipher |
Also Published As
Publication number | Publication date |
---|---|
CN104518865A (en) | 2015-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104518865B (en) | A kind of data ciphering method based on code book | |
Kumar et al. | Development of modified AES algorithm for data security | |
Goyal et al. | Modified caesar cipher for better security enhancement | |
Ye et al. | A secure image encryption algorithm based on chaotic maps and SHA‐3 | |
CN105099652A (en) | Data encryption and decryption method and devices | |
CN110704854B (en) | Stream type encryption method aiming at text data reserved format | |
CN108173640A (en) | The character string symmetric cryptography and decryption method of a kind of high security | |
CN109861810A (en) | A kind of data ciphering method and decryption method based on chaos Tuber yield | |
CN103414727A (en) | Encryption protection system for input password input box and using method thereof | |
KR101095386B1 (en) | A Cryptosystem with a Discretized Chaotic Map | |
CN104038336A (en) | Data encryption method based on 3DES | |
CN107248915A (en) | A kind of method for the data message dynamic encryption for preventing from being decrypted by violence | |
CN104113410B (en) | Method and device for data encryption transmission based on multi-table encryption method | |
CN101022331B (en) | Chaos encrypting method based on carrier | |
CN102013974B (en) | Randomly varying nonlinear step-based encryption method | |
EP2960891B1 (en) | Method for introducing dependence of white-box implementationon a set of strings | |
CN106357608A (en) | Method for encrypting and decrypting private data for personal healthcare data | |
US10412054B2 (en) | Method for introducing dependence of white-box implementation on a set of strings | |
CN102882675A (en) | Password encryption method for social network sites | |
CN110601817B (en) | Data processing method and device | |
CN104038337A (en) | Data encryption method based on AES128 | |
Yang et al. | A novel chaotic block cryptosystem based on iterating map with output-feedback | |
Choudhury et al. | Comparative analysis of different modified advanced encryption standard algorithms over conventional advanced encryption standard algorithm | |
Disina et al. | Enhanced caeser cipher to exclude repetition and withstand frequency cryptanalysis | |
CN112422278A (en) | Byte-oriented random multi-table replacement encryption and decryption method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |