CN114422140B - Message time verification method, device, equipment and medium - Google Patents

Message time verification method, device, equipment and medium Download PDF

Info

Publication number
CN114422140B
CN114422140B CN202111619310.8A CN202111619310A CN114422140B CN 114422140 B CN114422140 B CN 114422140B CN 202111619310 A CN202111619310 A CN 202111619310A CN 114422140 B CN114422140 B CN 114422140B
Authority
CN
China
Prior art keywords
message
standard value
preset
time standard
value
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
CN202111619310.8A
Other languages
Chinese (zh)
Other versions
CN114422140A (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.)
Weway Shenzhen Network Technology Co ltd
Original Assignee
Weway Shenzhen Network 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 Weway Shenzhen Network Technology Co ltd filed Critical Weway Shenzhen Network Technology Co ltd
Priority to CN202111619310.8A priority Critical patent/CN114422140B/en
Publication of CN114422140A publication Critical patent/CN114422140A/en
Application granted granted Critical
Publication of CN114422140B publication Critical patent/CN114422140B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3226Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using a predetermined code, e.g. password, passphrase or PIN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application relates to a message time verification method, which is characterized by comprising the following steps: extracting a sender identity in a message of a message sender, acquiring a preset message field and a receiving time standard value of the message, judging whether the receiving time standard value is in a preset time period corresponding to the sending time standard value if the preset message field is the sending time standard value, and if so, verifying to pass; if the preset field is a verification value, calculating to obtain the verification value by using a preset one-way function, and verifying the sender according to the verification value; if not, the receiving time offset value is used for verification. In addition, the application also relates to a message time verification method, a device, equipment and a storage medium. The method and the device can solve the problem that the safety of data transmission is not high in the communication process.

Description

