CN109981251B - Random number sequence compression method and device and electronic equipment - Google Patents

Random number sequence compression method and device and electronic equipment Download PDF

Info

Publication number
CN109981251B
CN109981251B CN201910167666.9A CN201910167666A CN109981251B CN 109981251 B CN109981251 B CN 109981251B CN 201910167666 A CN201910167666 A CN 201910167666A CN 109981251 B CN109981251 B CN 109981251B
Authority
CN
China
Prior art keywords
random number
data block
number sequence
encryption operation
input
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
CN201910167666.9A
Other languages
Chinese (zh)
Other versions
CN109981251A (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.)
Hunan Goke Microelectronics Co Ltd
Original Assignee
Hunan Goke Microelectronics 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 Hunan Goke Microelectronics Co Ltd filed Critical Hunan Goke Microelectronics Co Ltd
Priority to CN201910167666.9A priority Critical patent/CN109981251B/en
Publication of CN109981251A publication Critical patent/CN109981251A/en
Application granted granted Critical
Publication of CN109981251B publication Critical patent/CN109981251B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0618Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
    • H04L9/0625Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation with splitting of the data block into left and right halves, e.g. Feistel based algorithms, DES, FEAL, IDEA or KASUMI
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a random number sequence compression method, a device and electronic equipment, wherein the method comprises the following steps: performing nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected from the N data blocks; when N is 1, inputting a parameter into any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence. The technical problems of long length and large occupied space of the random number sequence in the prior art are solved, the length of the random number sequence is reduced, the occupied space of the random number sequence is reduced, and meanwhile, the technical effect that the random number sequence has uniqueness is also kept.

Description

