+

CN113328852A - Data encryption/decryption method, device and data transmission system - Google Patents

Data encryption/decryption method, device and data transmission system Download PDF

Info

Publication number
CN113328852A
CN113328852A CN202110557035.5A CN202110557035A CN113328852A CN 113328852 A CN113328852 A CN 113328852A CN 202110557035 A CN202110557035 A CN 202110557035A CN 113328852 A CN113328852 A CN 113328852A
Authority
CN
China
Prior art keywords
data
random
original
plaintext
encryption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110557035.5A
Other languages
Chinese (zh)
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.)
Seeed Development Ltd
Original Assignee
Seeed Development 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 Seeed Development Ltd filed Critical Seeed Development Ltd
Priority to CN202110557035.5A priority Critical patent/CN113328852A/en
Publication of CN113328852A publication Critical patent/CN113328852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a data encryption/decryption method, a device and a data transmission system, wherein the data encryption method comprises the following steps: acquiring original data to be encrypted; performing FEC encoding on the original data to obtain intermediate data; and generating random data, and filling the random data into the intermediate data according to a preset rule to generate a final ciphertext. The data decryption method comprises the following steps: obtaining the received ciphertext; selecting random data from the dense text according to a preset rule, and discarding the random data to obtain intermediate data; and performing FEC decoding on the intermediate data to obtain original data. By implementing the technical scheme of the invention, random data is added into the data after FEC coding to be used as the final ciphertext, and the final ciphertext is transmitted. The method increases the difficulty of cracking, greatly improves the safety of the algorithm, and is particularly suitable for the MCU with limited calculation power.

Description

