CN109194676B - Data stream encryption method and data stream decryption method - Google Patents

Data stream encryption method and data stream decryption method Download PDF

Info

Publication number
CN109194676B
CN109194676B CN201811107235.5A CN201811107235A CN109194676B CN 109194676 B CN109194676 B CN 109194676B CN 201811107235 A CN201811107235 A CN 201811107235A CN 109194676 B CN109194676 B CN 109194676B
Authority
CN
China
Prior art keywords
encryption
data stream
terminal
basic
curve
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
CN201811107235.5A
Other languages
Chinese (zh)
Other versions
CN109194676A (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.)
Wuxi Runmeng Software Co ltd
Original Assignee
Wuxi Runmeng Software 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 Wuxi Runmeng Software Co ltd filed Critical Wuxi Runmeng Software Co ltd
Priority to CN201811107235.5A priority Critical patent/CN109194676B/en
Publication of CN109194676A publication Critical patent/CN109194676A/en
Application granted granted Critical
Publication of CN109194676B publication Critical patent/CN109194676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network

Abstract

The invention discloses a data stream encryption method and a data stream decryption method, and belongs to the field of information security. The data stream encryption method comprises the steps of obtaining a basic encryption element; generating a density element curve according to the basic density elements, wherein the density element curve comprises a plurality of encryption elements, and the number of the encryption elements is equal to the number of arrays in the original data stream; the first encryption element in the encryption element curve is not a square number; sequentially encrypting the arrays in the original data stream by using the encryption elements to obtain an encrypted data stream; sending the encrypted data stream, wherein the first terminal and the second terminal use the same basic encryption unit; the problem that when the data stream is encrypted, the encryption speed is low or the security is low is solved, each number in the data stream is encrypted by using different encryption elements, and as each encryption element is determined according to the basic encryption element, one encryption element can not obtain other encryption elements, so that the encryption grade can be improved on the premise of reducing the operation data volume, and the security of the data stream is ensured.

Description

