CN106302429B - Communication encryption method - Google Patents

Communication encryption method Download PDF

Info

Publication number
CN106302429B
CN106302429B CN201610650800.7A CN201610650800A CN106302429B CN 106302429 B CN106302429 B CN 106302429B CN 201610650800 A CN201610650800 A CN 201610650800A CN 106302429 B CN106302429 B CN 106302429B
Authority
CN
China
Prior art keywords
information
server
communication interface
client
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.)
Active
Application number
CN201610650800.7A
Other languages
Chinese (zh)
Other versions
CN106302429A (en
Inventor
陈宏亮
张伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seal information technology (Shanghai) Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201610650800.7A priority Critical patent/CN106302429B/en
Publication of CN106302429A publication Critical patent/CN106302429A/en
Application granted granted Critical
Publication of CN106302429B publication Critical patent/CN106302429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network 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/0435Network 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 symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data

Abstract

The invention provides a communication encryption method, which is applied to the authentication of a client by a server, wherein the client is connected with the server; the communication encryption method comprises the following steps: step S1, the client sends the information of the communication interface needing to communicate to the server; step S2, the server side encrypts the received information of the communication interface by a preset method and returns the encrypted information of the communication interface to the client side; and step S3, the client communicates with the server through the encrypted information of the communication interface, and the server receives the encrypted information of the communication interface in communication and converts the encrypted information of the communication interface into the information of the communication interface according to the inverse method of the preset method. The technical scheme has the advantages that the communication between the client and the server is safe, the verification speed is higher, and the defect that the server performance is reduced because the identity of the client needs to be verified every time in the prior art is overcome.

Description

Communication encryption method
Technical Field
The invention relates to the technical field of communication, in particular to a communication encryption method.
Background
With the rapid development of the internet technology, more and more intelligent devices can be connected to the internet to help people to live, work and study, and on the other hand, network security is more and more emphasized.
Disclosure of Invention
Aiming at the problems of the request verification of the server to the intelligent equipment in the prior art, the communication encryption method aims at realizing the safe verification and higher verification speed.
The specific technical scheme is as follows:
a communication encryption method is applied to the authentication of a client by a server side, wherein,
the client is connected with the server;
the communication encryption method comprises the following steps:
step S1, the client sends the information of the communication interface needing to communicate to the server;
step S2, the server side encrypts the received information of the communication interface by a preset method and returns the encrypted information of the communication interface to the client side;
and step S3, the client communicates with the server through the encrypted information of the communication interface, and the server receives the encrypted information of the communication interface in communication and converts the encrypted information of the communication interface into the information of the communication interface according to the inverse method of the preset method.
Preferably, before the step S1, the method further includes the steps of:
step S01, the client sends an authentication request encrypted with a predetermined first secret key to the server;
step S02, after receiving the encrypted authentication request, the server decrypts the encrypted authentication request with a corresponding second secret key;
and step S03, the server side verifies the decrypted authentication request, if the verification is passed, the step S1 is executed, and if the verification is not passed, the step S1 is exited.
Preferably, in step S01, the authentication request includes an encrypted data packet, and the encrypted data packet includes the information of the communication interface that needs to be communicated and encrypted by the first secret key, and a digest of the information of the communication interface that needs to be communicated and encrypted by the first secret key, and the digest of the information of the communication interface that needs to be communicated is obtained by calculation according to the information of the communication interface that needs to be communicated by a preset algorithm.
Preferably, the server provides a database for pre-storing the serial number of the client and the second key associated with the serial number;
the step S02 further includes the following steps:
step S021, the server side obtains the number of the corresponding client side and the encrypted data packet according to the authentication request;
step S022, the server side obtains the second secret key corresponding to the serial number from the database according to the serial number;
step S023, the server decrypts the encrypted data packet with the obtained second secret key to obtain information of the communication interface that needs to be communicated corresponding to the client and a digest of the information of the communication interface that needs to be communicated.
Preferably, the step S03 includes the steps of:
step 031, the server calculates the information of the communication interface needing to communicate through the preset algorithm to obtain a summary value;
and S032, comparing the digest value with the digest of the information of the communication interface needing to be communicated, which is obtained by decryption, wherein if the digest value is consistent, the verification is passed, and if the digest value is inconsistent, the verification fails.
Preferably, the preset algorithm is a hash algorithm.
Preferably, the preset method includes:
providing a mapping relation table, generating a unique encrypted value according to the information of the interface needing to be communicated, which is sent by the client, storing the information of the interface needing to be communicated and the corresponding encrypted value into the mapping relation table, and returning the encrypted value to the client as the encrypted information of the communication interface.
Preferably, the server starts timing when generating the encrypted value, and disables the encrypted value if the timing exceeds a preset time.
Preferably, the information of the communication interface is a URL address.
Preferably, the encrypted value is obtained by acquiring a random number as a key to encrypt information of the interface to be communicated.
The technical scheme has the following advantages or beneficial effects: the communication between the client and the server is safe, the verification speed is higher, and the defect that the server performance is reduced because the identity of the client needs to be verified every time in the prior art is overcome.
Drawings
Embodiments of the present invention will now be described more fully hereinafter with reference to the accompanying drawings. The drawings are, however, to be regarded as illustrative and explanatory only and are not restrictive of the scope of the invention.
FIG. 1 is a flow chart of an embodiment of a communication encryption method of the present invention;
FIG. 2 is a flowchart of an embodiment of a communication encryption method according to the present invention, relating to sending an authentication request;
FIG. 3 is a flowchart illustrating decryption of an authentication request according to an embodiment of a communication encryption method of the present invention;
fig. 4 is a flowchart of verifying a decrypted authentication request according to an embodiment of a communication encryption method of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The invention is further described with reference to the following drawings and specific examples, which are not intended to be limiting.
The invention comprises a communication encryption method.
An embodiment of a communication encryption method is applied to the authentication of a client by a server, wherein,
the client is connected with the server;
as shown in fig. 1, the authentication and authorization method includes the following steps:
step S1, the client sends the information of the communication interface needing to communicate to the server;
step S2, the server side encrypts the received information of the communication interface by a preset method and returns the encrypted information of the communication interface to the client side;
and step S3, the client communicates with the server through the encrypted information of the communication interface, and the server receives the encrypted information of the communication interface in communication and converts the encrypted information of the communication interface into the information of the communication interface according to the inverse method of the preset method.
When the existing client communicates with the server, the server usually authenticates the identity of the client every time, so that the communication speed is slow, a large amount of system resources of the server are occupied, and if the number of clients is large, the response speed of the server is slowed down by frequent authentication, so that the performance of the server is reduced;
in the technical scheme, in order to quickly establish communication with the server and ensure that the communication process is safer, the client can send information of a communication interface needing to be communicated to the server, the server encrypts the information of the communication interface through a preset method after receiving the information of the communication interface needing to be communicated and returns the encrypted information of the communication interface to the client, the client establishes communication with the server according to the encrypted information of the communication interface, and the server receives the encrypted information of the communication interface sent by the client at the moment and can convert the encrypted information into the information of the communication interface before encryption through the reverse method of the preset method so as to respond to the operation of the client; the server encrypts the information of the communication interface needing communication, which is sent by the client, so that the communication process is safer, and the defect that the server performance is reduced because the client identity needs to be verified every time in the prior art is overcome.
In a preferred embodiment, before step S1, as shown in fig. 2, the method further includes the following steps:
step S01, the client sends an authentication request encrypted with a predetermined first secret key to the server;
step S02, after receiving the encrypted authentication request, the server decrypts the encrypted authentication request with the corresponding second secret key;
and step S03, the service end verifies the decrypted authentication request, if the verification is passed, the step S1 is executed, and if the verification is not passed, the operation is quitted.
In general, if a client wants to establish communication with a server, the server performs identity authentication on the client;
in the above technical solution, the method for authenticating the identity of the client may specifically be that the client sends an authentication request encrypted by a first secret key to the server, the server decrypts the encrypted authentication request by a second secret key after receiving the request, and verifies the decrypted authentication request, and if the verification is passed, the client sends communication information of a communication interface that needs to communicate to the server, and if the verification is failed, the client does not have the authority of the server to communicate.
In a preferred embodiment, in step S01, the authentication request includes an encrypted data packet, the encrypted data packet includes information of the communication interface to be communicated encrypted with the first secret key and a digest of the information of the communication interface to be communicated encrypted with the first secret key, and the digest of the information of the communication interface to be communicated is obtained by a preset algorithm according to the information of the communication interface to be communicated.
In one preferred embodiment, the predetermined algorithm may be a hash algorithm.
In the technical scheme, the client side can encrypt the information of the communication interface needing communication through a preset algorithm, namely a hash algorithm, to generate the digest, and encrypt the digest and the information of the communication interface needing communication through the first secret key to form an encrypted data packet in the authentication request.
In a preferred embodiment, the server provides a database for pre-storing the serial number of the client and the second key associated with the serial number;
as shown in fig. 3, step S02 further includes the following steps:
step S021, the server side obtains the number of the corresponding client side and an encrypted data packet according to the authentication request;
step S022, the server side obtains a second secret key corresponding to the serial number from the database according to the serial number;
in step S023, the server decrypts the encrypted data packet with the obtained second key to obtain information of the communication interface that needs to be communicated corresponding to the client and a digest of the information of the communication interface that needs to be communicated.
In the above technical solution, the serial number and the second key in the client terminal stored in the server terminal, where the serial number of the client terminal in the database and the second key associated with the serial number may be submitted when the client terminal registers with the server terminal, that is, the first key and the second key are the same key;
after receiving the number sent by the client, the server can search the second secret key associated with the number in the database according to the number, so as to decrypt the encrypted data packet sent by the client through the second secret key, thereby obtaining the information of the communication interface which needs to be communicated and corresponds to the client in the encrypted data packet and the abstract of the information of the communication interface which needs to be communicated.
In a preferred embodiment, step S03, as shown in fig. 4, includes the following steps:
step S031, the server calculates the information of the communication interface needing to communicate through a preset algorithm to obtain a summary value;
and step S032, comparing the digest value with the digest of the information of the communication interface which needs to be communicated and is obtained by decryption, if the digest value is consistent with the information of the communication interface, the verification is passed, and if the digest value is inconsistent with the information of the communication interface, the verification fails.
In the above technical scheme, when the authentication request sent by the client is authenticated, the encrypted data packet may be decrypted by using the obtained second key to obtain the first digest value corresponding to the encrypted data packet and the information of the communication interface of the client, and the information of the communication interface is calculated by using a hash algorithm to obtain the second digest value, so that the first digest value and the second digest value are compared, if the comparison is consistent, the authentication is passed, and if the authentication is inconsistent, the client does not have the right to access the server at the moment.
In a preferred embodiment, the presetting method comprises:
providing a mapping relation table, generating a unique encryption value according to the information of the interface needing to be communicated, which is sent by the client, storing the information of the interface needing to be communicated and the corresponding encryption value in the mapping relation table, and returning the encryption value to the client as the encrypted information of the communication interface.
In a preferred embodiment, the encrypted value in the above technical solution can be obtained by obtaining a random number as a key to encrypt information of an interface that needs to communicate.
In the technical scheme, after receiving information of a communication interface needing communication sent by a client, a server encrypts the information of the communication interface needing communication through a preset encryption algorithm, namely a hash algorithm, to randomly generate an encrypted value, stores the encrypted value and the information of the communication interface needing communication in a mapping relation table, returns the encrypted value to the client, returns the encrypted value after receiving the encrypted value by the client, uses the encrypted value as the information of the encrypted communication interface, finds the information of the communication interface corresponding to the encrypted value in the mapping relation table according to the encrypted value sent by the client, and establishes communication with the client.
In a preferred embodiment, the server starts timing when the encryption value is generated, and disables the encryption value if the timing exceeds a preset time.
In the technical scheme, the connection between the client and the server can be released by invalidating the encryption value exceeding the preset time, so that the client is prevented from occupying resources of the server for a long time.
In a preferred embodiment, the information of the communication interface in the above technical solution may be a URL address.
In a specific embodiment, when a client needs to access a server, an authentication request can be sent through the client, and the server passes authentication according to the authentication request;
the client sends information of a communication interface needing communication to the server, such as { "interface": http:// www.xxx.com/test1 "}, after the server receives {" interface ": http:// www.xxx.com/test 1" } sent by the client, the server encrypts and calculates the { "interface": http:// www.xxx.com/test1 "} by acquiring a random number as a key to obtain an encrypted value GDFSS corresponding to {" interface ": http:// www.xxx.com/test 1" }, the server saves the { "interface": http:// www.xxx.com/test1 "} and the GDFSS, i.e. the {" interface ": http:// FSS" } 4/FSS "} in a mapping relation table, returns the GDS to the server, and sends the information to the client according to a mapping relation of FSS www.xxx, the FSS www.xxx and the FSS is obtained according to the FSS' {" interface "}, i.e. to enable normal communication with the client.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.

Claims (6)

1. A communication encryption method is applied to the authentication of a client terminal by a server terminal and is characterized in that,
the client is connected with the server;
the communication encryption method comprises the following steps:
step S1, the client sends the information of the communication interface needing to communicate to the server;
step S2, the server side encrypts the received information of the communication interface by a preset method and returns the encrypted information of the communication interface to the client side;
step S3, the client sends the encrypted information of the communication interface to the server, and the server converts the information of the communication interface received after encryption into the information of the communication interface according to the inverse method of the preset method in communication;
before step S1, the method further includes the following steps:
step S01, the client sends an authentication request encrypted with a predetermined first secret key to the server;
step S02, after receiving the encrypted authentication request, the server decrypts the encrypted authentication request with a corresponding second secret key;
step S03, the server side verifies the decrypted authentication request, if the authentication is passed, the step S1 is executed, and if the authentication is not passed, the step S1 is exited;
in step S01, the authentication request includes an encrypted data packet, where the encrypted data packet includes the information of the communication interface to be communicated, which is encrypted with the first secret key, and a digest of the information of the communication interface to be communicated, which is encrypted with the first secret key, and the digest of the information of the communication interface to be communicated is obtained by calculation according to the information of the communication interface to be communicated through a preset algorithm;
the server provides a database for pre-storing the serial number of the client and the second secret key associated with the serial number;
the step S02 further includes the following steps:
step S021, the server side obtains the number of the corresponding client side and the encrypted data packet according to the authentication request;
step S022, the server side obtains the second secret key corresponding to the serial number from the database according to the serial number;
step S023, the server decrypts the encrypted data packet with the obtained second secret key to obtain information of the communication interface that needs to be communicated corresponding to the client and a digest of the information of the communication interface that needs to be communicated;
the step S03 includes the following steps:
step 031, the server calculates the information of the communication interface needing to communicate through the preset algorithm to obtain a summary value;
and S032, comparing the digest value with the digest of the information of the communication interface needing to be communicated, which is obtained by decryption, wherein if the digest value is consistent, the verification is passed, and if the digest value is inconsistent, the verification fails.
2. The communication encryption method according to claim 1, wherein the predetermined algorithm is a hash algorithm.
3. The communication encryption method according to claim 1, wherein the preset method comprises:
providing a mapping relation table, generating a unique encrypted value according to the information of the interface needing to be communicated, which is sent by the client, storing the information of the interface needing to be communicated and the corresponding encrypted value into the mapping relation table, and returning the encrypted value to the client as the encrypted information of the communication interface.
4. The communication encryption method according to claim 3, wherein the server starts timing when generating the encryption value, and disables the encryption value if the timing exceeds a predetermined time.
5. The communication encryption method according to claim 1, wherein the information of the communication interface is a URL address.
6. The communication encryption method according to claim 3, wherein the encrypted value is obtained by encrypting the information of the interface requiring communication by acquiring a random number as a key.
CN201610650800.7A 2016-08-10 2016-08-10 Communication encryption method Active CN106302429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610650800.7A CN106302429B (en) 2016-08-10 2016-08-10 Communication encryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610650800.7A CN106302429B (en) 2016-08-10 2016-08-10 Communication encryption method

Publications (2)

Publication Number Publication Date
CN106302429A CN106302429A (en) 2017-01-04
CN106302429B true CN106302429B (en) 2020-01-10

Family

ID=57667798

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610650800.7A Active CN106302429B (en) 2016-08-10 2016-08-10 Communication encryption method

Country Status (1)

Country Link
CN (1) CN106302429B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107579964A (en) * 2017-08-25 2018-01-12 上海斐讯数据通信技术有限公司 Data transmission method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453329A (en) * 2007-12-07 2009-06-10 北京闻言科技有限公司 Method for enhancing system security by pre-login
CN102487376A (en) * 2010-12-01 2012-06-06 金蝶软件(中国)有限公司 Enterprise resource planning system login method, device and system
CN102546579A (en) * 2010-12-31 2012-07-04 北大方正集团有限公司 Method, device and system used for providing system resources
US9374366B1 (en) * 2005-09-19 2016-06-21 Jpmorgan Chase Bank, N.A. System and method for anti-phishing authentication
CN105808990A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Method and device for controlling URL access on basis of IOS system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9374366B1 (en) * 2005-09-19 2016-06-21 Jpmorgan Chase Bank, N.A. System and method for anti-phishing authentication
CN101453329A (en) * 2007-12-07 2009-06-10 北京闻言科技有限公司 Method for enhancing system security by pre-login
CN102487376A (en) * 2010-12-01 2012-06-06 金蝶软件(中国)有限公司 Enterprise resource planning system login method, device and system
CN102546579A (en) * 2010-12-31 2012-07-04 北大方正集团有限公司 Method, device and system used for providing system resources
CN105808990A (en) * 2016-02-23 2016-07-27 平安科技(深圳)有限公司 Method and device for controlling URL access on basis of IOS system

Also Published As

Publication number Publication date
CN106302429A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN109347835B (en) Information transmission method, client, server, and computer-readable storage medium
CN109347809B (en) Application virtualization secure communication method oriented to autonomous controllable environment
JP6168415B2 (en) Terminal authentication system, server device, and terminal authentication method
CN106464499B (en) Communication network system, transmission node, reception node, message checking method, transmission method, and reception method
WO2018076365A1 (en) Key negotiation method and device
CN107040513B (en) Trusted access authentication processing method, user terminal and server
CN105187450A (en) Authentication method and device based on authentication equipment
CN108366063B (en) Data communication method and device of intelligent equipment and equipment thereof
US8527762B2 (en) Method for realizing an authentication center and an authentication system thereof
US8601267B2 (en) Establishing a secured communication session
CN104135494A (en) Same-account incredible terminal login method and system based on credible terminal
CN105162785A (en) Method and equipment for performing registration based on authentication equipment
CN105721153B (en) Key exchange system and method based on authentication information
CN103763356A (en) Establishment method, device and system for connection of secure sockets layers
US20080162934A1 (en) Secure transmission system
JP6548172B2 (en) Terminal authentication system, server device, and terminal authentication method
CN107517194B (en) Return source authentication method and device of content distribution network
CN108809633B (en) Identity authentication method, device and system
CN111030814A (en) Key negotiation method and device
CN105162599A (en) Data transmission system and data transmission method
CN110662091B (en) Third-party live video access method, storage medium, electronic device and system
CN104901940A (en) 802.1X network access method based on combined public key cryptosystem (CPK) identity authentication
CN111800378A (en) Login authentication method, device, system and storage medium
US11943213B2 (en) Device and method for mediating configuration of authentication information
CN106302429B (en) Communication encryption method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201119

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co., Ltd

Address before: 201600 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201221

Address after: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee after: Bengbu Lichao Information Technology Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co., Ltd

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210310

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee before: Bengbu Lichao Information Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210918

Address after: 200000 Room C, 18th floor, 1255 Xikang Road, Putuo District, Shanghai

Patentee after: Seal information technology (Shanghai) Co.,Ltd.

Address before: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee before: Huzhou YingLie Intellectual Property Operation Co.,Ltd.