CN106254365A - A kind of data encryption/decryption method and system - Google Patents
A kind of data encryption/decryption method and system Download PDFInfo
- Publication number
- CN106254365A CN106254365A CN201610685641.4A CN201610685641A CN106254365A CN 106254365 A CN106254365 A CN 106254365A CN 201610685641 A CN201610685641 A CN 201610685641A CN 106254365 A CN106254365 A CN 106254365A
- Authority
- CN
- China
- Prior art keywords
- data
- initial data
- deciphering
- module
- encrypted
- 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
Abstract
The invention discloses a kind of data encryption/decryption method and system, relate to network data encryption and decryption field.Steps of the method are: S1: service end arranges the appointment position data at place when consulting initial data;S2: service end, to specifying position data to calculate, obtains the deciphering KEY:KEY1 of initial data;Initial data and KEY1 are associated by S3: service end, form be-encrypted data;S4: be-encrypted data is encrypted by service end, forms encrypted cipher text, sends encrypted cipher text to client;S5: current location data is calculated by client, obtains current KEY:KEY2;S6: encrypted cipher text is decrypted by client by KEY2, obtains decrypted plaintext.What the present invention can control initial data consults position, when only user is in appointment position, just can consult initial data;If user is in non-designated position, then cannot consult initial data, the information security of initial data is ensured.
Description
Technical field
The present invention relates to network data encryption and decryption field, be specifically related to a kind of data encryption/decryption method and system.
Background technology
Along with the universal fast development of smart mobile phone, smart mobile phone has been able to improve all multi-services (such as people
Mobile phone browses mail, checks negotiation Transaction Information etc.).Universal along with smart mobile phone, increasing people by
Gradually custom mobile phone replaces computer to carry out service interaction.
But, the important difference using smart mobile phone and computer to carry out service interaction is: computer is fixing, intelligence hands
Machine is moveable.This important difference can make smart mobile phone check in non-designated position, and regulation can only be checked specifying position
Information, the certain hidden danger of its security presence.
Such as: certain corporate policy, company human resource part issue the Mail Contents of employee can only be in the office of company
Consult, if now employee is consulted by the connecting computer receiving emails of office, the most no problem;If but employee is by intelligence
Mobile phone receives mail and the region outside self being in office, now consults mail and then can occur in non-designated position
Check that regulation can only be in the information specifying position to check.
Summary of the invention
For defect present in prior art, present invention solves the technical problem that for: control initial data consults position
Put, when only user is in appointment position, just can consult initial data;If user is in non-designated position, then cannot consult former
Beginning data.
For reaching object above, the data encryption/decryption method that the present invention provides, comprise the following steps:
S1: service end arranges the appointment position data at place when consulting initial data;
Described appointment position data is calculated by S2: service end by Message Digest 5, obtains the solution of initial data
Close KEY:KEY1;
Initial data and KEY1 are associated by S3: service end, form be-encrypted data;
S4: be-encrypted data is encrypted by service end by AES, forms encrypted cipher text, is sent by encrypted cipher text
To client;
S5: current location data is calculated by client by Message Digest 5, obtains current KEY:KEY2;
Encrypted cipher text, according to the decipherment algorithm symmetrical with AES in S4, is decrypted by S6: client by KEY2,
Obtain decrypted plaintext.
The data encrypting and deciphering system realizing said method that the present invention provides, it is investigated including the original number being positioned in service end
Read condition setting module, deciphering KEY computing module, initial data relating module and initial data encrypting module and be positioned at visitor
Current KEY computing module on the end of family and initial data deciphering module;
Initial data consult condition setting module for: arrange consult initial data time place appointment position data, to
Deciphering KEY computing module sends deciphering KEY signal calculated;
Deciphering KEY computing module is used for: after receiving deciphering KEY signal calculated, by Message Digest 5 to described appointment
Position data calculates, and obtains the deciphering KEY:KEY1 of initial data, sends initial data to initial data relating module and closes
Connection signal;
Initial data relating module is used for: after receiving initial data correlation signal, initial data and KEY1 is associated,
Form be-encrypted data, send initial data coded signal to initial data encrypting module;
Initial data encrypting module is used for: after receiving initial data coded signal, by AES to be-encrypted data
It is encrypted, forms encrypted cipher text, encrypted cipher text is sent to client, send current KEY to current KEY computing module and calculate
Signal;
Current KEY computing module is used for: after receiving current KEY signal calculated, by Message Digest 5 to current location
Data calculate, and obtain current KEY:KEY2, send initial data deciphering signal to initial data deciphering module;
Initial data deciphering module is used for: receive initial data deciphering signal after, according to in initial data encrypting module
The decipherment algorithm that AES is symmetrical, is decrypted encrypted cipher text by KEY2, obtains decrypted plaintext.
Compared with prior art, it is an advantage of the current invention that:
Initial data is encrypted by the present invention in advance, and the appointment position data consulting initial data is formed deciphering KEY.At this
On the basis of, when only user arrives appointment position, can correctly decipher original number with the current KEY that current location data is formed
According to (because now current location is identical with specifying position, i.e. current KEY is identical with deciphering KEY), if user does not arrives specific bit
Putting, then current location mistake, initial data cannot correctly be deciphered by the current KEY now formed with current location data
(because now current location is different from specifying position, i.e. current KEY is different from deciphering KEY).
In view of this, what the present invention can strictly control initial data consults position, when user is in non-designated position,
Cannot consult initial data, the information security of initial data is ensured.
Accompanying drawing explanation
Fig. 1 is the flow chart of data encryption/decryption method in the embodiment of the present invention.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention is described in further detail.
First LBS (Location Based Service, based on location-based service) being made brief description, LBS is to pass through
The radio communication network (such as GSM net, CDMA net) of telecommunications mobile operator or outside location mode (such as GPS) obtain mobile whole
The positional information (geographical coordinate, or geodetic coordinates) of end subscriber, on GIS (Geographic Information System, ground
Reason information system) platform support under, provide the user a kind of value-added service of respective service.
Data encryption/decryption method on this basis, shown in Figure 1, in the embodiment of the present invention, comprises the following steps:
S1: service end arranges the appointment position at place when consulting initial data (the such as particular content etc. of mail, contract)
Data, it is intended that the character string that when position data is to consult initial data, on-site longitude and latitude combination are formed.Such as arrange
The position checking data is Beijing, longitude 116.403, latitude 39.924, (in view of accuracy rating, the present embodiment to longitude and
Latitude value be after arithmetic point 3) form that is combined into character string is as follows: " 11640339924 ".
S2: service end (is MD5, Message Digest Algorithm in the present embodiment by Message Digest 5
MD5, i.e. Message Digest Algorithm 5) to specifying position data to calculate, obtain the deciphering KEY:KEY1 of initial data,
The character string of a length of 16 bytes of KEY1;Such as: KEY1=MD5 (" 11640339924 "), wherein 11640339924 are
Character string in S1.
Initial data and KEY1 are associated by S3: service end, form be-encrypted data.
S4: service end by AES (the present embodiment is AES encryption algorithm, Advanced Encryption
Standard, Advanced Encryption Standardalgorithm) be-encrypted data is encrypted, form encrypted cipher text, encrypted cipher text is sent extremely
Smart mobile phone based on LBS technology.The idiographic flow forming encrypted cipher text is: EncryptData=AesEncrypt
(SrcData,KEY1);Wherein EncryptData is encrypted cipher text, and AesEncrypt is the encryption letter that AES encryption algorithm provides
Number interface, SrcData is initial data, and (SrcData, KEY1) is the be-encrypted data after association.
After S5: user estimates the position reaching to consult initial data place, control smart mobile phone and obtain current location data,
Current location data is longitude and the character string of latitude formation being currently located ground;Current longitude and latitude are combined and forms character
After string, by Message Digest 5, current location data is calculated, obtain current KEY:KEY2, a length of 16 of KEY2
The character string of byte.
S6: smart mobile phone is according to the decipherment algorithm (i.e. AES decipherment algorithm) symmetrical with AES in S4, by KEY2 pair
Encrypted cipher text is decrypted, and obtains decrypted plaintext;Idiographic flow is: SrcData=AesEncrypt (EncryptData,
KEY2);Wherein SrcData is decrypted plaintext.
S7: smart mobile phone judges whether decrypted plaintext is mess code, the most then (i.e. KEY2 Yu KEY1 is not to prove KEY2 mistake
With, say, that current location is not that specific bit is put), now prompting user current location mistake, user's change bit postpones again
Perform S5;Otherwise prove KEY2 correct (user arrives appointment position), confirm that decrypted plaintext is correct, show decrypted plaintext, terminate.
The data encrypting and deciphering system realizing said method that the present invention provides, it is investigated including the original number being positioned in service end
Read condition setting module, deciphering KEY computing module, initial data relating module and initial data encrypting module and be positioned at visitor
Current KEY computing module, initial data deciphering module and initial data identification module on the end of family.
Initial data consult condition setting module for: arrange consult initial data time place appointment position data (warp
The character string that degree and latitude combination are formed), send deciphering KEY signal calculated to deciphering KEY computing module;
Deciphering KEY computing module is used for: after receiving deciphering KEY signal calculated, by Message Digest 5 to described appointment
Position data calculates, and obtains the deciphering KEY:KEY1 (character strings of 16 bytes) of initial data, associates to initial data
Module sends initial data correlation signal;
Initial data relating module is used for: after receiving initial data correlation signal, initial data and KEY1 is associated,
Form be-encrypted data, send initial data coded signal to initial data encrypting module;
Initial data encrypting module is used for: after receiving initial data coded signal, by AES to be-encrypted data
It is encrypted, forms encrypted cipher text, encrypted cipher text is sent to client, send current KEY to current KEY computing module and calculate
Signal;
Current KEY computing module is used for: after receiving current KEY signal calculated, by Message Digest 5 to current location
Data (character string that longitude and latitude combination are formed) calculate, and obtain current KEY:KEY2 (character strings of 16 bytes),
Initial data deciphering signal is sent to initial data deciphering module;
Initial data deciphering module is used for: receive initial data deciphering signal after, according to in initial data encrypting module
The decipherment algorithm that AES is symmetrical, is decrypted encrypted cipher text by KEY2, obtains decrypted plaintext.
Initial data identification module is used for: judge whether the decrypted plaintext that initial data deciphering module obtains is mess code, treats
Again current KEY signal calculated is sent to current KEY computing module after the change of current location;Otherwise show decrypted plaintext.
The present invention is not limited to above-mentioned embodiment, for those skilled in the art, without departing from
On the premise of the principle of the invention, it is also possible to make some improvements and modifications, these improvements and modifications are also considered as the protection of the present invention
Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.
Claims (10)
1. a data encryption/decryption method, it is characterised in that the method comprises the following steps:
S1: service end arranges the appointment position data at place when consulting initial data;
Described appointment position data is calculated by S2: service end by Message Digest 5, obtains the deciphering of initial data
KEY:KEY1;
Initial data and KEY1 are associated by S3: service end, form be-encrypted data;
S4: be-encrypted data is encrypted by service end by AES, forms encrypted cipher text, sends encrypted cipher text to visitor
Family end;
S5: current location data is calculated by client by Message Digest 5, obtains current KEY:KEY2;
Encrypted cipher text, according to the decipherment algorithm symmetrical with AES in S4, is decrypted by KEY2, obtains by S6: client
Decrypted plaintext.
2. data encryption/decryption method as claimed in claim 1, it is characterised in that: specify position data and S5 described in S1
Described in current location data be longitude and latitude combination formed character string.
3. data encryption/decryption method as claimed in claim 2, it is characterised in that: described in S2 described in KEY1 and S5
KEY2 is the character string of 16 bytes.
4. data encryption/decryption method as claimed in claim 1, it is characterised in that: further comprising the steps of after S6: S7: client
End judges whether decrypted plaintext is mess code, and if so, prompting user current location mistake, treats that user's change bit postpones and re-execute
S5;Otherwise show decrypted plaintext, terminate.
5. the data encryption/decryption method as described in any one of Claims 1-4, it is characterised in that: also include following step after S6
Rapid: Message Digest 5 described in S2 is MD5.
6. the data encryption/decryption method as described in any one of Claims 1-4, it is characterised in that: AES described in S4 is
AES encryption algorithm, decipherment algorithm described in S6 is AES decipherment algorithm.
7. the data encrypting and deciphering system realizing method described in any one of claim 1 to 6, it is characterised in that this system bag
Include the initial data being positioned in service end and consult condition setting module, deciphering KEY computing module, initial data relating module and former
Beginning data encryption module and the current KEY computing module being positioned in client and initial data deciphering module;
Initial data consult condition setting module for: arrange consult initial data time place appointment position data, to deciphering
KEY computing module sends deciphering KEY signal calculated;
Deciphering KEY computing module is used for: after receiving deciphering KEY signal calculated, by Message Digest 5 to described appointment position
Data calculate, and obtain the deciphering KEY:KEY1 of initial data, send initial data association letter to initial data relating module
Number;
Initial data relating module is used for: after receiving initial data correlation signal, initial data and KEY1 is associated, and is formed
Be-encrypted data, sends initial data coded signal to initial data encrypting module;
Initial data encrypting module is used for: after receiving initial data coded signal, is carried out be-encrypted data by AES
Encryption, forms encrypted cipher text, is sent by encrypted cipher text to client, sends current KEY to current KEY computing module and calculate letter
Number;
Current KEY computing module is used for: after receiving current KEY signal calculated, by Message Digest 5 to current location data
Calculate, obtain current KEY:KEY2, send initial data deciphering signal to initial data deciphering module;
Initial data deciphering module is used for: after receiving initial data deciphering signal, encrypt according in initial data encrypting module
The decipherment algorithm that algorithm is symmetrical, is decrypted encrypted cipher text by KEY2, obtains decrypted plaintext.
8. data encrypting and deciphering system as claimed in claim 7, it is characterised in that: described initial data consults condition setting module
In appointment position data and current location data in described current KEY computing module be longitude and latitude combination shape
The character string become.
9. data encrypting and deciphering system as claimed in claim 8, it is characterised in that: KEY1 in described deciphering KEY computing module,
And the KEY2 in above-mentioned current KEY computing module is the character string of 16 bytes.
10. the data encrypting and deciphering system as described in any one of claim 7 to 9, it is characterised in that: this system also includes being positioned at visitor
Initial data identification module on the end of family, it is used for: judge whether the decrypted plaintext that initial data deciphering module obtains is mess code,
Again current KEY signal calculated is sent to current KEY computing module after current location is changed;Otherwise show decrypted plaintext.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610685641.4A CN106254365A (en) | 2016-08-18 | 2016-08-18 | A kind of data encryption/decryption method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610685641.4A CN106254365A (en) | 2016-08-18 | 2016-08-18 | A kind of data encryption/decryption method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106254365A true CN106254365A (en) | 2016-12-21 |
Family
ID=57592091
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610685641.4A Pending CN106254365A (en) | 2016-08-18 | 2016-08-18 | A kind of data encryption/decryption method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106254365A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106971111A (en) * | 2017-02-13 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | Data ciphering method, terminal and server |
CN109787955A (en) * | 2018-12-12 | 2019-05-21 | 东软集团股份有限公司 | The method, apparatus and storage medium of information transmission |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102404110A (en) * | 2011-12-08 | 2012-04-04 | 宇龙计算机通信科技(深圳)有限公司 | Method and device for obtaining keys |
CN103107887A (en) * | 2013-01-22 | 2013-05-15 | 东莞宇龙通信科技有限公司 | Method and device for controlling files based on position information |
CN103401834A (en) * | 2013-06-27 | 2013-11-20 | 中国人民解放军国防科学技术大学 | File security method in limited area based on position information |
-
2016
- 2016-08-18 CN CN201610685641.4A patent/CN106254365A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102404110A (en) * | 2011-12-08 | 2012-04-04 | 宇龙计算机通信科技(深圳)有限公司 | Method and device for obtaining keys |
CN103107887A (en) * | 2013-01-22 | 2013-05-15 | 东莞宇龙通信科技有限公司 | Method and device for controlling files based on position information |
CN103401834A (en) * | 2013-06-27 | 2013-11-20 | 中国人民解放军国防科学技术大学 | File security method in limited area based on position information |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106971111A (en) * | 2017-02-13 | 2017-07-21 | 武汉斗鱼网络科技有限公司 | Data ciphering method, terminal and server |
CN109787955A (en) * | 2018-12-12 | 2019-05-21 | 东软集团股份有限公司 | The method, apparatus and storage medium of information transmission |
CN109787955B (en) * | 2018-12-12 | 2021-07-16 | 东软集团股份有限公司 | Information transmission method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105981327B (en) | Safety communicating method and equipment and the multimedia device for using this method and equipment | |
US20200372503A1 (en) | Transaction messaging | |
CN106658474B (en) | SIM card data security protection method is realized using embedded-type security element | |
KR101521616B1 (en) | Selective Encryption Apparatus and Method for Efficient Secure Data Transmission in Internet of Things | |
CN101247356B (en) | DHCP message passing method and system | |
CN110519753B (en) | Access method, device, terminal and readable storage medium | |
KR101929699B1 (en) | GPRS system key enforcement method, SGSN device, UE, HLR / HSS, and GPRS system | |
CN108141754A (en) | For being related to the device and method of the mobile process of mobility management entity reorientation | |
US10791106B2 (en) | Digital credential with embedded authentication instructions | |
CN101103358A (en) | Security code production method and methods of using the same, and programmable device therefor | |
CN101742508A (en) | System and method for transmitting files between WAPI terminal and application server | |
CN104318286B (en) | Management method, management system and the terminal of NFC label data | |
CN105590443A (en) | Electrical equipment information collecting and recording mobile terminal and electrical equipment information processing system | |
CN105025019A (en) | Data safety sharing method | |
JP4962237B2 (en) | Program and method for managing information on location of portable device and file encryption key | |
CN109831775B (en) | Processor, baseband chip and SIM card information transmission method | |
CN105975867A (en) | Data processing method | |
CN104754556A (en) | Method and device for maintaining effectiveness of mobile terminal, method and device for uploading information of mobile terminal as well as system for maintaining effectiveness of mobile terminal | |
CN110166230B (en) | Key management method and device | |
KR20180015667A (en) | Method and system for secure SMS communication | |
CN112291268A (en) | Information transmission method, device, equipment and storage medium | |
CN104410602A (en) | Method for realizing random password keyboard based on secure element | |
CN106254365A (en) | A kind of data encryption/decryption method and system | |
US20150237017A1 (en) | Communication Information Transmitting Process and System | |
CN109756451B (en) | Information interaction method and device |
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: 20161221 |