Data stream encryption method and data stream decryption method
Technical Field
The embodiment of the invention relates to the field of information security, in particular to a data stream encryption method and a data stream decryption method.
Background
A data stream is a set of sequential, massive, fast, and continuous arriving data sequences, and a data stream can be considered to be composed of several arrays.
With the rapid development of electronic information technology, more and more data are transmitted by using a network, and in order to ensure the security of the data in the network transmission, the data needs to be encrypted. When data streams such as video and audio are encrypted, the current encryption methods include software encryption, data segment encryption, real-time CPU transport and the like, but the problems of low safety and easy attack or high safety and low operation speed still exist.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a data stream encryption method and a data stream decryption method. The technical scheme is as follows:
in a first aspect, a data stream encryption method is provided, which is applied to a first terminal, and includes:
acquiring a basic secret element;
generating a density element curve according to the basic density elements, wherein the density element curve comprises a plurality of encryption elements, and the number of the encryption elements is equal to the number of arrays in the original data stream; the first encryption element in the encryption element curve is not a square number;
sequentially encrypting the array in the original data stream by using the encryption elements in the encryption element curve to obtain an encrypted data stream;
sending the encrypted data stream to the second terminal;
wherein the first terminal and the second terminal use the same basic secret element.
Optionally, generating a dense element curve according to the basic dense element includes:
generating a first encryption element in the encryption element curve according to the basic encryption element, wherein the basic encryption element and the first encryption element satisfy the following relation:
B2=B1mod N;
generating other encryption elements in the encryption element curve according to the basic encryption element and the first encryption element, wherein the encryption elements in the encryption element curve satisfy the following relations:
(Bi+B)2=Bi+1mod N;
wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
Optionally, sequentially encrypting the arrays in the original data stream by using the encryption elements in the encryption element curve, including:
encrypting the ith array in the original data stream by using the ith encryption element in the encryption element curve;
wherein i is an integer and the initial value is 1.
Optionally, each encryption element in the encryption element curve is not a square number.
Optionally, the basic secret element is a random number.
Optionally, obtaining the basic secret element includes:
receiving a primitive, a public key and an encryption parameter sent by a second terminal;
generating a random number;
generating a basic secret element according to the random number, the public key and the encryption parameter according to the following formula:
qx=Bmod N;
generating the encryption auxiliary information according to the random number, the primitive and the encryption parameter according to the following formula:
Mx=Hmod N,
the second terminal stores a private key matched with the public key, and the private key and the public key satisfy the following relation:
Mp=qmodN,
m represents a primitive, q represents a public key, p represents a private key, N represents an encryption parameter, x represents a random number, B represents a basic primitive, and H represents encryption auxiliary information.
Optionally, sending the encrypted data stream to the second terminal includes:
the encrypted data stream and the encrypted side information are sent to the second terminal.
In a second aspect, a method for decrypting a data stream is provided, which is applied to a second terminal, and includes:
receiving an encrypted data stream sent by a first terminal;
acquiring a basic secret element;
generating a secret element curve according to the basic secret elements, wherein the secret element curve comprises a plurality of encryption elements, and the number of the encryption elements is equal to the number of arrays in the encrypted data stream; the first encryption element in the encryption element curve is not a square number;
sequentially decrypting the array in the encrypted data stream by using the encryption elements in the encryption element curve to obtain an original data stream;
and the basic secret element used by the first terminal and the second terminal is the same.
Optionally, generating a dense element curve according to the basic dense element includes:
generating a first encryption element in the encryption element curve according to the basic encryption element, wherein the basic encryption element and the first encryption element satisfy the following relation:
B2=B1mod N;
generating other encryption elements in the encryption element curve according to the basic encryption element and the first encryption element, wherein the encryption elements in the encryption element curve satisfy the following relations:
(Bi+B)2=Bi+1mod N;
wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
Optionally, sequentially decrypting the encrypted data in the data stream by using the encryption elements in the encryption element curve includes:
decrypting the ith array in the encrypted data stream by using the ith encryption element in the encryption element curve;
wherein i is an integer and the initial value is 1.
Optionally, each encryption element in the encryption element curve is not a square number.
Optionally, the basic secret element is a random number.
Optionally, before receiving the encrypted data stream sent by the first terminal, the method further includes:
sending the primitive, the public key and the encryption parameter to the first terminal; a private key matched with the public key is stored in the second terminal;
receiving an encrypted data stream sent by a first terminal, comprising:
receiving an encrypted data stream and encrypted auxiliary information sent by a first terminal;
wherein, the private key and the public key satisfy the following relation:
Mp=qmodN;
m denotes primitives, p denotes private keys, q denotes public keys, and N denotes encryption parameters.
Optionally, obtaining the basic secret element includes:
obtaining a basic secret element according to a private key and the encryption auxiliary information according to the following formula;
Hp=B mod N,
wherein H represents the encryption auxiliary information, B represents the basic secret element, p represents the private key, and N represents the encryption parameter.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the problem that when the data stream is encrypted, the encryption speed is low or the security is low is solved, different encryption elements are used for encrypting each array in the data stream, and as each encryption element is determined according to the basic encryption element, one encryption element can not obtain other encryption elements, so that the encryption grade can be improved on the premise of reducing the operation data volume, and the security of the data stream is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow diagram illustrating a method of data stream processing in accordance with an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating encryption of an original data stream in accordance with an illustrative embodiment;
FIG. 3 is a flow chart illustrating a method of data stream processing according to another exemplary embodiment;
fig. 4 is a flow chart illustrating a method of data stream processing according to another exemplary embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a data stream processing method according to an embodiment of the present invention is shown. The data stream processing method is suitable for information interaction terminals. Alternatively, the terminal is an electronic device such as a cell phone, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a desktop computer, and a portable computer. The terminal can encrypt and decrypt the data stream.
As shown in fig. 1, the data stream processing method may include the steps of:
in step 101, a first terminal obtains a basic secret element.
In step 102, the first terminal generates a dense element curve according to the basic dense element.
The original data stream consists of several groups of numbers.
The number of the encryption elements in the encryption element curve is equal to the number of the arrays in the original data stream.
The first encryption element in the encryption element curve is not a square number.
Optionally, each encryption element in the encryption element curve is not a square number.
In step 103, the first terminal sequentially encrypts the array in the original data stream by using the encryption elements in the encryption element curve to obtain an encrypted data stream.
The first terminal encrypts the ith number group in the original data stream by using the ith encryption element in the encryption element curve to obtain an encrypted data stream; i is an integer not equal to 0.
As shown in fig. 2, the original data stream 20 may be regarded as a curve, a plurality of encryption keys used for encrypting the original data stream form a key curve 22, and the encrypted data stream 21 obtained by encrypting the original data stream 20 by using the key curve 22 may also be regarded as a curve.
In step 104, the first terminal sends the encrypted data stream to the second terminal.
The first terminal and the second terminal use the same basic secret.
Optionally, the basic secret element is a random number agreed in advance by the first terminal and the second terminal.
Optionally, the basic key is determined according to the primitive, the public key and the encryption parameter sent by the second terminal.
In step 105, the second terminal receives the encrypted data stream transmitted by the first terminal.
In step 106, the second terminal obtains the basic secret.
In step 107, the second terminal generates a dense element curve from the base dense element.
The encryption element curve comprises a plurality of encryption elements, and the number of the encryption elements in the encryption element curve is equal to the number of the arrays in the encryption data stream.
The rule of the first terminal generating the dense element curve according to the basic dense element is the same as the rule of the second terminal generating the dense element curve according to the basic dense element.
In step 108, the second terminal sequentially decrypts the arrays in the encrypted data stream by using the encryption elements in the encryption element curve to obtain the original data stream.
The second terminal decrypts the ith number group in the encrypted data stream by using the ith encryption element in the encryption element curve to obtain an original data stream; i is an integer not equal to 0.
It should be noted that, the above steps 101 to 104 may be executed by the first terminal alone as an embodiment of a data stream encryption method, and the above steps 105 to 108 may be executed by the second terminal alone as an embodiment of a data stream decryption method.
When the basic secret element is a random number pre-agreed by the first terminal and the second terminal, as shown in fig. 3, the data stream processing method may include the steps of:
in step 301, a first terminal obtains a base secret.
In step 302, the first terminal generates a first encryption element in the encryption element curve according to the basic encryption element.
The relationship between the basic encryption element and the first encryption element satisfies formula one:
B2=B1mod N formula one
Wherein B represents a basic secret element, N represents an encryption parameter, B1Representing the 1 st dense element in the dense element curve.
The encryption parameter N is a prime number or a product of several prime numbers, and the encryption parameter N is preset by the first terminal and the second terminal.
The first encryption element is not a square number, so that the basic encryption element can not be cracked, and the encryption reliability can be ensured. If the first encryption element B1For a square number, the basis secret can be derived from a factorization rule.
In step 303, the first terminal generates other encrypted elements in the encrypted element curve according to the base encrypted element and the first encrypted element.
The encryption element in the encryption element curve satisfies the relationship as formula two:
(Bi+B)2=Bi+1mod N formula two
Wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
Through a first encryption unit B1And the basic encryption element B can obtain a second encryption element B2I.e. (B)1+B)2=B2mod N;
Through a second encryption unit B2And the basic encryption element B can obtain a third encryption element B3I.e. (B)2+B)2=B3mod N;
And so on to obtain all the encryption elements in the encryption element curve.
Since the calculation only includes 1 square, the calculation amount is not large.
It should be noted that, since the basic encryption unit B is a random number, the first encryption unit determined according to the first formula may be a square number, when the encryption unit calculated according to the first formula is a square number, the result is not taken as the first encryption unit in the encryption unit curve, the next encryption unit is continuously calculated according to the second formula until the calculated result is not a square number, the number is taken as the first encryption unit in the encryption unit curve, and the subsequent encryption units are sequentially shifted, in other words, when the encryption unit calculated according to the first formula is a square number, the number is turned over; such as: if the first result calculated according to the formula is a square number, the first result is not taken as the first encryption element in the encryption element curve, the first result is substituted into the formula two, if the second result calculated is not a square number, the second result is taken as the first encryption element in the encryption element curve, the subsequent encryption elements are sequentially shifted, and the third result is taken as the second encryption element in the encryption element curve, … ….
In order to increase the encryption level, it may be limited that none of the encryption bins in the secret bin curve is a square number, and if the result calculated according to the first formula and the second formula is a square number, the calculation result is rotated to the null as described above.
In step 304, the first terminal encrypts the ith group in the original data stream by using the ith encryption element in the encryption element curve to obtain an encrypted data stream.
Wherein i is an integer and the initial value is 1.
For example, assume that there are n arrays in the original data stream, and the 1 st encryption element B in the encryption element curve is used1For the 1 st array A in the original data stream1Encrypting to obtain an encrypted array C1Using the 2 nd encryption element B in the encryption element curve2For the 2 nd array A in the original data stream2Encrypting to obtain an encrypted array C2… …, and so on, resulting in an encrypted data stream C1、C2、……、Cn
In step 305, the first terminal sends the encrypted data stream to the second terminal.
Even if the encrypted data stream is intercepted in the sending process of the encrypted data stream, an illegal user obtains the encryption element corresponding to one array, and the illegal user cannot crack the encryption element curve and the encrypted data stream because the illegal user cannot crack the basic encryption element, so that the safety of the data stream is ensured.
In step 306, the second terminal receives the encrypted data stream transmitted by the first terminal.
In step 307, the second terminal obtains the basic secret.
The basic secret element obtained by the second terminal is the same as the basic secret element obtained by the first terminal.
In step 308, the second terminal generates a first encryption element in the encryption element curve according to the basic encryption element.
The relationship between the basic encryption element and the first encryption element satisfies formula one:
B2=B1mod N formula one
Wherein B represents a basic secret element, N represents an encryption parameter, B1Representing the 1 st dense element in the dense element curve.
This step is illustrated in step 302 and will not be described further herein.
In step 309, the second terminal generates other encrypted bins in the encrypted bin curve based on the base encrypted bin and the first encrypted bin.
The encryption element in the encryption element curve satisfies the relationship as formula two:
(Bi+B)2=Bi+1mod N formula two
Wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
This step is illustrated in step 303 and will not be described further herein.
In step 310, the second terminal decrypts the ith group in the encrypted data stream by using the ith encryption element in the encryption element curve to obtain the original data stream.
Wherein i is an integer and the initial value is 1.
For example, assuming that there are n arrays in the encrypted data stream, the 1 st encryption element B in the encryption element curve is used1For the 1 st array C in the encrypted data stream1Encrypting to obtain an array A1Using the 2 nd encryption element B in the encryption element curve2For the 2 nd array C in the encrypted data stream2Encrypting to obtain an array A2… …, and so on, resulting in the original data stream a1、A2、……、An
It should be noted that, the above steps 301 to 305 may be executed by the first terminal alone as an embodiment of a data stream encryption method, and the above steps 306 to 310 may be executed by the second terminal alone as an embodiment of a data stream decryption method.
When the basic key is determined according to the primitive, the public key and the encryption parameter transmitted by the second terminal, as shown in fig. 4, the data stream processing method may include the steps of:
in step 401, the second terminal sends the primitive, the public key and the encryption parameters to the first terminal.
The encryption parameter is a prime number or a product of several prime numbers.
Optionally, the encryption parameter is selected according to the encryption level. The larger the encryption parameter, the longer the length of the encryption parameter.
Optionally, the primitives are randomly generated.
Primitives, public keys, and encryption parameters are parameters that are disclosed externally.
The second terminal stores a private key matched with the public key, and the private key is a parameter which is not disclosed to the outside.
Optionally, the private key is a randomly defined number.
The public key and the private key satisfy the following relationship:
Mp=qmodN,
where M represents primitives, q represents a public key, p represents a private key, and N represents encryption parameters.
In step 402, the first terminal receives the primitive, the public key and the encryption parameter sent by the second terminal.
In step 403, the first terminal generates a random number.
Optionally, the second terminal randomly generates a random number according to the data stream encryption instruction each time, and there is no rule between the random numbers generated each time.
The random number is a parameter that is not disclosed.
In step 404, the first terminal generates a basic secret element according to formula three according to the random number, the public key and the encryption parameter.
qxB mod N formula three
Wherein q represents a public key, N represents an encryption parameter, x represents a random number, and B represents a basic secret element.
In step 405, the first terminal generates the encryption side information according to formula four based on the random number, the primitive and the encryption parameter.
MxH mod N equation four
Where M denotes a primitive, N denotes an encryption parameter, x denotes a random number, and H denotes encryption side information.
It should be noted that step 405 may also be executed before step 404, or step 405 and step 404 may be executed simultaneously, which is not limited in this embodiment of the present invention.
In step 406, the first terminal generates a first encryption element in the encryption element curve according to the basic encryption element.
The relationship between the basic encryption element and the first encryption element satisfies formula one:
B2=B1mod N formula one
Wherein B represents a basic secret element, N represents an encryption parameter, B1Representing the 1 st dense element in the dense element curve.
The first encryption element is not a square number, so that the basic encryption element can not be cracked, and the encryption reliability can be ensured. If the first encryption element B1For a square number, the basis secret can be derived from a factorization rule.
This step is illustrated in step 302 and will not be described further herein.
In step 407, the first terminal generates other encrypted bins in the encrypted bin curve based on the base encrypted bin and the first encrypted bin.
The encryption element in the encryption element curve satisfies the relationship as formula two:
(Bi+B)2=Bi+1mod N formula two
Wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
In order to increase the encryption level, it can be defined that the encryption elements in the encryption element curve are not all square numbers.
This step is illustrated in step 303 and will not be described further herein.
In step 408, the first terminal encrypts the ith group in the original data stream by using the ith encryption cell in the encryption cell curve to obtain an encrypted data stream.
Wherein i is an integer and the initial value is 1.
This step is illustrated in step 304 and will not be described further herein.
In step 409, the first terminal sends the encrypted data stream and the encryption side information to the second terminal.
The encrypted auxiliary information is used to provide auxiliary information for decrypting the ciphertext.
Even if the encrypted data stream is intercepted in the sending process of the encrypted data stream, an illegal user obtains the encryption element corresponding to one array, and the illegal user cannot crack the encryption element curve and the encrypted data stream because the illegal user cannot crack the basic encryption element, so that the safety of the data stream is ensured.
In step 410, the second terminal receives the encrypted data stream and the encryption side information transmitted by the first terminal.
In step 411, the second terminal determines a basic key according to the encryption auxiliary information, the encryption parameter and the private key according to formula five.
HpB mod N equation five
Wherein H represents the encryption auxiliary information, B represents the basic secret element, p represents the private key, and N represents the encryption parameter.
In step 412, the second terminal generates a first encryption element in the encryption element curve from the base encryption element.
The relationship between the basic encryption element and the first encryption element satisfies formula one:
B2=B1mod N formula one
Wherein B represents a basic secret element, N represents an encryption parameter, B1Representing the 1 st dense element in the dense element curve.
This step is illustrated in step 302 and will not be described further herein.
In step 413, the second terminal generates other encrypted elements in the encrypted element curve from the base encrypted element and the first encrypted element.
The encryption element in the encryption element curve satisfies the relationship as formula two:
(Bi+B)2=Bi+1mod N formula two
Wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
This step is illustrated in step 303 and will not be described further herein.
In step 414, the second terminal decrypts the ith group in the encrypted data stream by using the ith encryption element in the encryption element curve to obtain the original data stream.
Wherein i is an integer and the initial value is 1.
This step is illustrated in step 310 and will not be described further herein.
It should be noted that the above steps 402 to 409 can be executed by the first terminal alone as an embodiment of a data stream encryption method, and the above steps 401, 410 to 414 can be executed by the second terminal alone as an embodiment of a data stream decryption method.
When a data stream is encrypted or decrypted, a basic encryption element is obtained, an encryption element curve is generated according to the basic encryption element and encryption parameters, the encryption element curve comprises encryption elements with the number being the same as that of groups in the data stream, the first encryption element in the encryption element curve is not a square number, the groups in the data stream are sequentially encrypted or decrypted by using the encryption elements in the encryption element curve, the problem that the encryption speed is low or the security is not high when the data stream is encrypted is solved, each number in the data stream is encrypted by using different encryption elements, and as each encryption element is determined according to the basic encryption element, one encryption element is known not to obtain other encryption elements, the encryption level can be improved on the premise of reducing the operation data quantity, and the security of the data stream is ensured.
It should be noted that, in the foregoing embodiment, the first terminal is taken as a data stream sender, and the second terminal is taken as a data stream receiver, but the first terminal may also be taken as a data stream receiver, and the second terminal is taken as a data stream sender, which is not limited in this embodiment of the present invention. When the first terminal is the data stream receiver, the execution step of the first terminal is the execution step of the second terminal in the above embodiment, and when the second terminal is the data stream sender, the execution step of the second terminal is the execution step of the first terminal in the above embodiment. The first terminal may act as both a data stream receiver and a data stream sender, and the second terminal may act as both a data stream sender and a data stream receiver.
It should be noted that: the above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A method for encrypting a data stream, the method being applied to a first terminal, the method comprising:
acquiring a basic secret element;
generating a density element curve according to the basic density elements, wherein the density element curve comprises a plurality of encryption elements, and the number of the encryption elements is equal to the number of arrays in the original data stream; the first encryption element in the encryption element curve is not a square number;
sequentially encrypting the array in the original data stream by using the encryption elements in the encryption element curve to obtain an encrypted data stream;
sending the encrypted data stream to a second terminal;
wherein the first terminal and the second terminal use the same basic secret element;
wherein the generating a dense element curve according to the basic dense element comprises:
generating a first encryption element in the encryption element curve according to the basic encryption element, wherein the basic encryption element and the first encryption element satisfy the following relation:
B2=B1modN;
generating other encryption elements in the encryption element curve according to the basic encryption element and the first encryption element, wherein the encryption elements in the encryption element curve satisfy the following relations:
(Bi+B)2=Bi+1modN;
wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
2. The method of claim 1, wherein sequentially encrypting the arrays in the original data stream using the encryption elements in the encryption element curve comprises:
encrypting the ith array in the original data stream by using the ith encryption cell in the encryption cell curve;
wherein i is an integer and the initial value is 1.
3. The method of claim 1, wherein obtaining the base secret comprises:
receiving a primitive, a public key and an encryption parameter sent by a second terminal;
generating a random number;
generating a basic secret element according to the random number, the public key and the encryption parameter according to the following formula:
qx=BmodN;
generating encryption side information H according to the random number, the primitive and the encryption parameter according to the following formula:
Mx=HmodN,
the second terminal stores a private key paired with the public key, and the private key and the public key satisfy the following relationship:
Mp=qmodN,
m represents a primitive, q represents a public key, p represents a private key, N represents an encryption parameter, x represents a random number, B represents a basic primitive, and H represents encryption auxiliary information.
4. The method of claim 3, wherein the sending the encrypted data stream to the second terminal comprises:
and sending the encrypted data stream and the encrypted auxiliary information to the second terminal.
5. A method for decrypting a data stream, the method being applied to a second terminal, the method comprising:
receiving an encrypted data stream sent by a first terminal;
acquiring a basic secret element;
generating a secret element curve according to the basic secret elements, wherein the secret element curve comprises a plurality of encryption elements, and the number of the encryption elements is equal to the number of arrays in the encrypted data stream; the first encryption element in the encryption element curve is not a square number;
sequentially decrypting the array in the encrypted data stream by using the encryption elements in the encryption element curve to obtain an original data stream;
wherein the basic secret element used by the first terminal and the second terminal is the same;
wherein the generating a dense element curve according to the basic dense element comprises:
generating a first encryption element in the encryption element curve according to the basic encryption element, wherein the basic encryption element and the first encryption element satisfy the following relation:
B2=B1modN;
generating other encryption elements in the encryption element curve according to the basic encryption element and the first encryption element, wherein the encryption elements in the encryption element curve satisfy the following relations:
(Bi+B)2=Bi+1modN;
wherein N represents an encryption parameter, B represents a basic secret element, and BiRepresents the ith encryption element in the encryption element curve, i is an integer and the initial value is 1.
6. The method of claim 5, wherein the sequentially decrypting the encrypted data in the data stream using the encryption elements in the encryption element curve comprises:
decrypting the ith array in the encrypted data stream by using the ith encryption cell in the encryption cell curve;
wherein i is an integer and the initial value is 1.
7. The method according to claim 5, wherein before receiving the encrypted data stream transmitted by the first terminal, the method further comprises:
sending primitives, a public key and encryption parameters to the first terminal; a private key matched with the public key is stored in the second terminal;
the receiving of the encrypted data stream sent by the first terminal includes:
receiving an encrypted data stream and encrypted auxiliary information sent by the first terminal;
wherein the private key and the public key satisfy the following relationship:
Mp=qmodN;
m denotes primitives, p denotes private keys, q denotes public keys, and N denotes encryption parameters.
8. The method of claim 7, wherein obtaining the base secret comprises:
obtaining the basic secret element according to a private key and the encryption auxiliary information according to the following formula;
Hp=BmodN,
wherein H represents the encryption auxiliary information, B represents the basic secret element, p represents the private key, and N represents the encryption parameter.
CN201811107235.5A 2018-09-21 2018-09-21 Data stream encryption method and data stream decryption method Active CN109194676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811107235.5A CN109194676B (en) 2018-09-21 2018-09-21 Data stream encryption method and data stream decryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811107235.5A CN109194676B (en) 2018-09-21 2018-09-21 Data stream encryption method and data stream decryption method