Data encryption/decryption method, device and data transmission system
Technical Field
The present invention relates to the field of data processing, and in particular, to a data encryption/decryption method, apparatus, and data transmission system.
Background
Electronic products often have safety requirements of program protection and data protection, but due to the limits of cost and MCU performance, an embedded system often cannot apply mainstream encryption algorithms such as AES and RSA with high safety, so that an XOR algorithm with high operation efficiency can be adopted, but the encryption method brings about the problems of low safety and easy cracking by adopting a method of comparing and analyzing a plurality of groups of data.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a data encryption method applied to an embedded system, aiming at the defect of low security of data protection in the prior art.
The technical scheme adopted by the invention for solving the technical problems is as follows: a data encryption method applied to an embedded system is constructed, and the method comprises the following steps:
s11, acquiring original data to be encrypted;
s12, FEC coding is carried out on the original data to obtain intermediate data;
and S13, generating random data, and filling the random data into the intermediate data according to a preset rule to generate a final ciphertext.
Preferably, the step S13 includes:
s131, generating r-bit random data, wherein r is a natural number greater than 1;
s132, splicing the intermediate data and the random data according to a preset first rule to obtain spliced data;
and S133, carrying out interweaving and mixing processing on the spliced data according to a preset second rule to obtain a final ciphertext.
Preferably, the step S12 includes:
s121, FEC encoding is carried out on the original data to obtain encoded data, wherein the data length of the encoded data is m;
and S122, randomly selecting n bit data from the m bit data of the coded data, and replacing the n bit data with a random number to obtain intermediate data, wherein n < m-l, and l is the data length of the original data.
Preferably, the step S11 includes:
directly taking plaintext data as original data to be encrypted; or,
encrypting the plaintext data using an XOR encryption algorithm to obtain the original data; or,
one part of the plaintext data is encrypted using an XOR encryption algorithm, and the encrypted data is combined with another part of the plaintext data to obtain the original data.
The invention also constructs a data decryption method applied to the embedded system, and decrypts the encrypted ciphertext encrypted by using the data encryption method, which comprises the following steps:
s21, acquiring the received ciphertext;
s22, selecting random data from the ciphertext according to a preset rule, and discarding the random data to obtain intermediate data;
and S23, carrying out FEC decoding on the intermediate data to obtain original data.
Preferably, the step S22 includes:
s221, according to a preset second rule, performing mixed de-interleaving processing on the ciphertext to obtain splicing data;
s222, according to a preset first rule, positioning r-bit random data from the spliced data, and discarding the random data to obtain intermediate data, wherein r is a natural number greater than 1.
Preferably, when the original data is data obtained by encrypting plaintext data by using an XOR encryption algorithm, the data decryption method further includes:
decrypting the original data by using an XOR decryption algorithm to obtain plaintext data;
when the raw data comprises a combination of the following two parts: data obtained by encrypting a part of plaintext data by using an XOR encryption algorithm; another part of the plaintext data, the data decryption method further comprising:
decrypting a portion of the original data using an XOR decryption algorithm to obtain plaintext data.
The present invention also constructs a data encryption apparatus applied to an embedded system, including a first processor and a first memory, the first processor implementing the steps of the data encryption method described above when executing a computer program stored in the first memory.
The present invention also constructs a data decryption apparatus applied to an embedded system, comprising a second processor and a second memory, wherein the second processor implements the steps of the data decryption method described above when executing the computer program stored in the second memory.
The present invention also constructs a data transmission system comprising:
the data encryption device described above; and
the data decryption apparatus described above.
The technical scheme provided by the invention is based on a random number protection mechanism, adds random data into FEC-encoded data to be used as a final ciphertext, and transmits the final ciphertext. The method increases the difficulty of cracking, greatly improves the safety of the algorithm, and is particularly suitable for the MCU with limited calculation power.
Drawings
In order to illustrate the embodiments of the invention more clearly, the drawings that are needed in the description of the embodiments will be briefly described below, it being apparent that the drawings in the following description are only some embodiments of the invention, and that other drawings may be derived from those drawings by a person skilled in the art without inventive effort. In the drawings:
FIG. 1 is a flow chart of a first embodiment of a data encryption method applied to an embedded system according to the present invention;
FIG. 2 is a flowchart of a first embodiment of a data decryption method applied to an embedded system.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a first embodiment of a data encryption method applied to an embedded system, where the data encryption method of this embodiment includes the following steps:
s11, acquiring original data to be encrypted;
s12, FEC coding is carried out on the original data to obtain intermediate data;
and S13, generating random data, and filling the random data into the intermediate data according to a preset rule to generate a final ciphertext.
The technical solution of this embodiment is based on a protection mechanism of random numbers, adds random data to FEC-encoded data to serve as a final ciphertext, and transmits the final ciphertext. The method increases the difficulty of cracking, greatly improves the safety of the algorithm, and is particularly suitable for the MCU with limited calculation power.
Fig. 2 is a flowchart of a first embodiment of a data decryption method applied to an embedded system, where the data decryption method of the embodiment is used for decrypting a ciphertext encrypted by using the data encryption method described above, and specifically includes:
s21, acquiring the received ciphertext;
s22, selecting random data from the ciphertext according to a preset rule, and discarding the random data to obtain intermediate data;
and S23, carrying out FEC decoding on the intermediate data to obtain original data.
Further, in an alternative embodiment, step S11 includes: plaintext data, for example, security/sensitive data to be transmitted, is directly used as original data to be encrypted.
In another alternative embodiment, step S11 includes: encrypting the plaintext data using an XOR encryption algorithm to obtain the original data. Correspondingly, the data decryption method of the present invention further comprises: and decrypting the original data by using an XOR decryption algorithm to obtain plaintext data. Of course, in other embodiments, step S11 may employ other existing encryption algorithms to encrypt the plaintext. Correspondingly, when decrypting, the original data is also decrypted by adopting a corresponding existing decryption algorithm.
In yet another alternative embodiment, step S11 includes: one part of the plaintext data is encrypted using an XOR encryption algorithm, and the encrypted data is combined with another part of the plaintext data to obtain the original data. Correspondingly, the data decryption method of the present invention further comprises: decrypting a portion of the original data using an XOR decryption algorithm to obtain plaintext data. Of course, in other embodiments, step S11 may employ other existing encryption algorithms to encrypt a portion of the plaintext. Accordingly, when decrypting, the corresponding existing decryption algorithm is also used to decrypt the corresponding portion of the original data.
In the above embodiment, the original data to be encrypted may be plaintext data, may also be data encrypted by using an XOR encryption algorithm, and may also be a combination of the plaintext data and the data encrypted by using an XOR encryption algorithm, where such data is marked as L and the data length thereof is marked as L.
Further, in an alternative embodiment, step S12 includes:
s121, FEC encoding is carried out on the original data to obtain encoded data, wherein the data length of the encoded data is m;
and S122, randomly selecting n bit data from the m bit data of the coded data, and replacing the n bit data with a random number to obtain intermediate data, wherein n < m-l, and l is the data length of the original data.
In this embodiment, FEC encoding (for example, Reed-solomon encoding) is performed on the original data L to obtain encoded data, where such data is denoted as M, and the data bit length thereof is denoted as M, and then the data length c of redundant data in the encoded data M is: and c is m-l, the data bit length of the redundant data capable of error correction is denoted as n, and n < c is obvious. Then, of the total M bits of the encoded M data, n-bit data is arbitrarily selected and replaced with a random number to obtain intermediate data M'.
Accordingly, in step S23, after FEC decoding operation is performed on the intermediate data M', the original data can be obtained directly because FEC can correct n-bit data.
Further, in an alternative embodiment, step S13 includes:
s131, generating r-bit random data, wherein r is a natural number greater than 1;
s132, splicing the intermediate data and the random data according to a preset first rule to obtain spliced data;
and S133, carrying out interweaving and mixing processing on the spliced data according to a preset second rule to obtain a final ciphertext.
In this embodiment, the data length of the generated random data R is R, and when encrypting, the intermediate data M' is first spliced with the random data R to obtain spliced data S: and then, interleaving and mixing the spliced data S according to the preset convention to obtain the final ciphertext S'.
Accordingly, in an alternative embodiment, step S22 includes:
s221, according to a preset second rule, performing mixed de-interleaving processing on the ciphertext to obtain splicing data;
s222, according to a preset first rule, positioning r-bit random data from the spliced data, and discarding the random data to obtain intermediate data, wherein r is a natural number greater than 1.
The invention also constructs a data encryption device applied to the embedded system, which comprises a first processor and a first memory, wherein the first processor realizes the steps of the data encryption method when executing the computer program stored in the first memory.
The invention also constructs a data decryption device applied to the embedded system, which comprises a second processor and a second memory, wherein the second processor realizes the steps of the data decryption method when executing the computer program stored in the second memory.
The present invention also constructs a data transmission system, which includes a data encryption device and a data decryption device, and the logical structures of the data encryption device and the data decryption device can refer to the foregoing descriptions, which are not repeated herein.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. A data encryption method applied to an embedded system is characterized by comprising the following steps:
s11, acquiring original data to be encrypted;
s12, FEC coding is carried out on the original data to obtain intermediate data;
and S13, generating random data, and filling the random data into the intermediate data according to a preset rule to generate a final ciphertext.
2. The data encryption method according to claim 1, wherein the step S13 includes:
s131, generating r-bit random data, wherein r is a natural number greater than 1;
s132, splicing the intermediate data and the random data according to a preset first rule to obtain spliced data;
and S133, carrying out interweaving and mixing processing on the spliced data according to a preset second rule to obtain a final ciphertext.
3. The data encryption method according to claim 1, wherein the step S12 includes:
s121, FEC encoding is carried out on the original data to obtain encoded data, wherein the data length of the encoded data is m;
and S122, randomly selecting n bit data from the m bit data of the coded data, and replacing the n bit data with a random number to obtain intermediate data, wherein n < m-l, and l is the data length of the original data.
4. The data encryption method according to claim 1, wherein the step S11 includes:
directly taking plaintext data as original data to be encrypted; or,
encrypting the plaintext data using an XOR encryption algorithm to obtain the original data; or,
one part of the plaintext data is encrypted using an XOR encryption algorithm, and the encrypted data is combined with another part of the plaintext data to obtain the original data.
5. A data decryption method applied to an embedded system, for decrypting a ciphertext encrypted by using the data encryption method of any one of claims 1 to 4, comprising:
s21, acquiring the received ciphertext;
s22, selecting random data from the ciphertext according to a preset rule, and discarding the random data to obtain intermediate data;
and S23, carrying out FEC decoding on the intermediate data to obtain original data.
6. The data decryption method according to claim 5, wherein the step S22 includes:
s221, according to a preset second rule, performing mixed de-interleaving processing on the ciphertext to obtain splicing data;
s222, according to a preset first rule, positioning r-bit random data from the spliced data, and discarding the random data to obtain intermediate data, wherein r is a natural number greater than 1.
7. The data decryption method of claim 5,
when the original data is data obtained by encrypting plaintext data by using an XOR encryption algorithm, the data decryption method further includes:
decrypting the original data by using an XOR decryption algorithm to obtain plaintext data;
when the raw data comprises a combination of the following two parts: data obtained by encrypting a part of plaintext data by using an XOR encryption algorithm; another part of the plaintext data, the data decryption method further comprising:
decrypting a portion of the original data using an XOR decryption algorithm to obtain plaintext data.
8. A data encryption apparatus applied to an embedded system, comprising a first processor and a first memory, wherein the first processor implements the steps of the data encryption method of any one of claims 1 to 4 when executing a computer program stored in the first memory.
9. A data decryption apparatus applied to an embedded system, comprising a second processor and a second memory, wherein the second processor implements the steps of the data decryption method of any one of claims 5 to 7 when executing the computer program stored in the second memory.
10. A data transmission system, comprising:
the data encryption device of claim 8; and
the data decryption device of claim 9.
CN202110557035.5A 2021-05-21 2021-05-21 Data encryption/decryption method, device and data transmission system Pending CN113328852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110557035.5A CN113328852A (en) 2021-05-21 2021-05-21 Data encryption/decryption method, device and data transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110557035.5A CN113328852A (en) 2021-05-21 2021-05-21 Data encryption/decryption method, device and data transmission system