Message time verification method, device, equipment and medium
Technical Field
The present disclosure relates to the field of audio processing, and in particular, to a message time verification method, device, electronic apparatus, and computer readable storage medium.
Background
With the development of communication technology, people increasingly and commonly use mobile phones, fixed phones, the internet and other modes to realize information data transmission so as to improve communication efficiency and reduce communication cost, but with the popularization of online information interaction, the safety problem during information interaction gradually becomes a focus of attention of people.
The current method for improving the security in communication is mostly a communication method based on data encryption, namely, the interactive data of multiple parties in communication is encrypted, so that the security of the data in the information interaction process is improved. However, in this method, the time standard value which is sent and received by the data is not recognized, and the falsification of the identity is realized by using the time standard value, so that the security in the communication process is insufficient to meet the requirement of the user.
Disclosure of Invention
The application provides a message time verification method, a message time verification device and a storage medium, which are used for solving the problem of low security of data transmission in a communication process.
In a first aspect, the present application provides a message time verification method, the method including:
receiving a message of a message sender, extracting a sender identity and a preset message field in the message, and acquiring a receiving time standard value of the message;
judging whether the preset message field is consistent with a preset transmission time standard value or not, and judging whether the preset message field is consistent with a preset transmission verification value field or not;
when the preset message field is consistent with a preset sending time standard value, judging whether the receiving time standard value is matched with the sending time standard value or not;
if the receiving time standard value is matched with the transmitting time standard value, verifying to pass and receiving the information;
if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value;
if the offset time standard value is matched with the transmission time standard value, verifying to pass and receiving the information;
if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
when the preset message field is consistent with a preset transmission verification value field, verifying the message sender according to the transmission verification value and the receiving time standard value;
calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function;
judging whether the receiving verification value is consistent with the sending verification value or not;
if the received verification value is consistent with the transmitted verification value, the verification is passed and the information is received;
if the receiving verification value is inconsistent with the sending verification value, the receiving party recalculates the receiving verification value by using the offset time standard value of the receiving time, the ID of the message sending party and the ID of the message receiving party, and if the recalculated receiving verification value is consistent with the sending verification value, the verification is passed and the information is received;
if the recalculated received verification value is inconsistent with the transmitted verification value, the verification fails and the information is refused to be received.
In detail, the extracting the sender identifier in the message includes:
dividing the message into a plurality of fields according to a preset separator;
numbering the plurality of fields according to the front-to-back position information of each field in the message;
and selecting a field with a preset number as the sender identity.
In detail, the determining whether the preset message field is consistent with a preset transmission time standard value includes:
compiling the sender identity and the receiver identity into an identity retrieval field, and adding the identity retrieval field into a pre-generated query statement;
sending a time standard value query instruction to a preset server by using the query statement, and taking the acquired time standard value returned by the preset server as the receiving time standard value;
comparing whether the content of the preset message field is the same as the receiving time standard value;
when the content of the preset message field is the same as the receiving time standard value, determining that the preset message field is consistent with the preset receiving time standard value;
and when the content of the preset message field is different from the receiving time standard value, determining that the preset message field is inconsistent with the preset receiving time standard value.
In detail, the calculating, by using a preset one-way function, a verification value according to the time standard value, the ID of the message sender and the ID of the message receiver includes:
calculating a receiving verification value according to the time standard value, the ID of the message sender and the ID of the message receiver by using the following one-way function and a preset one-way function:
H=P(ID 1 +ID 2 +C)
wherein H is the verification value, P is a preset one-way function, and ID 1 For the identity of the sender of the message, ID 2 And C is the time standard value for the identity of the message receiver.
In detail, the verifying the message sender according to the sending verification value and the receiving time standard value includes:
dividing the receiving time value by a preset shortest communication duration to obtain a receiving time standard value;
calculating a receiving verification value by using the receiving time standard value, the sender ID and the receiver ID, and judging whether the receiving verification value is matched with the sending verification value or not;
if the information is matched, the verification is passed, and the information is received;
if the received verification value is not matched with the transmitted verification value, calculating a received verification value by using the offset time standard value, judging whether the received verification value is matched with the transmitted verification value, and if the received verification value is matched with the transmitted verification value, verifying that the received verification value passes the received verification value; if not, the verification fails to reject the information.
In detail, the calculating, by using a preset one-way function, a transmission verification value according to the receiving time standard value, the message sender ID and the message receiver ID includes:
dividing the sending time value by a preset shortest communication duration to obtain a sending time standard value;
and calculating a transmission verification value by using the identity of the message sender and the message receiver and the transmission time standard value.
In detail, the identification mark comprises a telephone number and an IP address.
In a second aspect, the present application provides a message time verification apparatus, the apparatus comprising:
the data processing module is used for receiving the message of the message sender, extracting the sender identity mark and the preset message field in the message, acquiring the sending time standard value of the message, judging whether the preset message field is consistent with the preset sending time standard value, and judging whether the preset message field is consistent with the preset sending verification value field;
the first verification module is used for judging whether the receiving time standard value is matched with the sending time standard value or not when the preset message field is consistent with the preset sending time standard value; if the receiving time standard value is matched with the transmitting time standard value, verifying to pass and receiving the information; if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value; if the offset time standard value is matched with the transmission time standard value, verifying to pass and receiving the information; if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
the second verification module is used for verifying the message sender according to the transmission verification value and the receiving time standard value when the preset message field is consistent with a preset transmission verification value field; calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function; judging whether the receiving verification value is consistent with the sending verification value or not; if the received verification value is consistent with the transmitted verification value, the verification is passed and the information is received; if the receiving verification value is inconsistent with the sending verification value, the receiving party recalculates the receiving verification value by using the offset time standard value of the receiving time, the ID of the message sending party and the ID of the message receiving party, and if the recalculated receiving verification value is consistent with the sending verification value, the verification is passed and the information is received; if the recalculated received verification value is inconsistent with the transmitted verification value, the verification fails and the information is refused to be received.
In a third aspect, a message time verification device is provided, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and a processor, configured to implement the steps of the message time verification method according to any one of the embodiments of the first aspect when executing the program stored in the memory.
In a fourth aspect, a computer readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, implements the steps of the message time verification method according to any one of the embodiments of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the method, the receiving time standard value of the message can be judged to be located in the interval, targeted identity verification is achieved, when the receiving time standard value is in the preset time period corresponding to the sending time standard value, the verification value is directly calculated to verify the sender, when the receiving time standard value is not in the preset time period corresponding to the sending time standard value, the verification value and the auxiliary value are combined to verify the sender identity, targeted identity verification is achieved, confidentiality of the time standard value is guaranteed through a one-way function in the verification process, accuracy of identity verification is further improved, safety of the data transmission process is guaranteed, and the problem that safety of data transmission in the communication process is low can be solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flow chart of a message time verification method provided in an embodiment of the present application;
fig. 2 is a schematic block diagram of an apparatus for message time verification according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device for message time verification according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present application based on the embodiments herein.
Fig. 1 is a flow chart of a message time verification method according to an embodiment of the present application. In this embodiment, the message time verification method includes:
s1, receiving a message of a message sender, extracting a sender identity and a preset message field in the message, and acquiring a receiving time standard value of the message.
In the embodiment of the application, the message sender can send the message to the outside through telephone communication, internet communication and the like.
In one of the practical application scenarios, when the message sending direction sends the message to the outside, in order to ensure accurate and safe transmission of the message, the identity of the message sending direction (the message sender) is recorded in the sent message, so that the message receiving direction can receive and verify the message according to the identity.
In detail, the identity is used to identify the sender to send identity information, for example, when the message sender sends a message through telephone communication, the identity may be a telephone number; alternatively, the identity may be an IP address when the message sender sends the message via internet communication.
In the embodiment of the application, the message of the message sender can be analyzed to obtain the sender identity recorded in the message.
In this embodiment of the present application, the extracting the sender identifier in the message includes:
dividing the message into a plurality of fields according to a preset separator;
numbering the plurality of fields according to the front-to-back position information of each field in the message;
and selecting a field with a preset number as the sender identity.
In detail, the preset separator is a symbol for separating different fields in the message, and the preset separator comprises ","; symbols ","/", and the like.
Specifically, the message may be divided into a plurality of fields according to a preset separator, and the fields are numbered according to the position of each field in the message, for example, there is a message "qwe, asd, zxc", and when the preset separator is "the message may be divided into three fields of" qwe "," asd "and" zxc ", and the three fields are numbered, so that" qwe "corresponds to number 1," asd "corresponds to number 2, and" zxc "corresponds to number 3.
Further, the step of extracting the preset message field in the message is consistent with the step of extracting the identity of the sender in the message, which is not described herein, where the preset message field is a field in a fixed location in the message, and the preset message field may be a preset receiving time standard value, or the preset message field may be a preset sending verification value.
In this embodiment of the present application, when a message sender sends a message to the outside through a telephone communication method, an internet communication method, or the like, for the purpose of analysis and transmission efficiency of the message, the fields containing the information are often sequentially generated into communication data, that is, fields at different positions in the message often record information with a fixed meaning, for example, a field with a number 1 in the message is used for recording the identity of the sender, and a field with a number 2 in the message is used for recording the content of the message, or the like.
Therefore, after numbering the fields in the message, the embodiment of the application can obtain the sender identity in the message by selecting the fields with preset numbers.
In the embodiment of the application, the time point when the message is received by the message receiver can be determined as the receiving time standard value of the message.
S2, judging whether the preset message field is consistent with a preset transmission time standard value or not, and judging whether the preset message field is consistent with a preset transmission verification value field or not.
In the embodiment of the application, the receiving time standard value can be queried according to the sending time standard value.
In this embodiment of the present application, the receiver identifier refers to a terminal device such as a client, an application, etc. that receives a message sent by the message sender, where the receiver identifier includes, but is not limited to, a phone number or an IP address of the message receiver, etc. that has a unique identifier.
In one of the practical application scenarios, due to the rapid development of the cloud service technology, when the message sender and the message receiver perform data interaction, the data interaction efficiency is improved often through the intermediate server, so that the message receiver can query the receiving time standard value of the message according to the sender identity and the preset receiver identity, and the sending time standard value is used for marking the time point of the message receiver for receiving the message.
In this embodiment of the present application, the determining whether the preset message field is consistent with a preset transmission time standard value includes:
compiling the sender identity and the receiver identity into an identity retrieval field, and adding the identity retrieval field into a pre-generated query statement;
sending a time standard value query instruction to a preset server by using the query statement, and taking the acquired time standard value returned by the preset server as the receiving time standard value;
comparing whether the content of the preset message field is the same as the receiving time standard value;
when the content of the preset message field is the same as the receiving time standard value, determining that the preset message field is consistent with the preset receiving time standard value;
and when the content of the preset message field is different from the receiving time standard value, determining that the preset message field is inconsistent with the preset receiving time standard value.
In detail, since the sender id can be used to uniquely mark the identity of the sender of the message, and the receiver id can be used to uniquely mark the identity of the receiver of the message, the sender id and the receiver id can be compiled into an id search field, and the id search field is added to a query statement generated in advance, so that the time standard value of the message received by the receiver of the message can be accurately queried from a preset server by using the query statement.
Specifically, the preset server is an intermediate server when the message sender and the message receiver perform data interaction, and the server records a time point when the message sender and the message receiver perform data interaction.
Further, the step of determining whether the preset message field is consistent with the preset transmission verification value field and the step of determining whether the preset message field is consistent with the preset transmission time standard value are not described herein.
And S3, judging whether the receiving time standard value is matched with the sending time standard value or not when the preset message field is consistent with the preset sending time standard value.
In this embodiment of the present application, the determining whether the receiving time standard value is matched with the sending time standard value, that is, determining whether the receiving time is within a preset time period corresponding to the sending time standard value, and then implementing verification on the identity of the sender of the message according to the determination result.
In a preferred embodiment of the present application, the preset time period corresponding to the sending time standard value is [ Gap x i, gap x i+delta ], where Gap is the shortest communication duration between the message sender and the message receiver when each communication is performed, that is, in each Gap duration, the message sender and the message receiver cannot perform a new communication process, delta is the maximum network delay between the message sender and the message receiver when each communication is performed, and i is a preset weight coefficient.
And if the receiving time standard value is matched with the transmitting time standard value, executing S4, verifying and receiving the information.
And if the receiving time standard value is not matched with the transmitting time standard value, executing S5, and calculating the offset time standard value of the receiving time standard value.
In detail, the offset time standard value refers to that when the receiving time standard value is not within a preset time period corresponding to the sending time standard value, the preset time period corresponding to the receiving time standard value is offset in time, so that the generated offset time standard value can be used for verifying the identity of the sender of the message.
In one embodiment of the present application, the calculating the offset time standard value of the receiving time standard value is that a preset time period corresponding to the receiving time standard value is offset forward by a delta time, where delta is the maximum network delay of the message sender and the message receiver when each communication is performed.
For example, if the preset time period corresponding to the transmission time standard value is [ Gap i, gap i+delta ], the preset time period corresponding to the transmission time standard value is shifted by [ Gap i-delta, gap i ].
S6, judging whether the offset time standard value is matched with the transmission time standard value.
In detail, the step of determining whether the offset time standard value matches the transmission time standard value is consistent with the step of determining whether the receiving time standard value matches the transmission time standard value in S3, which is not described herein.
If the offset time standard value matches the transmission time standard value, returning to S4,
And if the offset time standard value is not matched with the transmission time standard value, executing S7, checking that the message is not passed, and rejecting the message.
In detail, the step of verifying and rejecting the message is consistent with the step of extracting the sender identity in the message in S1, and will not be described again.
And S8, when the preset message field is consistent with a preset transmission verification value field, verifying the message sender according to the transmission verification value and the receiving time standard value.
In this embodiment of the present application, the verifying the message sender according to the sending verification value and the receiving time standard value includes:
dividing the receiving time value by a preset shortest communication duration to obtain a receiving time standard value;
calculating a receiving verification value by using the receiving time standard value, the sender ID and the receiver ID, and judging whether the receiving verification value is matched with the sending verification value or not;
if the information is matched, the verification is passed, and the information is received;
if the received verification value is not matched with the transmitted verification value, calculating a received verification value by using the offset time standard value, judging whether the received verification value is matched with the transmitted verification value, and if the received verification value is matched with the transmitted verification value, verifying that the received verification value passes the received verification value; if not, the verification fails to reject the information.
In detail, the dividing the sending time standard value by the preset shortest communication duration to obtain a time standard value includes:
dividing the sending time standard value by a preset shortest communication duration by using the following division formula to obtain a time standard value:
wherein C is the time standard value, gap is the shortest communication duration between the message sender and the message receiver when each communication is performed, and T is the sending time standard value.
S9, judging whether the verification is passed, and returning to S4 to receive the information when the verification is passed.
And when the verification is not passed, executing S10, and calculating the receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by utilizing a preset one-way function.
In this embodiment of the present application, when the receiving time standard value is within a preset time period corresponding to the sending time standard value, a preset one-way function may be used to calculate the receiving time standard value, the ID of the message sender, and the ID of the message receiver, so as to obtain a standard value; wherein the standard value may be used to verify the identity of the sender of the message.
The calculating, by using a preset one-way function, a sending verification value according to the receiving time standard value, the message sender ID and the message receiver ID includes:
dividing the sending time value by a preset shortest communication duration to obtain a sending time standard value;
and calculating a transmission verification value by using the identity of the message sender and the message receiver and the transmission time standard value.
In the embodiment of the present invention, the calculating, by using a preset one-way function, a verification value according to the time standard value, the ID of the message sender, and the ID of the message receiver includes:
calculating a receiving verification value according to the time standard value, the ID of the message sender and the ID of the message receiver by using the following one-way function and a preset one-way function:
H=P(ID 1 +ID 2 +C)
wherein H is the verification value, P is a preset one-way function, and ID 1 For the identity of the sender of the message, ID 2 And C is the time standard value for the identity of the message receiver.
In detail, the one-way function includes, but is not limited to, a Keccak function, a hash function.
S11, judging whether the receiving verification value is consistent with the sending verification value or not;
if the received verification value is consistent with the sent verification value, returning to the step S4;
if the receiving verification value is inconsistent with the sending verification value, S12 is executed, and the receiving party recalculates the receiving verification value by using the offset time standard value of the receiving time, the ID of the message sending party and the ID of the message receiving party.
S13, judging whether the recalculated receiving verification value is consistent with the transmitting verification value;
if the recalculated received verification value is consistent with the transmitted verification value, returning to the step S4;
if the recalculated received authentication value does not match the transmitted authentication value, then S7 is returned.
According to the method, the receiving time standard value of the message can be judged to be located in the interval, targeted identity verification is achieved, when the receiving time standard value is in the preset time period corresponding to the sending time standard value, the verification value is directly calculated to verify the sender, when the receiving time standard value is not in the preset time period corresponding to the sending time standard value, the verification value and the auxiliary value are combined to verify the sender identity, targeted identity verification is achieved, confidentiality of the time standard value is guaranteed through a one-way function in the verification process, accuracy of identity verification is further improved, safety of the data transmission process is guaranteed, and the problem that safety of data transmission in the communication process is low can be solved.
As shown in fig. 2, an embodiment of the present application provides a schematic block diagram of a message time verification apparatus 10, where the message time verification apparatus 10 includes: the data processing module 11, the first authentication module 12 and the second authentication module 13.
The data processing module 101 is configured to receive a message of a message sender, extract a sender identity in the message, and obtain a sending time standard value of the message; inquiring an acceptance time standard value according to the transmission time standard value;
the first verification module 102 is configured to determine whether the receiving time standard value matches the sending time standard value; if the receiving time standard value is matched with the transmitting time standard value, verifying to pass and receiving the information; if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value; if the offset time standard value is matched with the transmission time standard value, verifying to pass and receiving the information; if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
the second verification module 103 is configured to verify the message sender according to the sending verification value and the receiving time standard value; calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function; judging whether the receiving verification value is consistent with the sending verification value or not; if the received verification value is consistent with the transmitted verification value, the verification is passed and the information is received; if the received verification value is inconsistent with the transmitted verification value, the verification fails and the information is refused to be received.
As shown in fig. 3, the embodiment of the present application provides a message time verification device, which includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 perform communication with each other through the communication bus 114,
a memory 113 for storing a computer program;
in one embodiment of the present application, the processor 111 is configured to implement the message time verification method provided in any one of the foregoing method embodiments when executing the program stored in the memory 113, where the method includes:
receiving a message of a message sender, extracting a sender identity and a preset message field in the message, and acquiring a sending time standard value of the message;
judging whether the preset message field is consistent with a preset transmission time standard value or not, and judging whether the preset message field is consistent with a preset transmission verification value field or not;
when the preset message field is consistent with a preset sending time standard value, judging whether the receiving time standard value is matched with the sending time standard value or not;
if the receiving time standard value is matched with the transmitting time standard value, verifying to pass and receiving the information;
if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value;
if the offset time standard value is matched with the transmission time standard value, verifying to pass and receiving the information;
if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
when the preset message field is consistent with a preset transmission verification value field, verifying the message sender according to the transmission verification value and the receiving time standard value;
calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function;
judging whether the receiving verification value is consistent with the sending verification value or not;
if the received verification value is consistent with the transmitted verification value, the verification is passed and the information is received;
if the receiving verification value is inconsistent with the sending verification value, the receiving party recalculates the receiving verification value by using the offset time standard value of the receiving time, the ID of the message sending party and the ID of the message receiving party, and if the recalculated receiving verification value is consistent with the sending verification value, the verification is passed and the information is received;
if the recalculated received verification value is inconsistent with the transmitted verification value, the verification fails and the information is refused to be received.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the message time verification method provided by any one of the method embodiments described above.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the application to enable one skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method of message time verification, the method comprising:
receiving a message of a message sender, extracting a sender identity and a preset message field in the message, and acquiring a receiving time standard value of the message, wherein the receiving time standard value is divided by a preset shortest communication duration to obtain the receiving time standard value;
judging whether the preset message field is consistent with the receiving time standard value or not, and judging whether the preset message field is consistent with a preset sending verification value field or not;
when the preset message field is consistent with the receiving time standard value, judging whether the receiving time standard value is matched with the sending time standard value or not, namely judging whether the receiving time standard value is in a preset time period corresponding to the sending time standard value, wherein the preset time period corresponding to the sending time standard value is [ Gap i, gap i+delta ], the Gap is the shortest communication duration time of the message sender and the message receiver when each communication is performed, namely that the message sender and the message receiver cannot perform a new communication process within the Gap duration time, the delta is the maximum network delay time of the message sender and the message receiver when each communication is performed, and the i is a preset weight coefficient;
if the receiving time standard value is matched with the sending time standard value, verifying to pass and receiving the message;
if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value, wherein the calculating of the offset time standard value of the receiving time standard value is that a preset time period corresponding to the receiving time standard value is offset forwards by a delta time, and the delta is the maximum network delay of the message sender and the message receiver when each communication is carried out;
if the offset time standard value is matched with the sending time standard value, verifying to pass and receiving the message;
if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
when the preset message field is consistent with a preset transmission verification value field, verifying the message sender according to the preset transmission verification value field and the receiving time standard value, including:
calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function;
judging whether the received verification value is consistent with the preset transmission verification value field or not;
if the received verification value is consistent with the preset transmission verification value field, verifying and receiving the message;
if the receiving verification value is inconsistent with the preset transmitting verification value field, the receiving party recalculates the receiving verification value by using the offset time standard value, the message sender ID and the message receiver ID, and if the recalculated receiving verification value is consistent with the preset transmitting verification value field, the message is verified and received;
if the recalculated received verification value is inconsistent with the preset transmitted verification value field, the verification fails and the message is refused to be received.
2. The message time verification method according to claim 1, wherein the extracting the sender identity in the message comprises:
dividing the message into a plurality of fields according to a preset separator;
numbering the plurality of fields according to a position message from front to back in the message for each field;
and selecting a field with a preset number as the sender identity.
3. The message time verification method according to claim 1, wherein said determining whether the preset message field is consistent with the reception time standard value comprises:
compiling the sender identity and the receiver identity into an identity retrieval field, and adding the identity retrieval field into a pre-generated query statement;
sending a time standard value query instruction to a preset server by using the query statement, and taking the acquired time standard value returned by the preset server as the receiving time standard value;
comparing whether the content of the preset message field is the same as the receiving time standard value;
when the content of the preset message field is the same as the receiving time standard value, determining that the preset message field is consistent with the preset receiving time standard value;
and when the content of the preset message field is different from the receiving time standard value, determining that the preset message field is inconsistent with the preset receiving time standard value.
4. The message time verification method according to claim 1, wherein the calculating a reception verification value from the reception time standard value, the message sender ID, and the message receiver ID using a preset one-way function includes:
calculating the receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using the following preset one-way function:
H=P(ID 1 +ID 2 +C)
wherein H is the receiving verification value, P is a preset one-way function, ID 1 For the identity of the sender of the message, ID 2 C is the standard value of the receiving time for the identity of the message receiver.
5. The message time verification method of claim 1, further comprising;
calculating a transmission verification value according to the transmission time standard value, the message sender ID and the message receiver ID by using a preset one-way function;
the calculating, by using a preset one-way function, a transmission verification value according to the transmission time standard value, the message sender ID and the message receiver ID includes:
dividing the transmission time value by a preset shortest communication duration to obtain the transmission time standard value;
and calculating the transmission verification value by using the identity of the message sender and the message receiver and the transmission time standard value.
6. A message time verification method according to any one of claims 1 to 5, wherein the identity comprises a telephone number, an IP address.
7. A message time verification apparatus, the apparatus comprising:
the data processing module is used for receiving the message of the message sender, extracting the sender identity mark and the preset message field in the message, and acquiring the receiving time standard value of the message, wherein the receiving time standard value is divided by the preset shortest communication duration to obtain the receiving time standard value; judging whether the preset message field is consistent with the receiving time standard value or not, and judging whether the preset message field is consistent with a preset sending verification value field or not;
the first verification module is configured to determine whether the receiving time standard value matches with the sending time standard value when the preset message field is consistent with the receiving time standard value, that is, determine whether the receiving time standard value is within a preset time period corresponding to the sending time standard value, where the preset time period corresponding to the sending time standard value is [ Gap i, gap i+delta ], where Gap is a shortest communication duration time of the message sender and the message receiver when each communication is performed, that is, in each Gap duration time, the message sender and the message receiver will not perform a new communication process, and delta is a maximum network delay time of the message sender and the message receiver when each communication is performed, and i is a preset weight coefficient; if the receiving time standard value is matched with the sending time standard value, verifying to pass and receiving the message; if the receiving time standard value is not matched with the transmitting time standard value, calculating an offset time standard value of the receiving time standard value, wherein the calculating of the offset time standard value of the receiving time standard value is that a preset time period corresponding to the receiving time standard value is offset forwards by a delta time, and the delta is the maximum network delay of the message sender and the message receiver when each communication is carried out; if the offset time standard value is matched with the sending time standard value, verifying to pass and receiving the message; if the offset time standard value is not matched with the transmission time standard value, verifying that the offset time standard value is not passed, and rejecting the message;
the second verification module is configured to verify the message sender according to the preset transmission verification value field and the reception time standard value when the preset message field is consistent with the preset verification value field, and includes: calculating a receiving verification value according to the receiving time standard value, the message sender ID and the message receiver ID by using a preset one-way function; judging whether the received verification value is consistent with the preset transmission verification value field or not; if the received verification value is consistent with the preset transmission verification value field, verifying and receiving the message; if the receiving verification value is inconsistent with the preset transmitting verification value field, the receiving party recalculates the receiving verification value by using the offset time standard value, the message sender ID and the message receiver ID, and if the recalculated receiving verification value is consistent with the preset transmitting verification value field, the message is verified and received; if the recalculated received verification value is inconsistent with the preset transmitted verification value field, the verification fails and the message is refused to be received.
8. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the steps of the message time verification method of any one of claims 1 to 6 when executing a program stored on a memory.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the message time verification method according to any one of claims 1-6.
CN202111619310.8A 2021-12-27 2021-12-27 Message time verification method, device, equipment and medium Active CN114422140B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111619310.8A CN114422140B (en) 2021-12-27 2021-12-27 Message time verification method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111619310.8A CN114422140B (en) 2021-12-27 2021-12-27 Message time verification method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN114422140A CN114422140A (en) 2022-04-29
CN114422140B true CN114422140B (en) 2024-03-12

