CN106131049A - A kind of method of data transmission encryption and decryption - Google Patents
A kind of method of data transmission encryption and decryption Download PDFInfo
- Publication number
- CN106131049A CN106131049A CN201610668761.3A CN201610668761A CN106131049A CN 106131049 A CN106131049 A CN 106131049A CN 201610668761 A CN201610668761 A CN 201610668761A CN 106131049 A CN106131049 A CN 106131049A
- Authority
- CN
- China
- Prior art keywords
- data
- secret key
- encryption
- string
- key
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- 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
- H04L63/0442—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 wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
-
- 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
- H04L63/045—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 wherein the sending and receiving network entities apply hybrid encryption, i.e. combination of symmetric and asymmetric encryption
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Storage Device Security (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention provides the method for a kind of data transmission encryption and decryption, and described method defines a secret key string in code, centered by this secret key string, is encrypted data, decryption oprerations;Described cryptographic operation: secret key string, and character string to be encrypted carries out carry digit coding, then by logical operations, finally carries out base64 coding and obtains the character string of encryption;Described decryption oprerations: secret key string, and character string to be deciphered carries out carry digit coding, then by logical operations, finally carries out base64 decoding and obtains the data of deciphering.The arithmetic logic of present invention encryption and deciphering is mutually symmetry, convenient amendment logic rule;Data can be stoped fast and effectively to be stolen by the way of amendment encryption logic rule and secret key.
Description
Technical field
The present invention relates to payment terminal technical field, the method particularly relating to a kind of data transmission encryption and decryption.
Background technology
There are into hundred more than one hundred million network address on the Internet, some, towards the open request of masses, goes back some the most non-public
, intra-company uses, and some data is the most precious, if be stolen, it is possible to influence whether that company gets a profit.
For a long time, people have invented various encryption method, and for ease of research, it is right generally these methods to be divided into
Claim encryption method and the big class of asymmet-ric encryption method two.The former common feature is to use single key technology, and i.e. encryption is with decrypted
Journey uses same key, so it is also referred to as symmetry encryption method;And the common feature of the latter is to use conbined public or double key technology, also
Being exactly two different keys of use in encryption and decryption processes, it is also referred to as unsymmetrical tridiagonal matrix method.
Summary of the invention
The technical problem to be solved in the present invention, is that the arithmetic logic providing a kind of present invention encryption and deciphering is the most paired
Claim, convenient amendment logic rule;Data can be stoped fast and effectively stolen by the way of amendment encryption logic rule and secret key
Take.
The present invention is achieved in that the method for a kind of data transmission encryption and decryption, and described method defines one in code
Data centered by this secret key string, are encrypted, decryption oprerations by secret key string;
Described cryptographic operation: secret key string, and character string to be encrypted carries out carry digit coding, is then transported by logic
Calculate, finally carry out base64 coding and obtain the character string of encryption;
Described decryption oprerations: secret key string, and character string to be deciphered carries out carry digit coding, is then transported by logic
Calculate, finally carry out base64 decoding and obtain the data of deciphering.
Further, described cryptographic operation particularly as follows:
First definition secret key string, splicing timestamp the same day date format and random number obtain dynamic secret key, so make number
Result after encrypting according to every day is the most different, increases disabled user and deciphers difficulty;One time configuration file is set again;Secondly circulation
Traversal, the string one_to_one corresponding in the content that will encrypt and dynamic secret key, it is encrypted, encryption data is changed into decimal number different
Or the result that computing obtains adds operational rule;Furthermore comparison ASCII character synopsis obtains corresponding character, to final result
Carry out base_64 coding and obtain the character string of encryption.
Further, described decryption oprerations particularly as follows:
First obtain the content of described time configuration file, inquire about the dynamic secret key on the same day, secondly to adding confidential information base64
Decoding, searching loop, the string one_to_one corresponding in the content that will encrypt and dynamic secret key, it is decrypted;Change into solving ciphertext data
The result that decimal number XOR obtains adds the computing of inverse rule, furthermore comparison ASCII character synopsis obtains corresponding character,
Obtain last solution ciphertext data.
Further, described cryptographic operation is further: definition secret key string $ key, the date format on the same day of splicing timestamp
And random number obtains dynamic secret key, dynamic key key=$ key.time (' m '-' d ') .rand (111,999);Dynamic key
Key is stored in a time configuration file config.php as value, and key form is the date on the same day;Circulation carries out decimal scale to information
XOR and other operational rules, $ Sum=(ord ($ data{ $ i}) ^ord ($ char{ $ i}))+299;To encrypted result
Change into ASCII information chr ($ sum) of correspondence;Finally to the convenient transmission of operation result base64 coding obtained: Base64_
encode(chr($sum))。
Further, described decryption oprerations is further: obtain time configuration file config.php information, inquires about the same day
Value under date;Obtain dynamic secret key key, the content of encryption is carried out base64 position decoding $ data=Base64_encode ($
data);Circulation carries out reverse operation $ Sum=(ord (the $ data of decimal scale XOR and other rule-based algorithm to information
{$i}-299)^ord($char{$i}));Encrypted result changes into ASCII information chr (sum) of correspondence, is finally deciphered number
According to.
Present invention have the advantage that the arithmetic logic of 1. encryptions and deciphering is mutually symmetry, convenient amendment encryption and deciphering
Logic rule.If after 2. system interface rule is known by external staff, can be by amendment encryption logic rule and secret key
Mode, stops data to be stolen fast and effectively.3. code architecture, is not take up resource.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet that the present invention encrypts.
Fig. 2 is the schematic flow sheet that the present invention deciphers.
Detailed description of the invention
Referring to shown in Fig. 1 and Fig. 2, the method for a kind of data transmission encryption and decryption of the present invention, described method is in code
Define a secret key string, centered by this secret key string, data are encrypted, decryption oprerations;
Described cryptographic operation: secret key string, and character string to be encrypted carries out carry digit coding, is then transported by logic
Calculate, finally carry out base64 coding and obtain the character string of encryption;
Described decryption oprerations: secret key string, and character string to be deciphered carries out carry digit coding, is then transported by logic
Calculate, finally carry out base64 decoding and obtain the data of deciphering.
Wherein, described cryptographic operation particularly as follows:
First definition secret key string, splicing timestamp the same day date format and random number obtain dynamic secret key, so make number
Result after encrypting according to every day is the most different, increases disabled user and deciphers difficulty;One time configuration file is set again;Secondly circulation
Traversal, the string one_to_one corresponding in the content that will encrypt and dynamic secret key, it is encrypted, encryption data is changed into decimal number different
Or the result that computing obtains adds operational rule;Furthermore comparison ASCII character synopsis obtains corresponding character, to final result
Carry out base_64 coding and obtain the character string of encryption.
Described decryption oprerations particularly as follows:
First obtain the content of described time configuration file, inquire about the dynamic secret key on the same day, secondly to adding confidential information base64
Decoding, searching loop, the string one_to_one corresponding in the content that will encrypt and dynamic secret key, it is decrypted;Change into solving ciphertext data
The result that decimal number XOR obtains adds the computing of inverse rule, furthermore comparison ASCII character synopsis obtains corresponding character,
Obtain last solution ciphertext data.
It addition, in the present invention, described cryptographic operation is further: definition secret key string $ key, $ key=
6f28fbe9e039a99d3d83908045bc8058;Splicing timestamp the same day date format and random number obtain the closeest
Spoon, dynamic key key=$ key.time (' m '-' d ') .rand (111,999);Dynamic key key is stored in the time as value
Configuration file config.php, key form is date on the same day, such as form: 7-21;Circulation carries out decimal scale XOR fortune to information
Calculate and other operational rules, $ Sum=(ord ($ data{ $ i}) ^ord ($ char{ $ i}))+299;(wherein $ data array class
Type, storage needs the data of encryption, $ i code array index, $ char array type variable, stores secret key data), to encryption knot
Fruit changes into ASCII information chr ($ sum) of correspondence;Finally to the convenient transmission of operation result base64 coding obtained: Base64_
encode(chr($sum))。
Described decryption oprerations is further: obtain time configuration file config.php information, under the inquiry date on the same day
Value;Example array (
' 7-20 '=> 6f28fbe9e039a99d3d8390804585opik
' 7-21 '=> 6f28fbe9e039a99d3d83908045bc8058
Obtain dynamic secret key key, the content of encryption is carried out base64 position decoding $ data=Base64_encode ($
data);Circulation carries out reverse operation $ Sum=(ord (the $ data of decimal scale XOR and other rule-based algorithm to information
{$i}-299)^ord($char{$i}));(wherein $ data array type, storage needs the data of encryption, under $ i code array
Mark, $ char array type variable, store secret key data) encrypted result change into correspondence ASCII information chr ($ sum), obtain
Solve ciphertext data eventually.
In a word, the present invention by a set of can the algorithm of encrypting and decrypting, data are encrypted transmission, even if the other side knows number
According to interface network address, owing to the present invention also can not obtain data to this network address Transfer Parameters by rule, thereby ensure that
The safety of data.
The foregoing is only presently preferred embodiments of the present invention, all impartial changes done according to scope of the present invention patent with
Modify, all should belong to the covering scope of the present invention.
Claims (5)
1. the method for a data transmission encryption and decryption, it is characterised in that: described method defines a secret key string in code, with this
Centered by secret key string, data are encrypted, decryption oprerations;
Described cryptographic operation: secret key string, and character string to be encrypted carries out carry digit coding, then by logical operations,
After carry out base64 coding obtain encryption character string;
Described decryption oprerations: secret key string, and character string to be deciphered carries out carry digit coding, then by logical operations,
After carry out base64 decoding obtain deciphering data.
The method of a kind of data the most according to claim 1 transmission encryption and decryption, it is characterised in that: described cryptographic operation is concrete
For:
First definition secret key string, splicing timestamp the same day date format and random number obtain dynamic secret key, so make data every
Result after it encryption is the most different, increases disabled user and deciphers difficulty;One time configuration file is set again;Secondly circulation time
Go through, the string one_to_one corresponding in the content that will encrypt and dynamic secret key, be encrypted, encryption data is changed into decimal number XOR
The result that computing obtains adds operational rule;Furthermore comparison ASCII character synopsis obtains corresponding character, enters final result
Row base_64 coding obtains the character string of encryption.
The method of a kind of data the most according to claim 2 transmission encryption and decryption, it is characterised in that: described decryption oprerations is concrete
For:
First obtain the content of described time configuration file, inquire about the dynamic secret key on the same day, secondly to adding confidential information base64 decoding,
String one_to_one corresponding in searching loop, the content that will encrypt and dynamic secret key, is decrypted;Decimal scale is changed into solving ciphertext data
The result that number XOR obtains adds the computing of inverse rule, furthermore comparison ASCII character synopsis obtains corresponding character, obtains
Solve ciphertext data eventually.
The method of a kind of data the most according to claim 2 transmission encryption and decryption, it is characterised in that: described cryptographic operation enters one
Step is: definition secret key string $ key, splicing timestamp the same day date format and random number obtain dynamic secret key, dynamic key
Key=$ key.time (' m '-' d ') .rand (111,999);Dynamic key key is stored in a time configuration file as value
Config.php, key form is the date on the same day;Circulation carries out decimal scale XOR and other operational rules, $ to information
Sum=(ord ($ data{ $ i}) ^ord ($ char{ $ i}))+299;Encrypted result is changed into the ASCII information chr ($ of correspondence
sum);Finally to the convenient transmission of operation result base64 coding obtained: Base64_encode (chr (sum)).
The method of a kind of data the most according to claim 3 transmission encryption and decryption, it is characterised in that: described decryption oprerations enters one
Step is: obtain time configuration file config.php information, the value under the inquiry date on the same day;Obtain dynamic secret key key, to encryption
Content carry out base64 position decoding $ data=Base64_encode ($ data);Circulation carries out decimal scale XOR fortune to information
Calculate and the reverse operation $ Sum=(ord ($ data{ $ i}-299) ^ord ($ char{ $ i})) of other rule-based algorithm;Encryption knot
Fruit changes into ASCII information chr ($ sum) of correspondence, obtains last solution ciphertext data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610668761.3A CN106131049A (en) | 2016-08-15 | 2016-08-15 | A kind of method of data transmission encryption and decryption |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610668761.3A CN106131049A (en) | 2016-08-15 | 2016-08-15 | A kind of method of data transmission encryption and decryption |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106131049A true CN106131049A (en) | 2016-11-16 |
Family
ID=57258165
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610668761.3A Pending CN106131049A (en) | 2016-08-15 | 2016-08-15 | A kind of method of data transmission encryption and decryption |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106131049A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106789975A (en) * | 2016-12-07 | 2017-05-31 | 广东京奥信息科技有限公司 | A kind of method of the text encryption transmission with byte stream is preserved |
| CN107196946A (en) * | 2017-06-01 | 2017-09-22 | 广东网金控股股份有限公司 | A kind of safety certifying method logged in based on barcode scanning and system |
| CN107491686A (en) * | 2017-07-06 | 2017-12-19 | 微梦创科网络科技(中国)有限公司 | A kind of encryption and decryption method and device of sliding trace background picture |
| CN108259407A (en) * | 2016-12-28 | 2018-07-06 | 航天信息股份有限公司 | A kind of symmetric encryption method and system based on timestamp |
| CN109447419A (en) * | 2018-09-30 | 2019-03-08 | 四川长虹电器股份有限公司 | A kind of hotel's wisdom energy managing and control system based on contract |
| CN112235098A (en) * | 2020-09-17 | 2021-01-15 | 成都万江港利科技股份有限公司 | A Simple and Fast Communication Encryption and Decryption Algorithm |
| CN115174253A (en) * | 2022-07-19 | 2022-10-11 | 北京计算机技术及应用研究所 | ADS _ B system data encryption method |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1863042A (en) * | 2005-12-13 | 2006-11-15 | 华为技术有限公司 | Method for information encryption |
| CN101309293A (en) * | 2008-06-27 | 2008-11-19 | 中国网络通信集团公司 | Authentication Method and Authentication System Based on Hypertext Transfer Protocol |
| CN102231707A (en) * | 2011-06-27 | 2011-11-02 | 中国建设银行股份有限公司 | Method and system for reliably transmitting data message in bank outlets |
| CN103067160A (en) * | 2013-01-14 | 2013-04-24 | 江苏智联天地科技有限公司 | Method and system of generation of dynamic encrypt key of encryption secure digital memory card (SD) |
| US20130339252A1 (en) * | 2008-05-02 | 2013-12-19 | Matthew J. Pauker | Format-preserving cryptographic systems |
| CN103685181A (en) * | 2012-09-13 | 2014-03-26 | 北京大唐高鸿软件技术有限公司 | Key negotiation method based on SRTP |
| CN104469757A (en) * | 2014-12-25 | 2015-03-25 | 上海迈外迪网络科技有限公司 | Safe logging-in method |
| CN105812146A (en) * | 2016-05-26 | 2016-07-27 | 王云鹏 | MD5-based two-way encryption data protection method |
-
2016
- 2016-08-15 CN CN201610668761.3A patent/CN106131049A/en active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1863042A (en) * | 2005-12-13 | 2006-11-15 | 华为技术有限公司 | Method for information encryption |
| US20130339252A1 (en) * | 2008-05-02 | 2013-12-19 | Matthew J. Pauker | Format-preserving cryptographic systems |
| CN101309293A (en) * | 2008-06-27 | 2008-11-19 | 中国网络通信集团公司 | Authentication Method and Authentication System Based on Hypertext Transfer Protocol |
| CN102231707A (en) * | 2011-06-27 | 2011-11-02 | 中国建设银行股份有限公司 | Method and system for reliably transmitting data message in bank outlets |
| CN103685181A (en) * | 2012-09-13 | 2014-03-26 | 北京大唐高鸿软件技术有限公司 | Key negotiation method based on SRTP |
| CN103067160A (en) * | 2013-01-14 | 2013-04-24 | 江苏智联天地科技有限公司 | Method and system of generation of dynamic encrypt key of encryption secure digital memory card (SD) |
| CN104469757A (en) * | 2014-12-25 | 2015-03-25 | 上海迈外迪网络科技有限公司 | Safe logging-in method |
| CN105812146A (en) * | 2016-05-26 | 2016-07-27 | 王云鹏 | MD5-based two-way encryption data protection method |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106789975A (en) * | 2016-12-07 | 2017-05-31 | 广东京奥信息科技有限公司 | A kind of method of the text encryption transmission with byte stream is preserved |
| CN108259407A (en) * | 2016-12-28 | 2018-07-06 | 航天信息股份有限公司 | A kind of symmetric encryption method and system based on timestamp |
| CN108259407B (en) * | 2016-12-28 | 2020-09-11 | 航天信息股份有限公司 | Symmetric encryption method and system based on timestamp |
| CN107196946A (en) * | 2017-06-01 | 2017-09-22 | 广东网金控股股份有限公司 | A kind of safety certifying method logged in based on barcode scanning and system |
| CN107491686A (en) * | 2017-07-06 | 2017-12-19 | 微梦创科网络科技(中国)有限公司 | A kind of encryption and decryption method and device of sliding trace background picture |
| CN109447419A (en) * | 2018-09-30 | 2019-03-08 | 四川长虹电器股份有限公司 | A kind of hotel's wisdom energy managing and control system based on contract |
| CN112235098A (en) * | 2020-09-17 | 2021-01-15 | 成都万江港利科技股份有限公司 | A Simple and Fast Communication Encryption and Decryption Algorithm |
| CN112235098B (en) * | 2020-09-17 | 2023-02-10 | 成都万江港利科技股份有限公司 | A Simple and Rapid Communication Encryption and Decryption Method |
| CN115174253A (en) * | 2022-07-19 | 2022-10-11 | 北京计算机技术及应用研究所 | ADS _ B system data encryption method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106131049A (en) | A kind of method of data transmission encryption and decryption | |
| JP6363032B2 (en) | Key change direction control system and key change direction control method | |
| US10733317B2 (en) | Searchable encryption processing system | |
| US20100202606A1 (en) | Two strings private key (symmetric) encryption and decryption method | |
| US11101980B2 (en) | System and method for adding and comparing integers encrypted with quasigroup operations in AES counter mode encryption | |
| CN108768617A (en) | A kind of holding format encryption method based on legacy packets password | |
| CN107078906A (en) | Public key encryp | |
| CN114430321B (en) | DFA self-adaptive security-based black box traceable key attribute encryption method and device | |
| WO2019223170A1 (en) | Encryption method and apparatus, and computer device and storage medium | |
| CN105721146A (en) | Big data sharing method for cloud storage based on SMC | |
| Vaishali et al. | A DNA cryptosystem using Diffie–Hellman key exchange | |
| Dawson et al. | Ensuring privacy and confidentiality of cloud data: A comparative analysis of diverse cryptographic solutions based on run time trend | |
| CN102497270A (en) | Encryption method of standardized document | |
| Singamaneni et al. | [Retracted] An Enhanced Dynamic Nonlinear Polynomial Integrity‐Based QHCP‐ABE Framework for Big Data Privacy and Security | |
| Lavanya et al. | Secured two factor authentication, graph based replication and encryption strategy in cloud computing | |
| Sharfuddin et al. | A novel cryptographic technique for cloud environment based on feedback DNA | |
| CN117648706A (en) | Access control method based on block chain and attribute encryption | |
| Nandni et al. | Quantum cryptography and blockchain system: fast and secured Digital communication system | |
| Saxena et al. | A new way to enhance efficiency & security by using symmetric cryptography | |
| Veerabadrappa et al. | Elliptic Curve Cryptography and Password Based Key Derivation Function with Advanced Encryption Standard Method for Cloud Data Security. | |
| Elumalai et al. | Secure and efficient data storage with Rivest Shamir Adleman algorithm in cloud environment | |
| Soni et al. | A Comparative Study of Various Traditional and Hybrid Cryptography Algorithm Models for Data Security | |
| Kumar et al. | BRRC: A hybrid approach using block cipher and stream cipher | |
| Anbazhagan et al. | Cloud Computing Security Through Symmetric Cipher Model | |
| Yadav et al. | Encryption and Obfuscation: Confidentiality technique for enhancing data security in public cloud storage |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161116 |