Random number sequence compression method and device and electronic equipment
Technical Field
The invention relates to the field of electronic information processing, in particular to a random number sequence compression method and device and electronic equipment.
Background
The random number has a unique property that, for a random number, the random number has no relation with the random number following it and the random number preceding it. Random numbers are widely used in the field of labeling, for example, a tag is provided for each chip by using a set of random numbers (called a random number sequence), and since each random number has uniqueness, a random number sequence composed of a plurality of unique random numbers has uniqueness, and thus each tag is unique. The number of random numbers included in each set of random number sequences is referred to as the length of the set of random number sequences.
In order to ensure the uniqueness of the random number sequence, the random number sequence generated by the random number generator may include more random numbers than a preset number, and the length of the random number sequence is too long. However, the random number sequence with a length exceeding the preset value is not required in all cases, and the length of the random number sequence is too long, so that the random number sequence occupies a large space, and the memory of the computer is wasted for the computer. Therefore, it is necessary to provide a random number sequence compression method capable of reducing the length of the random number sequence while maintaining the uniqueness of the random number sequence.
Disclosure of Invention
The invention aims to provide a method, a device and electronic equipment for compressing a random number sequence, which aim to reduce the length of the random number sequence and ensure that the compressed random number sequence has uniqueness.
In a first aspect, an embodiment of the present invention provides a method for compressing a random number sequence, including:
performing nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing a random number sequence; when the N is 1, the input parameter is any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1;
and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until the N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence.
Optionally, the performing an nth encryption operation according to the input parameter and the input data block to obtain an output ciphertext of the nth encryption operation includes:
and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation, and performing the nth encryption operation to obtain a ciphertext output by the nth encryption operation.
Optionally, before performing an nth encryption operation according to the input parameter and the input data block to obtain an output ciphertext of the nth encryption operation, the method further includes:
obtaining a random number sequence;
and dividing the random number sequence to obtain the N data blocks, wherein each data block occupies a set byte.
Optionally, the segmenting the random number sequence to obtain N data blocks includes:
if the byte occupied by the data block is smaller than the set byte, supplementing byte bits in the data block so as to enable the data block to occupy the set byte.
In a second aspect, an embodiment of the present invention provides a random number sequence compression apparatus, including:
the first processing module is used for carrying out nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing a random number sequence; when the N is 1, the input parameter is any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1; and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until the N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence.
Optionally, the first processing module is specifically configured to:
and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation, and performing the nth encryption operation to obtain a ciphertext output by the nth encryption operation.
Optionally, the apparatus further comprises:
an obtaining module for obtaining a random number sequence;
and the second processing module is used for segmenting the random number sequence to obtain the N data blocks, wherein each data block occupies a set byte.
Optionally, the second processing module is specifically configured to:
if the byte occupied by the data block is smaller than the set byte, supplementing byte bits in the data block so as to enable the data block to occupy the set byte.
In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of any one of the methods described above.
In a fourth aspect, an embodiment of the present invention provides an electronic device, which is characterized by comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of any one of the methods described above.
Compared with the prior art, the invention has the following beneficial effects:
the embodiment of the invention provides a random number sequence compression method, a random number sequence compression device and electronic equipment, wherein the method comprises the following steps: performing nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected in the N data blocks; the N data blocks are obtained by dividing the random number sequence; when N is 1, inputting a parameter into any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, N is a positive integer greater than or equal to 1 and not greater than N-1; and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence. Performing nth encryption operation according to the input parameters and the input data block to obtain an output ciphertext of the nth encryption operation, and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, using the ciphertext output by the nth encryption operation as a compressed random number sequence, wherein when N is 1, the input parameter is any one data block which is not selected in the N data blocks, when n is larger than 1, the input parameter is the cipher text output by the (n-1) th encryption operation, thus, the N data blocks obtained by segmenting the random number sequence can be gradually encrypted and reduced, and the space occupied by the compressed random number sequence finally obtained is equal to the space occupied by one data block station and is smaller than the space occupied by the random number sequence, so that the length of the random number sequence is reduced, and the space occupied by the random number sequence is reduced. The random number sequence is encrypted by adopting encryption operation, so that the length of the random number sequence is reduced, and the compressed random number sequence keeps the uniqueness of the original random number sequence. Therefore, the technical problems of long length and large occupied space of the random number sequence in the prior art are solved, the length of the random number sequence is reduced, the occupied space of the random number sequence is reduced, and meanwhile, the technical effect that the random number sequence has uniqueness is also kept.
Additional features and advantages of embodiments of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a flowchart of a method for compressing a random number sequence according to an embodiment of the present invention.
Fig. 2 is a schematic diagram illustrating a method for compressing a random number sequence according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating another random number sequence compression method according to an embodiment of the present invention.
Fig. 4 shows a schematic block diagram of a random number sequence compression apparatus according to an embodiment of the present invention.
Fig. 5 is a schematic block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The embodiment of the invention provides a method and a device for compressing a random number sequence and electronic equipment, and aims to solve the technical problems of long length and large occupied space of the random number sequence in the prior art.
Examples
The random number sequence compression method provided by the embodiment of the invention is applied to electronic equipment with a processor, such as a smart phone, a tablet computer, a notebook computer, a PC computer and the like. The method comprises S100 and S400 shown in FIG. 1, and S100 to S400 are explained in conjunction with FIG. 1.
S100: and performing nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext.
The input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing the random number sequence. When N is 1, the input parameter is any one data block which is not selected in the N data blocks; and when n is greater than 1, the input parameter is the ciphertext output by the (n-1) th encryption operation. N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1.
S200: and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence.
By adopting the scheme, the nth encryption operation is carried out according to the input parameters and the input data block to obtain the output ciphertext of the nth encryption operation, and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, using the ciphertext output by the nth encryption operation as a compressed random number sequence, wherein when N takes 1, the input parameter is any one data block which is not selected in the N data blocks, when n is larger than 1, the input parameter is the cipher text output by the (n-1) th encryption operation, thus, the N data blocks obtained by segmenting the random number sequence can be gradually encrypted and reduced, and the space occupied by the compressed random number sequence finally obtained is equal to the space occupied by one data block station and is smaller than the space occupied by the random number sequence, so that the length of the random number sequence is reduced, and the space occupied by the random number sequence is reduced. The random number sequence is encrypted by adopting encryption operation, so that the length of the random number sequence is reduced, and the compressed random number sequence keeps the uniqueness of the original random number sequence. Therefore, the technical problems of long length and large occupied space of the random number sequence in the prior art are solved, the length of the random number sequence is reduced, the occupied space of the random number sequence is reduced, and meanwhile, the technical effect that the random number sequence has uniqueness is also kept.
As an alternative embodiment, the Encryption operation uses a Data Encryption Standard (DES). DES is a block algorithm using key encryption, which was determined in 1977 by the national standards institute of the federal government as the federal data processing standard (FIPS) and authorized for use in non-secure government communications, and then widely spread internationally. The DES encryption algorithm is simple and efficient, and meanwhile, due to the fact that uniqueness is kept between the plaintext and the ciphertext through the DES encryption algorithm, only one group of corresponding plaintext and the corresponding key can obtain the same ciphertext, the probability of repetition of the random number sequence is almost zero after the random number sequence is encrypted through the DES encryption algorithm, and therefore the uniqueness of the original random number sequence can be effectively inherited. Therefore, the DES encryption algorithm is used for operating the random number sequence, so that the length of the random number sequence can be effectively reduced, and the uniqueness of the random number sequence can be ensured.
As an optional implementation manner, the step of performing an nth encryption operation according to the input parameter and the input data block to obtain an output ciphertext of the nth encryption operation specifically includes: and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation to perform the nth encryption operation so as to obtain a ciphertext output by the nth encryption operation. Specifically, when N is 1, none of the N data blocks in the random number sequence is selected, so that two data blocks can be randomly selected as the plaintext and the secret key, for example, a first database is used as the plaintext, a second data block is used as the ciphertext, the ciphertext is input into the encryption operation, and an encrypted ciphertext is output. If N is larger than 2, the output encrypted ciphertext is used as a plaintext, one of the data blocks which are not selected in the N data blocks is selected as the ciphertext, the ciphertext is input into the encryption operation again, and the encrypted ciphertext is output. And the process is circulated until each data block in the N data blocks is selected. The space occupied by the finally obtained compressed random number sequence is equal to the space occupied by one data block station and is smaller than the space occupied by the random number sequence, so that the length of the random number sequence is reduced, and the space occupied by the random number sequence is reduced. The random number sequence is encrypted by adopting encryption operation, so that the length of the random number sequence is reduced, and the compressed random number sequence keeps the uniqueness of the original random number sequence. The following describes in detail the steps of performing the nth encryption operation according to the input parameter and the input data block to obtain the output ciphertext of the nth encryption operation with reference to fig. 2. The random number sequence is divided into N data blocks of P1, P2, P3, P4, … and PN. As an alternative embodiment, first, P1 and P2 are used as the plaintext W (1) and the key K (1) in the 1 st encryption operation, respectively, to perform the 1 st encryption operation, then the ciphertext output from the 1 st encryption operation is used as the plaintext W (2) in the 2 nd encryption operation, the data block P3 is used as the key K (2) in the 2 nd encryption operation, the 2 nd encryption operation is performed, the ciphertext output from the second encryption operation is used as the plaintext W (3) in the 3 rd encryption operation, and the data block P4 is used as the key K (3) in the 3 rd encryption operation, so that the 2 nd encryption operation is performed. The above circulation is carried out until the data block PN is used as the key K (N-1) of the encryption operation of the N-1 st time, the ciphertext output by the encryption operation of the N-1 st time is used as the plaintext W (N-1) of the encryption operation of the N-1 st time, if the PN is P1, P2, P3, P4, …, the last data block in the PN, after the PN is selected, the P1, P2, P3, P4, … and the unselected data blocks do not exist in the PN, the ciphertext C output by the encryption operation of the N-1 st time is used as the compressed random number sequence.
As an alternative embodiment, before S100, the method further includes S001 and S002 as shown in fig. 3, and S001 and S002 are explained below with reference to fig. 3.
S001: a sequence of random numbers is obtained.
S002: and dividing the random number sequence to obtain N data blocks, wherein each data block occupies a set byte.
In the embodiment of the present invention, the random number sequence may be generated by a random number generator, or may be obtained by prediction using a certain prediction algorithm. Specifically, a random number sequence of a set length may be generated by the random number generator, that is, a random number sequence of bytes occupying the set length may be generated by the random number generator, and the random number sequence includes a plurality of random numbers.
For S002, if the byte occupied by the data block is smaller than the set byte, the byte bit is supplemented in the data block so that the data block occupies the set byte. As an alternative implementation, the random numbers in the random number sequence are sorted, and then the random number sequence is divided according to the length of the set byte to obtain N data blocks, where each data block includes a random number occupying the space of the set byte. For example, if 8 bytes of bytes are set, and the random number sequence takes 128 bytes, the random number in the random number sequence is divided into 128/8 ═ 16 data blocks and N ═ 16, in which case each database obtained by dividing the random number sequence takes 8 bytes. When the byte is set to be 8 bytes and the random number sequence occupies 125 bytes, the random number in the random number sequence is divided into [125/8] +1 ═ 16 data blocks, where [125/8] indicates rounding down to 125/8, and then 7 of the 16 data blocks occupy 8 bytes, and one of the data blocks occupies only 5 bytes, and specifically, 0 is supplemented to the 5-byte data block, so that the data block occupies 8 bytes. When performing an encryption operation on the data block, the complementary 0 is used as a random number. Each data block includes a random number that is a sequence of random numbers. Therefore, each data block in the N data blocks comprises the same random number, and the data blocks are encrypted by a DES encryption algorithm, so that the uniqueness of the original random number sequence is kept in the compressed random number sequence. After N-1 times of encryption operation, the output ciphertext occupies the byte space occupied by one data block, so that compared with the original random number sequence, the compressed random number sequence has short length and small occupied space, thereby shortening the length of the random number sequence, reducing the space occupied by the random number sequence, simultaneously ensuring the uniqueness of the random number sequence and keeping the effectiveness of the random number sequence obtained after the random number sequence is compressed.
The embodiment of the present application further provides an execution main body for executing the above steps, and the execution main body may be the random number sequence compression apparatus 200 in fig. 3. Referring to fig. 4, the apparatus includes:
the first processing module 210 is configured to perform an nth encryption operation according to the input parameter and the input data block to obtain an output ciphertext of the nth encryption operation; the input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing a random number sequence; when the N is 1, the input parameter is any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1; and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until the N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence.
As an optional implementation manner, the first processing module 210 is specifically configured to: and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation, and performing the nth encryption operation to obtain a ciphertext output by the nth encryption operation.
As an optional implementation, the apparatus further comprises:
an obtaining module 220, configured to obtain a random number sequence;
the second processing module 230 is configured to segment the random number sequence to obtain the N data blocks, where each data block occupies a set byte.
As an optional implementation manner, the second processing module 230 is specifically configured to:
if the byte occupied by the data block is smaller than the set byte, supplementing byte bits in the data block so as to enable the data block to occupy the set byte.
The first processing module 210, the obtaining module 220, and the second processing module 230 may be connected via a bus 103.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, including a memory 504, a processor 502, and a computer program stored on the memory 504 and executable on the processor 502, where the processor 502 implements the steps of any one of the methods for compressing a random number sequence when executing the program. The functions and technical effects of processing the first processing module 210 and the second processing module 230 in fig. 4 can be implemented by the processor 502 in fig. 5.
Where in fig. 4 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 505 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
Embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the foregoing random number sequence compression methods.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an apparatus according to an embodiment of the invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (8)