Family

ID=81268982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111619310.8A Active CN114422140B (en) 2021-12-27 2021-12-27 Message time verification method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114422140B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005142719A (en) * 2003-11-05 2005-06-02 Nippon Telegr & Teleph Corp <Ntt> System, method, and program for message verification
CN106612265A (en) * 2015-10-27 2017-05-03 阿里巴巴集团控股有限公司 Instant messaging method and server
CN108292994A (en) * 2015-09-30 2018-07-17 诺基亚技术有限公司 Information authentication
CN110896390A (en) * 2018-09-12 2020-03-20 华为技术有限公司 Message sending method, message verification method, device and communication system
US11025642B1 (en) * 2018-03-23 2021-06-01 Amazon Technologies, Inc. Electronic message authentication
CN112929339A (en) * 2021-01-21 2021-06-08 艾迪通证技术(北京)有限公司 Message transmitting method for protecting privacy

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9712515B2 (en) * 2012-12-21 2017-07-18 Cellco Partnership Verifying an identity of a message sender
EP3363152B1 (en) * 2015-10-16 2021-07-21 Nokia Technologies Oy Message authentication
CN107196842B (en) * 2016-03-14 2020-07-14 阿里巴巴集团控股有限公司 Method and device for realizing message anti-counterfeiting

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005142719A (en) * 2003-11-05 2005-06-02 Nippon Telegr & Teleph Corp <Ntt> System, method, and program for message verification
CN108292994A (en) * 2015-09-30 2018-07-17 诺基亚技术有限公司 Information authentication
CN106612265A (en) * 2015-10-27 2017-05-03 阿里巴巴集团控股有限公司 Instant messaging method and server
US11025642B1 (en) * 2018-03-23 2021-06-01 Amazon Technologies, Inc. Electronic message authentication
CN110896390A (en) * 2018-09-12 2020-03-20 华为技术有限公司 Message sending method, message verification method, device and communication system
CN112929339A (en) * 2021-01-21 2021-06-08 艾迪通证技术(北京)有限公司 Message transmitting method for protecting privacy

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A message authentication scheme for VANETs based on trapdoor hash function;Yang Xiaodong et al.;2018 IEEE 3rd International Conference on Big Data Analysis (ICBDA);20180528;全文 *
Group-Signature and Group Session Key Combined Safety Message Authentication Protocol for VANETs;Chunhua Zhang et al.;IEEE Access;20191209;第7卷;全文 *
基于消息池的车联网信息安全高效认证算法;李楠;;佛山科学技术学院学报(自然科学版)(第01期);全文 *