Publications (2)

Publication Number Publication Date
CN109194676A CN109194676A (en) 2019-01-11
CN109194676B true CN109194676B (en) 2020-11-27

Family

ID=64909351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811107235.5A Active CN109194676B (en) 2018-09-21 2018-09-21 Data stream encryption method and data stream decryption method

Country Status (1)

Country Link
CN (1) CN109194676B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1173256A (en) * 1995-09-18 1998-02-11 数字保证网络技术股份有限公司 Network security device
CN1633070A (en) * 2004-10-29 2005-06-29 徐子杰 A data encryption/decryption method and encryption/decryption apparatus
CN101465726A (en) * 2007-12-19 2009-06-24 群联电子股份有限公司 Decode-proof method for cipher key as well as controller and memory device for implementing the method
CN102098156A (en) * 2009-12-10 2011-06-15 Nxp股份有限公司 Improvement and correlative improvement in cryptographically transforming data text
CN102216921A (en) * 2008-10-10 2011-10-12 美国亚德诺半导体公司 Method and system for encrypting and decrypting data streams
CN102904713A (en) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 Key exchange method for secret key encryption communication system
CN104022872A (en) * 2014-04-09 2014-09-03 广州赛意信息科技有限公司 Data encryption method
CN104410616A (en) * 2014-11-20 2015-03-11 广州日滨科技发展有限公司 Method and system for encrypting, decrypting and transmitting data
CN107590394A (en) * 2017-08-10 2018-01-16 河海大学 A kind of image encryption method based on chaotic maps and bit recombination

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19963408A1 (en) * 1999-12-28 2001-08-30 Giesecke & Devrient Gmbh Portable data carrier with access protection by key division

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1173256A (en) * 1995-09-18 1998-02-11 数字保证网络技术股份有限公司 Network security device
CN1633070A (en) * 2004-10-29 2005-06-29 徐子杰 A data encryption/decryption method and encryption/decryption apparatus
CN101465726A (en) * 2007-12-19 2009-06-24 群联电子股份有限公司 Decode-proof method for cipher key as well as controller and memory device for implementing the method
CN102216921A (en) * 2008-10-10 2011-10-12 美国亚德诺半导体公司 Method and system for encrypting and decrypting data streams
CN102098156A (en) * 2009-12-10 2011-06-15 Nxp股份有限公司 Improvement and correlative improvement in cryptographically transforming data text
CN102904713A (en) * 2011-07-25 2013-01-30 深圳市金溢科技有限公司 Key exchange method for secret key encryption communication system
CN104022872A (en) * 2014-04-09 2014-09-03 广州赛意信息科技有限公司 Data encryption method
CN104410616A (en) * 2014-11-20 2015-03-11 广州日滨科技发展有限公司 Method and system for encrypting, decrypting and transmitting data
CN107590394A (en) * 2017-08-10 2018-01-16 河海大学 A kind of image encryption method based on chaotic maps and bit recombination