Publications (1)

Publication Number Publication Date
CN113328852A true CN113328852A (en) 2021-08-31

Family

ID=77416225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110557035.5A Pending CN113328852A (en) 2021-05-21 2021-05-21 Data encryption/decryption method, device and data transmission system

Country Status (1)

Country Link
CN (1) CN113328852A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118300892A (en) * 2024-06-03 2024-07-05 深圳市领存技术有限公司 Security network programming method based on rank metric error correction code and related products

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11340971A (en) * 1998-05-27 1999-12-10 Toppan Printing Co Ltd Encryption / decryption processing device
EP2148462A1 (en) * 2008-07-22 2010-01-27 University College Cork A differential side-channel analysis countermeasure
US20170295489A1 (en) * 2016-04-06 2017-10-12 Samsung Electronics Co., Ltd. System and method for validating authenticity of base station and/or information received from base station
CN108259162A (en) * 2016-12-28 2018-07-06 航天信息股份有限公司 A kind of method for storing cipher key
CN109818739A (en) * 2019-01-24 2019-05-28 中国人民武装警察部队工程大学 A Generative Image Steganography Method Based on Adversarial Networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11340971A (en) * 1998-05-27 1999-12-10 Toppan Printing Co Ltd Encryption / decryption processing device
EP2148462A1 (en) * 2008-07-22 2010-01-27 University College Cork A differential side-channel analysis countermeasure
US20170295489A1 (en) * 2016-04-06 2017-10-12 Samsung Electronics Co., Ltd. System and method for validating authenticity of base station and/or information received from base station
CN108259162A (en) * 2016-12-28 2018-07-06 航天信息股份有限公司 A kind of method for storing cipher key
CN109818739A (en) * 2019-01-24 2019-05-28 中国人民武装警察部队工程大学 A Generative Image Steganography Method Based on Adversarial Networks

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118300892A (en) * 2024-06-03 2024-07-05 深圳市领存技术有限公司 Security network programming method based on rank metric error correction code and related products
CN118300892B (en) * 2024-06-03 2024-10-22 深圳市领存技术有限公司 Security network programming method based on rank metric error correction code and related products

