Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Fig. 1 is a flowchart illustrating a short message processing method according to an embodiment of the present invention.
As shown in fig. 1, a short message processing method provided in an embodiment of the present invention is applied to a sending end, and the method includes:
step 101, when detecting a sending operation of sending a short message to a receiving end, acquiring a first public key corresponding to the receiving end according to a first identification number of the receiving end; and the first public key is sent to the sending end by the server according to the first identification number.
The receiving terminal is a receiving terminal of a short message to be sent, and the sending terminal acquires a first identification number of the receiving terminal when detecting that a user triggers sending operation or the sending terminal automatically executes the sending operation.
Preferably, the first Identification number is a Subscriber Identity Module (SIM) card number of the receiving end; the sending terminal acquires a first public key corresponding to the receiving terminal according to the SIM card number, wherein the first public key is sent by a server in communication connection with the sending terminal; the first public key is a preset public key corresponding to the first identification number, and it can be understood that the first public key has uniqueness.
Optionally, the first public key may be obtained by the sender actively requesting the server, or may be sent by the server to the sender according to a scene requirement.
Referring to fig. 2, a manner in which a sending end sends a public key obtaining request to a server to obtain a first public key is taken as a first example, and in fig. 2, an SIM card number is taken as a first identification number, the sending end first performs step 1, sends the public key obtaining request to the server, and carries the SIM card number of the receiving end in the public key obtaining request. And the server executes the step 2, and feeds back the first public key of the receiving end to the sending end, namely the sending end receives the first public key.
And 102, encrypting the short message according to a first preset algorithm and the first public key, and sending an encrypted ciphertext to the receiving terminal.
The first preset algorithm is a known algorithm or an encryption algorithm agreed with the receiving end in advance, namely, the receiving end can acquire a decryption algorithm corresponding to the first preset algorithm; and the sending end encrypts the short message by combining the first public key according to a first preset algorithm and sends the ciphertext to the receiving end, so that the receiving end decrypts the ciphertext according to the decryption algorithm and a preset private key corresponding to the first public key to obtain the plaintext of the short message. Because the ciphertext is sent, illegal monitoring equipment without a private key, malicious application programs and the like cannot decrypt the ciphertext, and the safe transmission of the short message is guaranteed.
Continuing to refer to fig. 2, after the sending end receives the first public key, firstly, step 3 is executed to encrypt the short message; and then executing the step 4 to send the ciphertext to the receiving end.
In the above embodiment of the present invention, when a sending operation of sending a short message to a receiving end is detected, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end, the short message is encrypted according to a first preset algorithm and the first public key, and an encrypted ciphertext is sent to the receiving end, so as to encrypt the short message; the first public key corresponding to the receiving end is obtained through the first identification number of the receiving end, the short message is encrypted through the first public key, the encryption process does not depend on hardware equipment of the sending end or the receiving end, and the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed. The invention solves the problem of limitation of the short message encryption scheme in the prior art.
Optionally, in this embodiment of the present invention, the step of obtaining, according to the first identifier of the receiving end, the first public key corresponding to the receiving end includes:
when the sending end is in a non-network connection state, acquiring a public key which is pre-stored by the sending end and corresponds to a first identification number of the receiving end, wherein the public key corresponding to the first identification number of the receiving end is a first public key corresponding to the receiving end;
and/or
And when the sending end is in a network connection state, requesting a first public key corresponding to the receiving end from a server according to the first identification number of the receiving end.
Specifically, if the sending end is currently in a non-network connection state and cannot perform instant communication with the server, a first public key locally stored in advance at the sending end is searched; the searching process is summarized according to the first identification number. It can be understood that the first public key locally pre-stored by the sending end is sent by the server to the sending end when the first public key of the receiving end is sent last time the server is requested by the sending end. The first public key is stored locally at the sending end, so that the short message can be sent normally under the condition of no network connection.
When the terminal is in the network connection state, step 1 in the first example is executed, and a public key acquisition request is sent to the server, where the public key acquisition request carries the first identification number of the receiving end.
Further, in the embodiment of the present invention, when the sending end is in the network connection state,
the step of requesting a server for a first public key corresponding to the receiving end according to the first identification number of the receiving end includes:
sending a first acquisition request carrying a first identification number of the receiving end to a server;
receiving a first public key fed back by the server for the first acquisition request; the first public key is the public key corresponding to the first identification number, which is determined by the server according to the pre-established first corresponding relation between the identification number and the public key.
When the terminal is in a network connection state, sending a first acquisition request to the server, wherein the first acquisition request carries a first identification number of a receiving end; after receiving the first acquisition request and extracting the first identification number, the server determines a public key corresponding to the first identification number, namely a first public key, according to a first correspondence relationship between the identification number and the public key, which is established in advance, and feeds the first public key back to the sending end.
In the above embodiment of the present invention, when a sending operation of sending a short message to a receiving end is detected, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end, the short message is encrypted according to a first preset algorithm and the first public key, and an encrypted ciphertext is sent to the receiving end, so as to encrypt the short message; the first public key corresponding to the receiving end is obtained through the first identification number of the receiving end, the short message is encrypted through the first public key, the encryption process does not depend on hardware equipment of the sending end or the receiving end, the applicability is strong, and the sending end feeds back the sent first public key in the local cache server, so that the sending end can also normally send the short message under the condition of no network connection; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as system account numbers do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Fig. 3 is a flowchart illustrating a short message processing method according to another embodiment of the present invention.
As shown in fig. 3, the short message processing method provided in the embodiment of the present invention is applied to a receiving end, and the method includes:
step 301, receiving a ciphertext of a short message sent by a sending end; the cipher text of the short message is obtained by encrypting the short message by the sending end according to a first preset algorithm and a first public key, and the first public key is sent to the sending end by the server according to a first identification number of the receiving end.
The sending terminal is a sending terminal of the short message, the receiving terminal receives the short message in a ciphertext form, and the ciphertext is obtained by encrypting the short message by the sending terminal according to a first preset algorithm and a first public key. The first preset algorithm is a known algorithm or an encryption algorithm agreed with the sending end in advance, namely a decryption algorithm corresponding to the first preset algorithm is known by the receiving end; and the sending end encrypts the short message by combining the first public key according to a first preset algorithm and sends the ciphertext to the receiving end.
Preferably, the first identification number is a receiving terminal SIM card number, and the first public key is sent by a server in communication connection with the receiving terminal; the first public key is a preset public key corresponding to the first identification number, and it can be understood that the first public key has uniqueness.
Step 302, decrypting the ciphertext of the short message according to a pre-stored decryption algorithm of the first preset algorithm and a first private key corresponding to the first public key to obtain a plaintext of the short message.
And the receiving terminal decrypts the short message by combining a first private key corresponding to the first public key according to a pre-stored decryption algorithm of the first preset algorithm to obtain a plaintext of the short message. Because the ciphertext is sent in the sending process of the short message, illegal monitoring equipment without a private key, malicious application programs and the like cannot decrypt the ciphertext, and the safe transmission of the short message is guaranteed.
With continued reference to fig. 2, after the sending end executes step 4 and sends the ciphertext to the receiving end, the receiving end executes step 5 to decrypt the ciphertext.
In the embodiment of the present invention, after receiving a ciphertext of a short message sent by a sending end, according to a pre-stored decryption algorithm of the first preset algorithm and a first private key corresponding to the first public key, the ciphertext of the short message is decrypted to obtain a plaintext of the short message, so as to implement encrypted transmission of the short message; the sending end encrypts the short message according to the first public key of the receiving end, and the encryption process does not depend on hardware equipment of the sending end or the receiving end, so that the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as system account numbers do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed. The invention solves the problem of limitation of the short message encryption scheme in the prior art.
Optionally, in the embodiment of the present invention, before the step of receiving the ciphertext of the short message sent by the sending end, the method includes:
the method comprises the steps of firstly, generating a feature code of the receiving end according to a second preset algorithm, and generating a first public key of the receiving end according to a third preset algorithm.
And secondly, sending a first request message carrying the feature code to a short message gateway server, so that the short message gateway server determines a first identification number of the receiving end and sends a second corresponding relation between the first identification number and the feature code to the server.
And thirdly, sending a registration request carrying a third corresponding relation between the feature code and the first public key to the server.
Before receiving the short message in the form of ciphertext, the receiving end needs to register with the server, and the registering process at least comprises the three steps. The method comprises the steps that firstly, a receiving end generates a feature code of the receiving end according to a second preset algorithm, the feature code has uniqueness, the feature code can be a Universal Unique Identifier (UUID), and a first public key of the receiving end is generated according to a third preset algorithm.
And secondly, the receiving end sends a first request message to the short message gateway server, and the feature code is carried in the first request message. The first request message is used for requesting or indicating the short message gateway server to determine a first identification number of the receiving end, determining a second corresponding relation between the first identification number and the feature code, and sending the second corresponding relation to the server; if the first identification number is the SIM card number, the short message gateway server can determine the SIM card number of the receiving terminal by itself.
As a second example, referring to fig. 4, the receiving end performs step 1 to send a first request message to the short message gateway server. And (3) the short message gateway server executes the step (2) and sends the second corresponding relation to the server.
And thirdly, the receiving end carries the third corresponding relation between the feature code and the first public key in the registration request and sends the registration request to the server.
With continued reference to fig. 4, the receiving end performs step 3 to send a registration request to the server.
Optionally, in this embodiment of the present invention, the step of generating the first public key of the receiving end according to a third preset algorithm includes:
and generating a first public key of the receiving end and a first private key corresponding to the first public key according to a third preset algorithm.
The receiving terminal generates a first public key of the receiving terminal and a first private key corresponding to the first public key according to a third preset algorithm, so that after a short message in a ciphertext form is received, a ciphertext of the short message is decrypted, and a plaintext of the short message is obtained.
In the embodiment of the present invention, after receiving a ciphertext of a short message sent by a sending end, according to a pre-stored decryption algorithm of the first preset algorithm and a first private key corresponding to the first public key, the ciphertext of the short message is decrypted to obtain a plaintext of the short message, so as to implement encrypted transmission of the short message; the sending end encrypts the short message according to the first public key of the receiving end, and the encryption process does not depend on hardware equipment of the sending end or the receiving end, so that the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as system account numbers do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Another embodiment of the present invention further provides a short message processing method applied to a server, where the method includes:
and sending a first public key corresponding to a receiving end to a sending end of the short message according to a first identification number of the receiving end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key and sends an encrypted ciphertext to the receiving end.
The first identification number is the SIM card number of the receiving terminal; when the server receives a first identification number of a short message receiving end, a first public key of the corresponding receiving end is searched according to the first identification number, and the first public key is sent to a sending end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key, and sends an encrypted ciphertext to the receiving end; the first preset algorithm is a known algorithm or an encryption algorithm agreed with the receiving end in advance, namely, the receiving end can acquire a decryption algorithm corresponding to the first preset algorithm; and the receiving terminal decrypts the ciphertext according to the decryption algorithm corresponding to the first preset algorithm and the private key corresponding to the first public key to obtain the plaintext of the short message, and the encryption transmission process of the short message is completed.
Referring to fig. 2, the server performs step 2 to feed back the first public key of the receiving end to the sending end.
In the above embodiment of the present invention, when receiving the first identification number of a short message receiving end, the server sends the first public key corresponding to the receiving end to the sending end of the short message, so that the sending end encrypts the short message according to the first preset algorithm and the first public key, sends the encrypted ciphertext to the receiving end, and the receiving end decrypts the short message according to the first private key corresponding to the first public key. The invention realizes the encryption transmission process of the short message, the encryption process does not depend on hardware equipment of a sending end or a receiving end, and the applicability is stronger; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as system account numbers do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Optionally, in this embodiment of the present invention, the step of sending, to a sending end of a short message, a first public key corresponding to a receiving end according to a first identification number of the receiving end of the short message includes:
receiving a first acquisition request sent by a short message sending end, wherein the first acquisition request carries a first identification number of a receiving end of the short message;
and determining a first public key corresponding to the first identification number according to a first corresponding relation between the pre-established identification number and the public key.
When the server receives a first acquisition request of the sending end, after a first identification number is extracted, a public key corresponding to the first identification number, namely a first public key, is determined according to a first corresponding relation between the identification number and the public key which is established in advance, and the first public key is fed back to the sending end.
Further, in the embodiment of the present invention, before the step of receiving the first obtaining request sent by the short message sending end, the method includes:
establishing a first corresponding relation between the identification number and the public key;
the step of establishing the first corresponding relationship between the identification number and the public key includes:
receiving a second corresponding relation between the first identification number and a feature code sent by a short message gateway server, wherein the feature code is generated by the receiving end according to a second preset algorithm;
receiving a third corresponding relation which is sent by the receiving end and carries the feature code and the first public key;
and establishing a first corresponding relation between the identification number and the public key according to the second corresponding relation and the third corresponding relation.
In the registration process of the receiving end, the server establishes a first corresponding relation between the identification number and the public key in advance. The server receives a second corresponding relation sent by the short message gateway server, namely the corresponding relation between the first identification number and the feature code; receiving a third corresponding relation sent by the receiving end, namely the corresponding relation between the feature code and the first public key, wherein optionally, the third corresponding relation is carried in a registration request of the receiving end; and finally, integrating the first corresponding relation between the identification number and the public key according to the second corresponding relation and the third corresponding relation.
Continuing with the second example, referring to fig. 4, the server performs step 4, establishing a first correspondence between the identification number and the public key; and step 5, feeding back the registration result to the receiving end.
Specifically, when the third corresponding relationship is carried in the registration request sent by the receiving end,
after the step of establishing the first corresponding relationship between the identification number and the public key, the method further includes:
and feeding back the success of the registration to the receiving end.
And when the third corresponding relation is carried in the registration request sent by the receiving end, the server feeds back the success of registration to the receiving end after establishing the first corresponding relation.
In the foregoing embodiment of the present invention, when the server receives the first identification number of a short message receiving end, the server sends the first public key corresponding to the receiving end to the sending end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key, sends an encrypted ciphertext to the receiving end, and the receiving end decrypts the short message according to a first private key corresponding to the first public key. The invention realizes the encryption transmission process of the short message, the encryption process does not depend on hardware equipment of a sending end or a receiving end, and the applicability is stronger; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
The short message processing method according to the embodiment of the present invention is described above, and the short message processing apparatus according to the embodiment of the present invention is described below with reference to the accompanying drawings.
Referring to fig. 5, an embodiment of the present invention provides a short message processing apparatus, which is applied to a sending end, and the apparatus includes:
a public key obtaining module 501, configured to obtain a first public key corresponding to a receiving end according to a first identification number of the receiving end when a sending operation of sending a short message to the receiving end is detected; and the first public key is sent to the sending end by the server according to the first identification number.
Preferably, the first identification number is a Subscriber Identity Module (SIM) card number of the receiving end; the sending terminal acquires a first public key corresponding to the receiving terminal according to the SIM card number, wherein the first public key is sent by a server in communication connection with the sending terminal; the first public key is a preset public key corresponding to the first identification number, and it can be understood that the first public key has uniqueness.
Referring to fig. 2, a manner in which a sending end sends a public key obtaining request to a server to obtain a first public key is taken as a first example, and in fig. 2, an SIM card number is taken as a first identification number, the sending end first performs step 1, sends the public key obtaining request to the server, and carries the SIM card number of the receiving end in the public key obtaining request. And the server executes the step 2, and feeds back the first public key of the receiving end to the sending end, namely the sending end receives the first public key.
The first preset algorithm is a known algorithm or an encryption algorithm agreed with the receiving end in advance, namely, the receiving end can acquire a decryption algorithm corresponding to the first preset algorithm; and the sending end encrypts the short message by combining the first public key according to a first preset algorithm and sends the ciphertext to the receiving end, so that the receiving end decrypts the ciphertext according to the decryption algorithm and a preset private key corresponding to the first public key to obtain the plaintext of the short message. Because the ciphertext is sent, illegal monitoring equipment without a private key, malicious application programs and the like cannot decrypt the ciphertext, and the safe transmission of the short message is guaranteed.
Continuing to refer to fig. 2, after the sending end receives the first public key, firstly, step 3 is executed to encrypt the short message; and then executing the step 4 to send the ciphertext to the receiving end.
The ciphertext sending module 502 is configured to encrypt the short message according to a first preset algorithm and the first public key, and send the encrypted ciphertext to the receiving end.
Optionally, in this embodiment of the present invention, the public key obtaining module 501 includes:
the first obtaining submodule is used for obtaining a public key which is stored in advance by the sending end and corresponds to a first identification number of the receiving end when the sending end is in a non-network connection state, and the public key corresponding to the first identification number of the receiving end is a first public key corresponding to the receiving end;
and/or
And the second obtaining submodule is used for requesting a first public key corresponding to the receiving end from the server according to the first identification number of the receiving end when the sending end is in a network connection state.
Optionally, in this embodiment of the present invention, when the sending end is in a network connection state,
the second obtaining sub-module is configured to:
sending a first acquisition request carrying a first identification number of the receiving end to a server;
receiving a first public key fed back by the server for the first acquisition request; the first public key is the public key corresponding to the first identification number, which is determined by the server according to the pre-established first corresponding relation between the identification number and the public key.
In the above embodiment of the present invention, when the public key obtaining module 501 detects a sending operation of sending a short message to a receiving end, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end, and the ciphertext sending module 502 encrypts the short message according to a first preset algorithm and the first public key, and sends the encrypted ciphertext to the receiving end, so as to encrypt the short message; the first public key corresponding to the receiving end is obtained through the first identification number of the receiving end, the short message is encrypted through the first public key, the encryption process does not depend on hardware equipment of the sending end or the receiving end, and the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Referring to fig. 6, another embodiment of the present invention provides a short message processing apparatus, including:
the ciphertext receiving module 601 is configured to receive a ciphertext of a short message sent by a sending end; the cipher text of the short message is obtained by encrypting the short message by the sending end according to a first preset algorithm and a first public key, and the first public key is sent to the sending end by the server according to a first identification number of the receiving end.
The sending terminal is a sending terminal of the short message, the receiving terminal receives the short message in a ciphertext form, and the ciphertext is obtained by encrypting the short message by the sending terminal according to a first preset algorithm and a first public key. The first preset algorithm is a known algorithm or an encryption algorithm agreed with the sending end in advance, namely a decryption algorithm corresponding to the first preset algorithm is known by the receiving end; and the sending end encrypts the short message by combining the first public key according to a first preset algorithm and sends the ciphertext to the receiving end.
Preferably, the first identification number is a receiving terminal SIM card number, and the first public key is sent by a server in communication connection with the receiving terminal; the first public key is a preset public key corresponding to the first identification number, and it can be understood that the first public key has uniqueness.
The information decryption module 602 is configured to decrypt the ciphertext of the short message according to a pre-stored decryption algorithm of the first preset algorithm and a first private key corresponding to the first public key, so as to obtain a plaintext of the short message.
And the receiving terminal decrypts the short message by combining a first private key corresponding to the first public key according to a pre-stored decryption algorithm of the first preset algorithm to obtain a plaintext of the short message. Because the ciphertext is sent in the sending process of the short message, illegal monitoring equipment without a private key, malicious application programs and the like cannot decrypt the ciphertext, and the safe transmission of the short message is guaranteed.
With continued reference to fig. 2, after the sending end executes step 4 and sends the ciphertext to the receiving end, the receiving end executes step 5 to decrypt the ciphertext.
Optionally, in an embodiment of the present invention, the apparatus includes:
the public key generating module is used for generating the feature code of the receiving end according to a second preset algorithm and generating a first public key of the receiving end according to a third preset algorithm;
the request sending module is used for sending a first request message carrying the feature code to a short message gateway server, so that the short message gateway server determines a first identification number of the receiving end and sends a second corresponding relation between the first identification number and the feature code to the server;
and the registration module is used for sending a registration request carrying the third corresponding relation between the feature code and the first public key to the server.
Optionally, in this embodiment of the present invention, the public key generating module is configured to:
and generating a first public key of the receiving end and a first private key corresponding to the first public key according to a third preset algorithm.
In the above embodiment of the present invention, after the ciphertext receiving module 601 receives a ciphertext of a short message sent by the sending end, the information decrypting module 602 decrypts the ciphertext of the short message according to the pre-stored decryption algorithm of the first preset algorithm and the first private key corresponding to the first public key, so as to obtain a plaintext of the short message, and implement encryption transmission of the short message; the sending end encrypts the short message according to the first public key of the receiving end, and the encryption process does not depend on hardware equipment of the sending end or the receiving end, so that the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Another embodiment of the present invention provides a short message processing apparatus applied to a server, where the apparatus includes:
the public key distribution module is used for sending a first public key corresponding to a receiving end to a sending end of a short message according to a first identification number of the receiving end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key and sends an encrypted ciphertext to the receiving end.
The first identification number is the SIM card number of the receiving terminal; when the server receives a first identification number of a short message receiving end, a first public key of the corresponding receiving end is searched according to the first identification number, and the first public key is sent to a sending end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key, and sends an encrypted ciphertext to the receiving end; the first preset algorithm is a known algorithm or an encryption algorithm agreed with the receiving end in advance, namely, the receiving end can acquire a decryption algorithm corresponding to the first preset algorithm; and the receiving terminal decrypts the ciphertext according to the decryption algorithm corresponding to the first preset algorithm and the private key corresponding to the first public key to obtain the plaintext of the short message, and the encryption transmission process of the short message is completed.
Referring to fig. 2, the server performs step 2 to feed back the first public key of the receiving end to the sending end.
Optionally, in this embodiment of the present invention, the public key distribution module includes:
the request receiving submodule is used for receiving a first acquisition request sent by a short message sending end, wherein the first acquisition request carries a first identification number of a receiving end of the short message;
and the determining submodule is used for determining a first public key corresponding to the first identification number according to a first corresponding relation between the pre-established identification number and the public key.
Optionally, in an embodiment of the present invention, the apparatus includes:
the establishing module is used for establishing a first corresponding relation between the identification number and the public key;
the establishing module comprises:
the first receiving submodule is used for receiving a second corresponding relation between the first identification number and a feature code sent by the short message gateway server, wherein the feature code is generated by the receiving terminal according to a second preset algorithm;
the second receiving submodule is used for receiving a third corresponding relation which is sent by the receiving terminal and carries the feature code and the first public key;
and the establishing submodule is used for establishing a first corresponding relation between the identification number and the public key according to the second corresponding relation and the third corresponding relation.
Optionally, in this embodiment of the present invention, when the third corresponding relationship is carried in the registration request sent by the receiving end,
the device further comprises:
and the registration feedback module is used for feeding back the success of registration to the receiving end.
In the above embodiment of the present invention, when receiving a first identification number of a short message receiving end, the public key distribution module sends a first public key corresponding to the receiving end to a sending end of the short message, so that the sending end encrypts the short message according to a first preset algorithm and the first public key, sends an encrypted ciphertext to the receiving end, and the receiving end decrypts the short message according to a first private key corresponding to the first public key. The invention realizes the encryption transmission process of the short message, the encryption process does not depend on hardware equipment of a sending end or a receiving end, and the applicability is stronger; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Fig. 7 is a schematic structural diagram of an electronic device according to yet another embodiment of the present invention.
Referring to fig. 7, an embodiment of the present invention provides an electronic device, which includes a memory (memory)71, a processor (processor)72, a bus 73, and a computer program stored in the memory 71 and running on the processor. The memory 71 and the processor 72 complete communication with each other through the bus 73.
The processor 72 is adapted to call program instructions in the memory 71 to implement the method of fig. 1 when executing the computer program.
In another embodiment, the processor, when executing the computer program, implements the method of:
when the sending operation of sending a short message to a receiving end is detected, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end; the first public key is sent to the sending end by the server according to the first identification number;
and encrypting the short message according to a first preset algorithm and the first public key, and sending the encrypted ciphertext to the receiving terminal.
The electronic device provided in the embodiment of the present invention may be configured to execute a program corresponding to the method in the foregoing method embodiment, and details of this implementation are not described again.
In the electronic device provided by the embodiment of the present invention, when the processor executes the computer program and detects a sending operation of sending a short message to a receiving end, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end, the short message is encrypted according to a first preset algorithm and the first public key, and an encrypted ciphertext is sent to the receiving end, so that the encryption of the short message is realized; the first public key corresponding to the receiving end is obtained through the first identification number of the receiving end, the short message is encrypted through the first public key, the encryption process does not depend on hardware equipment of the sending end or the receiving end, and the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
A non-transitory computer readable storage medium is provided according to a further embodiment of the present invention, having a computer program stored thereon, which when executed by a processor implements the steps of fig. 1.
In another embodiment, the computer program when executed by a processor implements a method comprising:
when the sending operation of sending a short message to a receiving end is detected, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end; the first public key is sent to the sending end by the server according to the first identification number;
and encrypting the short message according to a first preset algorithm and the first public key, and sending the encrypted ciphertext to the receiving terminal.
In the non-transitory computer-readable storage medium provided in the embodiment of the present invention, when the computer program is executed by the processor, the method in the foregoing method embodiment is implemented, and details of this implementation are not described again.
When detecting a sending operation of sending a short message to a receiving end, the non-transitory computer-readable storage medium according to the embodiment of the present invention obtains a first public key corresponding to the receiving end according to a first identification number of the receiving end, encrypts the short message according to a first preset algorithm and the first public key, and sends an encrypted ciphertext to the receiving end, thereby encrypting the short message; the first public key corresponding to the receiving end is obtained through the first identification number of the receiving end, the short message is encrypted through the first public key, the encryption process does not depend on hardware equipment of the sending end or the receiving end, and the applicability is high; the whole sending process is simple, information such as account numbers does not need to be verified, software limitations such as an operating system do not exist for the sending end and the receiving end, and convenience in the encryption process is improved while safety of short messages is guaranteed.
Yet another embodiment of the present invention discloses a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-mentioned method embodiments, for example, comprising:
when the sending operation of sending a short message to a receiving end is detected, a first public key corresponding to the receiving end is obtained according to a first identification number of the receiving end; the first public key is sent to the sending end by the server according to the first identification number;
and encrypting the short message according to a first preset algorithm and the first public key, and sending the encrypted ciphertext to the receiving terminal.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.