Also Published As

Publication number Publication date
CN109194676A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
US10785019B2 (en) Data transmission method and apparatus
US6125185A (en) System and method for encryption key generation
EP3940988A1 (en) Multi-party threshold authenticated encryption
Almaiah et al. A new hybrid text encryption approach over mobile ad hoc network
US7903820B2 (en) Key production system
CN102437912B (en) Digital rights management method based on N RSA (Rivest Shamir Adleman) encryption algorithms based on chaotic algorithm
CN104967693B (en) Towards the Documents Similarity computational methods based on full homomorphism cryptographic technique of cloud storage
Bisht et al. A comparative study of some symmetric and asymmetric key cryptography algorithms
WO2012172080A1 (en) Generation of cryptographic keys
CN106134128A (en) Use the system and method for the faster public key encryption of associated private key part
JP2004336794A (en) Method and apparatus for generation of public key based on user-defined id in cryptosystem
CN109905229B (en) Anti-quantum computing Elgamal encryption and decryption method and system based on group asymmetric key pool
Azam et al. A novel image encryption scheme based on elliptic curves and coupled map lattices
EP3010173A1 (en) Key storage device, key storage method, and program therefor
CN109495478B (en) Block chain-based distributed secure communication method and system
CN109194676B (en) Data stream encryption method and data stream decryption method
US20020064278A1 (en) High speed RSA public key cryptographic apparatus and method
CN116248359A (en) Data transmission system, method and device based on careless transmission protocol
CN107872312B (en) Method, device, equipment and system for dynamically generating symmetric key
CN109361506B (en) Information processing method
CN111488618B (en) Block chain-based one-time pad encryption method, device and storage medium
EP4097912A1 (en) Method and device for encrypting data
Yusuf et al. Dual encryption method for file security
WO2019220900A1 (en) Encryption system, encryption device, decryption device, encryption method, decryption method, and program
CN112770140A (en) Stream encryption method and system combining Chen's theorem and RSA depth

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