Similar Documents

Publication Publication Date Title
JP5395051B2 (en) A low complexity encryption method for content encoded by rateless codes
JP2014142663A (en) Method and entity for probabilistic symmetrical encryption
KR20120072011A (en) Data encoding and decoding apparatus capable of verifying integrity
US20160344428A1 (en) Joint encryption and error correction encoding
RU2011103192A (en) METHODS AND DEVICES OF SELECTED DATA ENCRYPTION
JP4550005B2 (en) Communication apparatus and method for providing an encrypted array of information units
JP2013523043A (en) How to identify and protect the integrity of a source dataset
US20020018561A1 (en) Data encryption and decryption using error correction methodologies
WO2014154273A1 (en) Aes implementation with error correction
WO2014154271A1 (en) Data processing
JP2007020151A6 (en) Communication apparatus and method for providing an encrypted array of information units
GB2612142A (en) A method of constructing a public-key system in qap-based homomorphic encryption
KR20180006250A (en) Method for managing encrypted file in mobile device and encrypted file management system having the same
CN113328852A (en) Data encryption/decryption method, device and data transmission system
CN1863042A (en) Method for information encryption
CN104393988B (en) A kind of reversible data ciphering method and device
US11341217B1 (en) Enhancing obfuscation of digital content through use of linear error correction codes
US11196447B2 (en) Computer-implemented method for error-correction-encoding and encrypting of a file
CN117725605A (en) Method and system for remotely and automatically compiling electronic archive file information confidentiality
WO2019052844A1 (en) A method for sending digital data over a number of channels
JP5110956B2 (en) Encryption device and decryption device
JP6631989B2 (en) Encryption device, control method, and program
CN118158021B (en) A data transmission processing method and system based on Glink bus protocol
GB2597333A (en) Key exchange protocol
US12088709B2 (en) Information processing apparatus, information processing method, and storage system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210831

RJ01 Rejection of invention patent application after publication
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载