1. A random number sequence compression method is applied to a random number sequence compression device, the random number sequence compression device comprises an obtaining module, a first processing module and a second processing module, and the first processing module, the obtaining module and the second processing module are connected through a can bus, and the method comprises the following steps:
the obtaining module obtains a random number sequence;
the second processing module divides the random number sequence to obtain N data blocks, wherein each data block occupies a set byte;
the first processing module carries out nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing a random number sequence; when the N is 1, the input parameter is any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1;
and the first processing module repeats the step of performing the nth encryption operation according to the input parameters and the input data block until N is equal to N-1, and a ciphertext output by the nth encryption operation is used as a compressed random number sequence.
2. The method of claim 1, wherein the performing the nth encryption operation according to the input parameter and the input data block to obtain an output ciphertext of the nth encryption operation comprises:
and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation, and performing the nth encryption operation to obtain a ciphertext output by the nth encryption operation.
3. The method of claim 1, wherein the segmenting the random number sequence to obtain N data blocks comprises:
if the byte occupied by the data block is smaller than the set byte, supplementing byte bits in the data block so as to enable the data block to occupy the set byte.
4. A random number sequence compression device is characterized by comprising an obtaining module, a first processing module and a second processing module, wherein the first processing module, the obtaining module and the second processing module are connected through a can bus:
an obtaining module for obtaining a random number sequence;
the second processing module is used for segmenting the random number sequence to obtain N data blocks, wherein each data block occupies a set byte;
the first processing module is used for carrying out nth encryption operation according to the input parameters and the input data block to obtain an nth encryption operation output ciphertext; the input data block is any one data block which is not selected from the N data blocks; the N data blocks are obtained by dividing a random number sequence; when the N is 1, the input parameter is any one data block which is not selected in the N data blocks; when n is larger than 1, the input parameter is a ciphertext output by the (n-1) th encryption operation; wherein N is a positive integer greater than 2, and N is a positive integer greater than or equal to 1 and not greater than N-1; and repeating the step of performing the nth encryption operation according to the input parameters and the input data block until the N is equal to N-1, and taking a ciphertext output by the nth encryption operation as a compressed random number sequence.
5. The apparatus of claim 4, wherein the first processing module is specifically configured to:
and respectively taking the input parameters and the input data block as a plaintext and a key of the nth encryption operation, and performing the nth encryption operation to obtain a ciphertext output by the nth encryption operation.
6. The apparatus of claim 4, wherein the second processing module is specifically configured to:
if the byte occupied by the data block is smaller than the set byte, supplementing byte bits in the data block so as to enable the data block to occupy the set byte.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1-3 when executing the program.
CN201910167666.9A 2019-03-05 2019-03-05 Random number sequence compression method and device and electronic equipment Active CN109981251B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910167666.9A CN109981251B (en) 2019-03-05 2019-03-05 Random number sequence compression method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910167666.9A CN109981251B (en) 2019-03-05 2019-03-05 Random number sequence compression method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN109981251A CN109981251A (en) 2019-07-05
CN109981251B true CN109981251B (en) 2022-06-07

