CN109347622A - A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm - Google Patents
A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm Download PDFInfo
- Publication number
- CN109347622A CN109347622A CN201811123518.9A CN201811123518A CN109347622A CN 109347622 A CN109347622 A CN 109347622A CN 201811123518 A CN201811123518 A CN 201811123518A CN 109347622 A CN109347622 A CN 109347622A
- Authority
- CN
- China
- Prior art keywords
- memory
- data
- encryption
- length
- plaintext
- 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.)
- Withdrawn
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/04—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
- H04L63/0428—Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0625—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/14—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
Abstract
The invention discloses a kind of methods of reversible anti-tamper encryption and decryption data based on encryption and digest algorithm, and main component part is: 2 equipment on network, are used for encrypting and decrypting data.The discreteness of MD5 and the invertibity of DES are combined in the present invention, so that encrypted ciphertext increases safety in network transmission process, it is transmitted again after preventing ciphertext to be tampered in network transmission process, have tamper-resistance properties, ciphertext can be decrypted to obtain clear data after correct terminal receives simultaneously, that is, have invertibity.
Description
Technical field
The invention belongs to computer communication fields, are related to a kind of reversible anti-tamper encryption and decryption based on encryption and digest algorithm
The method of data.
Background technique
In the Internet era of high speed development, data are transmitted on the various network equipments.Mistake of the data in transmission
It is exposed in journey in the various network equipments.Data, which exist, to be intercepted by the network equipment, decrypts, distorting, then is transmitted
Risk.In order to improve safety of the data in network equipment transmission process, more complicated encryption and decryption data is used to data
Aobvious particularly important of algorithm.
MD5 Message Digest 5 full name is Message-Digest Algorithm 5, and being that computer is widely used dissipates
One of column algorithm, the characteristic having are as follows: 1) irreversible not have systematic method that calculate by the end value of MD5
The original plaintext message content of MD5;2) discreteness does not have rule that can follow, the MD5 result that the seldom variation of raw information generates
Value has huge variation.
Des encryption algorithm full name is Data Encryption Standard, is a kind of block algorithm encrypted using key.
The characteristic having is as follows: 1) ciphertext that invertibity is calculated by the Encryption Algorithm of DES in plain text as a result, can be by solving accordingly
Ciphertext is decrypted original clear data by close algorithm
It can learn that MD5 algorithm has irreversibility from above 2 kinds of characteristics, what clear data obtained after MD5 algorithm plucks
Information is wanted, can not be decrypted by summary info in plain text.The ciphertext that clear data goes out through DES algorithm for encryption, once it is intercepted, it can
Ciphertext is decrypted in plain text by corresponding decipherment algorithm, is unable to ensure the safety of data.
Summary of the invention
The present invention is to solve the deficiency of above-mentioned technology, provides a kind of reversible anti-tamper plus solution based on encryption and digest algorithm
The method of ciphertext data.
The technical solution adopted by the present invention to solve the technical problems comprises the following specific steps that:
Step (1), the size that application memory EB and EC is calculated according to plaintext string EA to be encrypted, if plaintext character
The multiple that the length EALen of string EA is 8, then the length EALen that memory EB and EC size are plaintext string EA;If plaintext word
The length EALen of symbol string EA is not 8 multiple, then the size of memory EB and EC isThat is plaintext word
The length EALen of symbol string EA adds 1 after being rounded downwards divided by 8, multiplied by 8;
The data of the memory EB and EC of application are all set 0 by step (2), by the content copy of character string EA to memory EB
In
Step (3) is encrypted the data in memory EB by the data of every 8 bytes with DES algorithm, and encryption is tied
There are in memory EC for fruit;
Data in memory EB are calculated the summary info of 16 bytes as a result, and will pluck with MD5 algorithm by step (4)
Information result is wanted to exist in newly-built memory ED;
Step (5) is successively mixed the data of memory EC and memory ED by the data of 1 byte EC and 1 byte ED
Conjunction is stored in newly-built memory EE, and because the internal storage data length of EC and ED may be different, extra memory block data are deposited
It is placed on the ending of EE, i.e. data in memory EE are ED1EC1ED2EC2…ECn-1ECnOr ED1EC1ED2EC2…EDn-1EDn
Each byte data in memory EE is formatted output by 16 systems and at 2 can show character by step (6)
Data are stored in character string EF, and character string EF is encrypted final result data;
The above content be encrypting step, below be decryption step
Encrypted ciphertext character string EF is converted to binary data and is stored in memory DB by step (7), the length of DB
Degree is the length of character string EF divided by 2;
Data in memory DB are successively dividedly stored in memory by the sequence of 1 byte DC, 1 byte DD by step (8)
In DC and DD, memory DC is that the summary info value length through MD5 is 16 bytes in plain text, and memory DD is in plain text after des encryption
Ciphertext;
Every 8 bytes of ciphertext in memory DD are decrypted step (9) with DES algorithm, and the plaintext after decryption is stored
In memory DE;
Step (10), DD is decrypted after plaintext DE calculate summary info with MD5 algorithm and be stored in memory DF;
Step (11), by what is calculated from plaintext DE after the MD5 digest value of information DC that is taken out in DB and decryption with MD5
Summary info value DF is compared, if the internal storage data of DC and DF is identical, successful decryption illustrates the ciphertext data received
It is unmodified, obtain clear data DE;If the internal storage data of DC and DF is different, illustrate the ciphertext data exception received, no
It can normally parse.
The present invention has the beneficial effect that:
The discreteness of MD5 and the invertibity of DES are combined in the present invention, so that encrypted ciphertext is in network transmission process
In increase safety, transmitted again after preventing ciphertext to be tampered in network transmission process, that is, have tamper-resistance properties, simultaneously
Ciphertext can be decrypted to obtain clear data after correct terminal receives, that is, have invertibity.
Specific embodiment
The present invention is further illustrated below.
A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm, main component part is:
2 equipment on network are used for encrypting and decrypting data;
A kind of method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm comprises the concrete steps that:
Step (1), equipment 1 take the length EALen of plaintext string EA, are calculated according to the length EALen of character string EA
Apply for the size of the EB and EC of memory, if the size of the multiple that EALen is 8, EB and EC are EALen;If the length of EALen
Degree is not 8 multiple, then the size of EB and EC isThat is the length EALen of plaintext string EA is removed
After being rounded downwards with 8 plus 1, multiplied by 8, SEPARATE APPLICATION 2 pieces of memories EB and EC;
The memory EB and EC of application are all set 0 by step (2), and the string content of EA is copied in memory EB
Step (3) is encrypted the data in memory EB by the data of every 8 bytes with DES algorithm, and encryption is tied
There are in memory EC for fruit
Data in memory EB are calculated the summary info of 16 bytes as a result, and will pluck with MD5 algorithm by step (4)
Wanting information result, there are in memory ED
Step (5) is successively mixed the data of memory EC and memory ED by the data of 1 byte EC and 1 byte ED
Conjunction is stored in memory EE, and because the internal storage data length of EC and ED may be different, extra memory block data are stored in EE
Ending, i.e. data in memory EE are ED1EC1ED2EC2…ECn-1ECnOr ED1EC1ED2EC2…EDn-1EDn
Each byte data in memory EE is formatted output by 16 systems and at 2 can show character by step (6)
Data are stored in character string EF, and character string EF is encrypted final result data
Step (7), equipment 1 are by encrypted final result character string EF by network transmission to equipment 2;
After step (8), equipment 2 receive encrypted ciphertext character string EF, EF is converted to binary data and is stored
In memory DB, the length of DB is the length of character string EF divided by 2;
Data in memory DB are successively dividedly stored in memory by the sequence of 1 byte DC, 1 byte DD by step (9)
In DC and DD, memory DC is that the summary info value length through MD5 is 16 bytes in plain text, and memory DD is in plain text after des encryption
Ciphertext;
Every 8 bytes of ciphertext in memory DD are decrypted step (10) with DES algorithm, and the plaintext after decryption is deposited
It is placed in memory DE;
Step (11), DD is decrypted after plaintext DE calculate summary info with MD5 algorithm and be stored in memory DF;
Step (12), by what is calculated from plaintext DE after the MD5 digest value of information DC that is taken out in DB and decryption with MD5
Summary info value DF is compared, if the internal storage data of DC and DF is identical, successful decryption illustrates the ciphertext data received
It is unmodified, obtain clear data DE;If the internal storage data of DC and DF is different, illustrate the data exception received.
Claims (2)
1. a kind of method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm, it is characterised in that encrypted packet
Include following steps:
Step (1), the size that application memory EB and EC is calculated according to plaintext string EA to be encrypted, if plaintext string EA
Length EALen be 8 multiple, then memory EB and EC size are the length EALen of plaintext string EA;If plaintext string
The length EALen of EA is not 8 multiple, then the size of memory EB and EC isThat is plaintext string
The length EALen of EA adds 1 after being rounded downwards divided by 8, multiplied by 8;
The data of the memory EB and EC of application are all set 0 by step (2), by the content copy of character string EA into memory EB
Data in memory EB are encrypted by the data of every 8 bytes with DES algorithm, and encrypted result are deposited by step (3)
In memory EC;
Data in memory EB are calculated the summary info of 16 bytes as a result, and believing abstract with MD5 algorithm by step (4)
Result is ceased to exist in newly-built memory ED;
The data of memory EC and memory ED are successively carried out mixing depositing by step (5) by the data of 1 byte EC and 1 byte ED
It is placed in newly-built memory EE, because the internal storage data length of EC and ED may be different, extra memory block data is stored in
The ending of EE, i.e. data in memory EE are ED1EC1ED2EC2…ECn-1ECnOr ED1EC1ED2EC2…EDn-1EDn
Step (6), by each byte data in memory EE by 16 systems be formatted output can Display Characters Per Frame evidence at 2
It is stored in character string EF, character string EF is encrypted final result data.
2. a kind of method of reversible anti-tamper encryption and decryption data based on encryption and digest algorithm according to claim 1,
It is characterized in that ciphertext data includes following steps:
Encrypted ciphertext character string EF is converted to binary data and is stored in memory DB by step (7), and the length of DB is
The length of character string EF is divided by 2;
Step (8), by the data in memory DB by the sequence of 1 byte DC, 1 byte DD be successively dividedly stored in memory DC and
In DD, memory DC is that the summary info value length through MD5 is 16 bytes in plain text, and memory DD is close after des encryption in plain text
Text;
Every 8 bytes of ciphertext in memory DD are decrypted step (9) with DES algorithm, the plaintext after decryption are stored in interior
It deposits in DE;
Step (10), DD is decrypted after plaintext DE calculate summary info with MD5 algorithm and be stored in memory DF;
Step (11), will be from the abstract that plaintext DE is calculated with MD5 after the MD5 digest value of information DC that takes out in DB and decryption
Value of information DF is compared, if the internal storage data of DC and DF is identical, successful decryption illustrates that the ciphertext data received are not repaired
Change, obtains clear data DE;If the internal storage data of DC and DF is different, illustrate the ciphertext data exception received, Bu Nengzheng
Often parsing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811123518.9A CN109347622A (en) | 2018-09-26 | 2018-09-26 | A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811123518.9A CN109347622A (en) | 2018-09-26 | 2018-09-26 | A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109347622A true CN109347622A (en) | 2019-02-15 |
Family
ID=65306968
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811123518.9A Withdrawn CN109347622A (en) | 2018-09-26 | 2018-09-26 | A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109347622A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101692636A (en) * | 2009-10-27 | 2010-04-07 | 中山爱科数字科技有限公司 | Data element and coordinate algorithm-based method and device for encrypting mixed data |
US20100268957A1 (en) * | 2007-10-29 | 2010-10-21 | Nippon Telegraph And Telephone Corporation | Signature generating apparatus, signature verifying apparatus, and methods and programs therefor |
CN102497377A (en) * | 2011-12-15 | 2012-06-13 | 武汉理工大学 | Method for remote-monitoring data safety transmission of fuel cell standby power supply of communication base station |
US8538030B1 (en) * | 2007-09-06 | 2013-09-17 | Elcomsoft Co., Ltd. | Use of graphics processors as parallel math co-processors for password recovery |
CN104125056A (en) * | 2014-08-07 | 2014-10-29 | 肖龙旭 | Data encryption and decryption method |
CN104468621A (en) * | 2014-12-22 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | Method for improving password safety degree and encryption device thereof |
CN107257282A (en) * | 2017-05-18 | 2017-10-17 | 柚子(北京)移动技术有限公司 | A kind of full bag encryption method of code based on RC4 algorithms |
-
2018
- 2018-09-26 CN CN201811123518.9A patent/CN109347622A/en not_active Withdrawn
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8538030B1 (en) * | 2007-09-06 | 2013-09-17 | Elcomsoft Co., Ltd. | Use of graphics processors as parallel math co-processors for password recovery |
US20100268957A1 (en) * | 2007-10-29 | 2010-10-21 | Nippon Telegraph And Telephone Corporation | Signature generating apparatus, signature verifying apparatus, and methods and programs therefor |
CN101692636A (en) * | 2009-10-27 | 2010-04-07 | 中山爱科数字科技有限公司 | Data element and coordinate algorithm-based method and device for encrypting mixed data |
CN102497377A (en) * | 2011-12-15 | 2012-06-13 | 武汉理工大学 | Method for remote-monitoring data safety transmission of fuel cell standby power supply of communication base station |
CN104125056A (en) * | 2014-08-07 | 2014-10-29 | 肖龙旭 | Data encryption and decryption method |
CN104468621A (en) * | 2014-12-22 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | Method for improving password safety degree and encryption device thereof |
CN107257282A (en) * | 2017-05-18 | 2017-10-17 | 柚子(北京)移动技术有限公司 | A kind of full bag encryption method of code based on RC4 algorithms |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105659240B (en) | It is a kind of for sending and authentication URL is signed to carry out URL certifications in self adaptation stream and the system and method for the content access authorization based on URL | |
CN103457718B (en) | The part ciphertext of variable-length segmentation and fixing block encryption is used to upgrade | |
CN104255009A (en) | Systems and methods for segment integrity and authenticity for adaptive streaming | |
US20100150344A1 (en) | Methods and devices for a chained encryption mode | |
CN109840425B (en) | File encryption method and device | |
CN110401677B (en) | Method and device for acquiring digital copyright key, storage medium and electronic equipment | |
US20170033921A1 (en) | Encoding Values by Pseudo-Random Mask | |
JP6782864B2 (en) | Devices and methods for calculating block ciphers | |
EP2996278B1 (en) | Remapping constant points in a white-box implementation | |
EP3169017B1 (en) | Split-and-merge approach to protect against dfa attacks | |
RU2666281C2 (en) | Electronic block cipher device suitable for obfuscation | |
CN107911210B (en) | Video segment encryption and decryption method and related device | |
US9485226B2 (en) | Method for including an implicit integrity or authenticity check into a white-box implementation | |
CN110019075B (en) | Log encryption method and device and log decryption method and device | |
EP3226164B1 (en) | Watermarking input and output of a white-box implementation | |
Nazarkevych et al. | Data protection based on encryption using Ateb-functions | |
EP2960891B1 (en) | Method for introducing dependence of white-box implementationon a set of strings | |
EP3035584A1 (en) | Using single white-box implementation with multiple external encodings | |
CN114338648A (en) | SFTP multi-terminal file secure transmission method and system based on state cryptographic algorithm | |
US10412054B2 (en) | Method for introducing dependence of white-box implementation on a set of strings | |
CN112947967A (en) | Software updating method, block chain application store and software uploading terminal | |
EP3413509B1 (en) | Cmac computation using white-box implementations with external encodings | |
CN109347622A (en) | A method of the reversible anti-tamper encryption and decryption data based on encryption and digest algorithm | |
CN108270771A (en) | A kind of shellcode encoding and decoding deformation method | |
CN106357382A (en) | Encryption method and system for network data transmission |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190215 |
|
WW01 | Invention patent application withdrawn after publication |