Also Published As

Publication number Publication date
CN114422140A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
US9781134B2 (en) Method and apparatus of identifying user risk
CN108737418B (en) Identity authentication method and system based on block chain
CN106651363B (en) Hardware wallet and holder identity verification method thereof
CN106790156B (en) Intelligent device binding method and device
CN103916244B (en) Verification method and device
CN103107974B (en) A kind of user&#39;s registration and login method and mobile terminal
US20210042442A1 (en) Using machine learning algorithm to ascertain network devices used with anonymous identifiers
JP6880055B2 (en) Message anti-counterfeiting implementation method and device
CN106507354B (en) Method and device for preventing mobile equipment from being maliciously registered
US9918223B2 (en) Fingerprint based communication terminal and method, server and method thereof
CN110795174B (en) Application program interface calling method, device, equipment and readable storage medium
CN110225002A (en) Business handling method and Related product
CN107610452B (en) Quick car booking method and system for short-distance Bluetooth hotspot positioning
WO2019033840A1 (en) Password authentication method for shared device, shared device, cloud server, and system
JP4745965B2 (en) Login method with multiple identifiers for instant messaging system
CN107911398B (en) Identity information authentication method, device and system
CN107086979A (en) A kind of user terminal method for verifying login and device
CN101287010A (en) Method and apparatus for identifying and verifying type of message protocol
CN105450614A (en) Server account login method, apparatus and system
JP2017534964A (en) Password protection question setting method and apparatus
CN108494977B (en) Method, device and system for identifying short signal code
CN114422140B (en) Message time verification method, device, equipment and medium
CN109327475B (en) Multi-layer identity authentication method, device, equipment and storage medium
CN106713114B (en) Verification information processing method and device
CN110086785A (en) User authen method and device based on VPN

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
GR01 Patent grant
GR01 Patent grant