Family

ID=67078037

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910167666.9A Active CN109981251B (en) 2019-03-05 2019-03-05 Random number sequence compression method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109981251B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159731B (en) * 2019-12-16 2023-08-08 合肥大唐存储科技有限公司 Password equipment and data processing method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104022872A (en) * 2014-04-09 2014-09-03 广州赛意信息科技有限公司 Data encryption method
CN107425962A (en) * 2017-04-21 2017-12-01 济南浪潮高新科技投资发展有限公司 A kind of high in the clouds data guard method of data staging encryption and segmentation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7599490B2 (en) * 2004-03-03 2009-10-06 Harris Corporation Method and apparatus for data encryption
GB0711711D0 (en) * 2007-06-15 2007-07-25 Ibm Method and system for encryption of blocks of data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104022872A (en) * 2014-04-09 2014-09-03 广州赛意信息科技有限公司 Data encryption method
CN107425962A (en) * 2017-04-21 2017-12-01 济南浪潮高新科技投资发展有限公司 A kind of high in the clouds data guard method of data staging encryption and segmentation

Also Published As

Publication number Publication date
CN109981251A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
US9875377B2 (en) Encryption device of a substitution-box type, and corresponding encryption method and computer program product
CN110569227B (en) Model parameter determination method and device and electronic equipment
CN108075882A (en) Cipher card and its encipher-decipher method
CN110266682B (en) Data encryption method and device, mobile terminal and decryption method
CN105095097B (en) The memory access of randomization
CN112394974A (en) Code change comment generation method and device, electronic equipment and storage medium
CN110391895B (en) Data preprocessing method, ciphertext data acquisition method, device and electronic equipment
CN110909356A (en) Secure multiparty computing method, apparatus, device and computer readable medium
CN107438832B (en) Data refreshing method and device and computer readable storage medium
CN107480554A (en) A kind of right management method, rights management device and intelligent terminal
CN110611568A (en) Dynamic encryption and decryption method, device and equipment based on multiple encryption and decryption algorithms
CN109981251B (en) Random number sequence compression method and device and electronic equipment
CN105022716A (en) Multi-data link GPU server
CN113810169A (en) Homomorphic encryption device and ciphertext arithmetic method thereof
CN110569038B (en) Random verification parameter design method, device, computer equipment and storage medium
US8719588B2 (en) Memory address obfuscation
CN107977581A (en) Data processing method, device and computer-readable recording medium
CN109598105A (en) A kind of microcontroller is safely loaded with the method, apparatus, computer equipment and storage medium of firmware
CN113938270A (en) Data encryption method and device capable of flexibly reducing complexity
CN110880965A (en) Outgoing electronic document encryption method, system, terminal and storage medium
CN104899502B (en) Apparatus and method for software enabled access to protected hardware resources
Brennsteiner et al. A real-time deep learning OFDM receiver
CN105721139B (en) A kind of the AES encipher-decipher method and circuit of the FPGA suitable for limited I/O resource
CN111767552A (en) Plug-in flash memory management method, MCU, electronic equipment and readable storage medium
CN114826560B (en) Lightweight block cipher CREF implementation method and 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
GR01 Patent grant
GR01 Patent grant