CN112765615A - Data storage method and device and electronic equipment - Google Patents

Data storage method and device and electronic equipment Download PDF

Info

Publication number
CN112765615A
CN112765615A CN202011429801.1A CN202011429801A CN112765615A CN 112765615 A CN112765615 A CN 112765615A CN 202011429801 A CN202011429801 A CN 202011429801A CN 112765615 A CN112765615 A CN 112765615A
Authority
CN
China
Prior art keywords
value
variable
stored
target variable
memory
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
CN202011429801.1A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011429801.1A priority Critical patent/CN112765615A/en
Publication of CN112765615A publication Critical patent/CN112765615A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data

Abstract

The disclosure discloses a data storage method and device and electronic equipment, relates to the technical field of data storage, and can be used in the fields of cloud computing and cloud. The specific implementation scheme is as follows: acquiring a storage value of a target variable in a memory; decrypting the stored value to obtain a first variable value of the target variable; operating the first variable value to obtain a second variable value; encrypting the second variable value to obtain a new stored value; updating the stored value stored in the memory to the new stored value. Because the new storage value stored in the memory is encrypted, the storage value can be prevented from being tampered, and meanwhile, the new storage value obtained after encryption does not show regular change along with the change of a real value, the scanning of memory scanning software can be effectively avoided, the memory address of a target variable cannot be found, and the risk that the new storage value is modified is further reduced.

Description

Data storage method and device and electronic equipment
Technical Field
The present disclosure relates to the field of data storage in computer technology. Specifically, a data storage method and device and electronic equipment are provided.
Background
A variable is typically used in existing electronic devices to count for marking membership rights, e.g., recording membership usage time. The electronic equipment uses a variable to store the residual using time, the variable is subjected to decrement operation along with the time to record the residual using time, and the residual using time is stored in a memory of the electronic equipment.
Disclosure of Invention
The disclosure provides a data storage method and device and electronic equipment.
According to a first aspect of the present disclosure, there is provided a data storage method, including:
acquiring a storage value of a target variable in a memory;
decrypting the stored value to obtain a first variable value of the target variable;
operating the first variable value to obtain a second variable value;
encrypting the second variable value to obtain a new stored value;
updating the stored value stored in the memory to the new stored value.
According to a second aspect of the present disclosure, there is provided a data storage device comprising:
the first acquisition module is used for acquiring the stored value of the target variable in the memory;
the second acquisition module is used for decrypting the stored value to obtain a first variable value of the target variable;
the third acquisition module is used for calculating the first variable value to obtain a second variable value;
the fourth acquisition module is used for encrypting the second variable value to obtain a new stored value;
and the updating module is used for updating the storage value stored in the memory into the new storage value.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the first aspects.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of the first aspects.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1a is a flow chart of a data storage method provided by an embodiment of the present disclosure;
FIG. 1b is a second flowchart of a data storage method provided by the embodiment of the present disclosure;
FIG. 1c is a third flowchart of a data storage method provided by an embodiment of the present disclosure;
FIG. 1d is a fourth flowchart of a data storage method provided by an embodiment of the present disclosure;
FIG. 2 is a fifth flowchart of a data storage method provided by an embodiment of the present disclosure;
FIG. 3 is a block diagram of a data storage device provided by an embodiment of the present disclosure;
FIG. 4 is a block diagram of an electronic device for implementing a data storage method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1a, fig. 1a is a flowchart of a data storage method provided in an embodiment of the present disclosure, and as shown in fig. 1a, the embodiment provides a data storage method, including the following steps:
step 101, obtaining a storage value of a target variable in a memory.
The value of the target variable may be understood as a value that requires a regular change, such as an increment or decrement, etc. The stored value of the target variable in the memory is not the true value of the target variable, but the value obtained after encryption processing, so that tampering can be avoided.
And 102, decrypting the stored value to obtain a first variable value of the target variable.
The stored value is obtained by encrypting the actual value of the target variable, and after the stored value is obtained, the stored value is decrypted to obtain the first variable value of the target variable, wherein the first variable value can be understood as the actual value of the target variable. The encryption process and the decryption process are inverse processes to each other.
And 103, operating the first variable value to obtain a second variable value.
The operation may be understood as an increment operation or a decrement operation, e.g. an operation of adding 1 to the first variable value or an operation of subtracting 1 from the variable value to obtain the second variable value.
And 104, encrypting the second variable value to obtain a new stored value.
Before the second variable value is stored in the memory, the second variable value also needs to be encrypted to obtain a new stored value so as to prevent the second variable value from being tampered.
Step 105, updating the stored value stored in the memory to the new stored value, that is, updating the stored value stored at the storage address of the target variable to the new stored value.
The data storage method in this embodiment may be applied to an electronic device, and the electronic device may be: a cell phone, a tablet, a laptop, a personal digital assistant, a mobile web appliance, or a wearable device, etc.
In the embodiment, a storage value of a target variable in a memory is obtained; decrypting the stored value to obtain a first variable value of the target variable; operating the first variable value to obtain a second variable value; encrypting the second variable value to obtain a new stored value; updating the stored value stored in the memory to the new stored value. Because the new storage value stored in the memory is encrypted, the storage value can be prevented from being tampered, and meanwhile, the new storage value obtained after encryption does not show regular change along with the change of a real value, the scanning of memory scanning software can be effectively avoided, the memory address of a target variable cannot be found, and the risk that the new storage value is modified is further reduced.
Referring to fig. 1b, fig. 1b is a flowchart of a data storage method provided in an embodiment of the present disclosure, and as shown in fig. 1b, the embodiment provides a data storage method, including the following steps:
step 106, acquiring a first variable value of the target variable;
step 107, encrypting the first variable value of the target variable to obtain a stored value of the target variable;
and step 108, storing the storage value into the memory.
Step 101, obtaining a storage value of a target variable in a memory.
And 102, decrypting the stored value to obtain a first variable value of the target variable.
And 103, operating the first variable value to obtain a second variable value.
And 104, encrypting the second variable value to obtain a new stored value.
Step 105, updating the stored value stored in the memory to the new stored value, that is, updating the stored value stored at the storage address of the target variable to the new stored value.
Before step 101, step 106 and step 107 are also included, that is, before the first variable value of the target variable is stored in the memory, the encryption processing is also required, that is, the first variable value of the target variable is encrypted, for example, by using Base64 to obtain the stored value of the target variable, Base64 is a method for representing binary data based on 64 printable characters, and the first variable value can be converted into a character string, so as to implement the encryption processing of the first variable value. The first variable value of the target variable may be obtained from a memory, or from a stack of the electronic device, or may be a default initial value. After the stored value is obtained, the stored value is stored in the memory, so that the stored value can be prevented from being tampered.
Furthermore, before encryption, the first variable value can be converted into a character string, and then the character string is encrypted, so that the security of the first variable value can be further improved.
In an embodiment of the application, the step 106 of obtaining a first variable value of the target variable includes: determining a first variable value of the target variable, wherein the target variable is used for counting, and the first variable value is an initial value of the target variable;
allocating a storage address for the target variable in the memory, wherein the storage address is used for storing the first variable value;
correspondingly, step 108, storing the stored value in the memory, includes: storing the stored value to the storage address.
In this embodiment, the target variable is a variable for counting, for example, a variable for marking the rights and interests of the member, and the initial value may be the remaining usage time of the member. And allocating a storage address for the target variable in the memory, wherein the storage address is used for storing a first variable value of the target variable, and a second variable value obtained after subsequent updating is also stored in the storage address.
And encrypting the initial value of the target variable to obtain a stored value, and then storing the stored value to a storage address. During counting, the stored value is retrieved from the storage address, decrypted to obtain the real value (i.e., the first variable value), added or subtracted to the first variable value, for example, added by 1 or subtracted by 1 to obtain the second variable value, encrypted to obtain the new stored value, and then stored in the storage address. Because the encrypted value is stored until the value does not change regularly with the regular change of the real value, the scanning of the memory scanning software can be effectively avoided, the storage address of the target variable cannot be found, and even if the scanning software can find the storage address of the target variable, the first variable value stored in the storage address cannot be tampered, and the storage safety of the target variable is improved.
Referring to fig. 1c, fig. 1c is a flowchart of a data storage method provided in an embodiment of the present disclosure, and as shown in fig. 1c, the embodiment provides a data storage method, including the following steps:
step 101, obtaining a storage value of a target variable in a memory.
And 102, decrypting the stored value to obtain a first variable value of the target variable.
Step 1023, store the first variable value of the target variable on a stack.
And 103, operating the first variable value to obtain a second variable value.
Step 1034, release the first variable value stored on the stack. This step may also be performed after step 104, or after step 105, and is not limited herein, and only needs to be performed after step 103.
And 104, encrypting the second variable value to obtain a new stored value.
Step 105, updating the stored value stored in the memory to the new stored value, that is, updating the stored value stored at the storage address of the target variable to the new stored value.
In the above, between step 102 and step 103, the method further includes a step of storing the first variable value of the target variable on the stack, and accordingly, after step 103, the method further includes: releasing the first variable value stored on the stack.
In the above, after the stored value is decrypted to obtain the first variable value of the target variable, the first variable value is temporarily stored on the stack of the electronic device, that is, the first variable value is stored on the stack as the value of the temporary variable, and then the first variable value is subjected to addition operation or subtraction operation to obtain the second variable value, which may also be temporarily stored on the stack. Furthermore, after the second variable value is obtained, the first variable value stored on the stack can be released immediately, and the safety is improved.
Referring to fig. 1d, fig. 1d is a flowchart of a data storage method provided in the embodiment of the present disclosure, and as shown in fig. 1d, the embodiment provides a data storage method, including the following steps:
step 106, acquiring a first variable value of the target variable;
step 1067, obtaining encryption protection parameters, where the encryption protection parameters include an encryption key and a decryption key.
Step 107', encrypting the first variable value of the target variable by using the encryption key to obtain the stored value of the target variable, which is a specific implementation manner of step 107.
And step 108, storing the storage value into the memory.
Step 101, obtaining a storage value of a target variable in a memory.
And 102', decrypting the stored value by adopting the decryption key to obtain the first variable value of the target variable. This step is a specific implementation of step 102.
And 103, operating the first variable value to obtain a second variable value.
And step 104', encrypting the second variable value by using the encryption key to obtain the new stored value, which is a specific implementation manner of the step 104.
Step 105, updating the stored value stored in the memory to the new stored value, that is, updating the stored value stored at the storage address of the target variable to the new stored value.
In this embodiment, the encryption protection parameter may be obtained from a server, where the server may be a server that provides services for software to which the target variable belongs, for example, if the target variable is a parameter of remaining use time of a certain video software member, the server may be a server that provides services for the video software member, and the encryption key and the decryption key are both provided by the server.
The encryption key and the decryption key may be automatically generated by the electronic device according to an encryption algorithm, for example, if the target variable is a parameter of remaining use time of a certain video software member, at the moment when the user activates the member, the electronic device automatically generates the encryption key and the decryption key according to the encryption algorithm provided by the video software.
Further, the encryption key and the decryption key may be dynamically changed. The encryption key and the decryption key may be updated once every preset time, and it should be noted that when the encryption key and the decryption key are updated, it is required to ensure that the first variable value in the storage address is taken out and decryption is completed, so as to avoid a problem that the first variable value in the storage address cannot be decrypted when the encryption key and the decryption key are updated. If the first variable value in the memory address is retrieved and decryption has been completed, the second variable value may be encrypted using the updated encryption key after the second variable value is obtained after the first variable value is operated, e.g., added or subtracted. The encryption key and the decryption key are dynamically changed, so that the safety of the target variable can be further improved, and the stored value in the memory is prevented from being tampered.
Further, the first variable value may be displayed on a display interface of the electronic device. As shown in fig. 2, the electronic device reads the ciphertext (i.e., the stored value) from the memory, decrypts the ciphertext to obtain the first variable value, adds or subtracts the first variable value to obtain the second variable value, updates the first variable value on the display interface with the second variable value, i.e., displays the second variable value on the display interface, encrypts the second variable value to obtain a new ciphertext (i.e., a new stored value), and updates the ciphertext stored in the storage address with the new ciphertext.
In the above, when the encrypted value is extracted from the storage address and an operation is required (for example, addition and subtraction), the extracted value is decrypted first, then the operation is performed to obtain the second variable value, and the second variable value is encrypted to obtain a new ciphertext, and the new ciphertext is stored in the storage address. Because the encrypted ciphertext does not show regular change along with the regular change of the real value, namely, the encrypted ciphertext does not show regular change of the real value, the scanning of the memory scanning software can be effectively avoided, the storage address of the target variable can not be found, further, because the second variable value stored in the storage address is the stored value after the encryption processing, even if the scanning software finds the storage address of the target variable, the ciphertext cannot be modified, in addition, the decrypted real value is stored on the stack, and is released immediately after being used, so that the safety can be improved.
Referring to fig. 3, fig. 3 is a structural diagram of a data storage device according to an embodiment of the present disclosure, and as shown in fig. 3, the embodiment provides a data storage device 300, including:
a first obtaining module 301, configured to obtain a stored value of a target variable in an internal memory;
a second obtaining module 302, configured to decrypt the stored value, and obtain a first variable value of the target variable;
a third obtaining module 303, configured to perform an operation on the first variable value to obtain a second variable value;
a fourth obtaining module 304, configured to encrypt the second variable value to obtain a new stored value;
an updating module 305, configured to update the stored value stored in the memory to the new stored value.
Further, the data storage device 300 further includes:
the fifth acquisition module is used for acquiring a first variable value of the target variable;
a sixth obtaining module, configured to encrypt the first variable value of the target variable to obtain a stored value of the target variable;
a first storage module, configured to store the stored value in the memory.
Further, the fifth obtaining module includes:
the determining submodule is used for determining a first variable value of the target variable, the target variable is used for counting, and the first variable value is an initial value of the target variable;
the distribution submodule is used for distributing a storage address for the target variable in the memory, and the storage address is used for storing the first variable value;
the first storage module is configured to store the storage value to the storage address.
Further, the data storage device 300 further includes:
a second storage module for storing a first variable value of the target variable on a stack;
a release module to release the first variable value stored on the stack.
Further, the data storage device 300 further includes:
a seventh obtaining module, configured to obtain an encryption protection parameter, where the encryption protection parameter includes an encryption key and a decryption key;
a sixth obtaining module, configured to encrypt the first variable value of the target variable with the encryption key to obtain a stored value of the target variable;
the second obtaining module is configured to decrypt the stored value with the decryption key to obtain a first variable value of the target variable;
the fourth obtaining module 304 is configured to encrypt the second variable value with the encryption key to obtain the new stored value.
The data storage device 300 of the embodiment of the present disclosure obtains a storage value of a target variable in a memory; decrypting the stored value to obtain a first variable value of the target variable; operating the first variable value to obtain a second variable value; encrypting the second variable value to obtain a new stored value; updating the stored value stored in the memory to the new stored value. Because the new storage value stored in the memory is encrypted, the storage value can be prevented from being tampered, and meanwhile, the new storage value obtained after encryption does not show regular change along with the change of a real value, the scanning of memory scanning software can be effectively avoided, the memory address of a target variable cannot be found, and the risk that the new storage value is modified is further reduced.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
As shown in fig. 4, is a block diagram of an electronic device of a method of data storage according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 4, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium provided by the present disclosure. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the method of data storage provided by the present disclosure. The non-transitory computer readable storage medium of the present disclosure stores computer instructions for causing a computer to perform the method of data storage provided by the present disclosure.
The memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method of data storage in the embodiments of the present disclosure (e.g., the first obtaining module 301, the second obtaining module 302, the third obtaining module 303, the fourth obtaining module 304, and the updating module 305 shown in fig. 3). The processor 501 executes various functional applications of the server and data processing, i.e., a method of implementing data storage in the above-described method embodiments, by executing non-transitory software programs, instructions, and modules stored in the memory 502.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device for data storage, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 optionally includes memory located remotely from processor 501, which may be connected to a data-storing electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the method of data storage may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 4 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the data-storing electronic apparatus, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), blockchain networks, and the internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network, and a server may be a server in a distributed system or a server that incorporates a blockchain. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
In the disclosure, a storage value of a target variable in a memory is obtained; decrypting the stored value to obtain a first variable value of the target variable; operating the first variable value to obtain a second variable value; encrypting the second variable value to obtain a new stored value; updating the stored value stored in the memory to the new stored value. Because the new storage value stored in the memory is encrypted, the storage value can be prevented from being tampered, and meanwhile, the new storage value obtained after encryption does not show regular change along with the change of a real value, the scanning of memory scanning software can be effectively avoided, the memory address of a target variable cannot be found, and the risk that the new storage value is modified is further reduced.
After the stored value is obtained, the stored value is stored in the memory, so that the stored value can be prevented from being tampered.
Because the encrypted value is stored until the value does not change regularly with the regular change of the real value, the scanning of the memory scanning software can be effectively avoided, the storage address of the target variable cannot be found, and even if the scanning software can find the storage address of the target variable, the first variable value stored in the storage address cannot be tampered, and the storage safety of the target variable is improved.
And decrypting the stored value to obtain a first variable value of the target variable, then temporarily storing the first variable value on a stack of the electronic equipment, namely, storing the variable value as a value of a temporary variable on the stack, and then performing addition operation or subtraction operation on the first variable value to obtain a second variable value, wherein the second variable value can also be temporarily stored on the stack. Furthermore, after the second variable value is obtained, the first variable value stored on the stack can be released immediately, and the safety is improved.
Because the stored value after encryption processing does not show regular change along with the regular change of the real value, namely, the stored value after encryption processing does not show regular change of the real value, scanning of memory scanning software can be effectively avoided, and the storage address of the target variable can not be found.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (12)

1. A method of data storage, comprising:
acquiring a storage value of a target variable in a memory;
decrypting the stored value to obtain a first variable value of the target variable;
operating the first variable value to obtain a second variable value;
encrypting the second variable value to obtain a new stored value;
updating the stored value stored in the memory to the new stored value.
2. The method of claim 1, wherein prior to said obtaining a stored value of a target variable in memory, further comprising:
acquiring a first variable value of the target variable;
encrypting a first variable value of the target variable to obtain a stored value of the target variable;
storing the stored value to the memory.
3. The method of claim 2, wherein said obtaining a first variable value of the target variable comprises:
determining a first variable value of the target variable, wherein the target variable is used for counting, and the first variable value is an initial value of the target variable;
allocating a storage address in the memory for the target variable;
the storing the stored value to the memory includes:
storing the stored value to the storage address.
4. The method according to claim 1, wherein after said decrypting the stored value to obtain a first variable value of the target variable, before said operating the first variable value to obtain a second variable value, further comprises:
storing a first variable value of the target variable on a stack;
after the operating the first variable value to obtain a second variable value, the method further includes:
releasing the first variable value stored on the stack.
5. The method of claim 2, wherein prior to said encrypting the first variable value of the target variable to obtain the stored value of the target variable, further comprising:
acquiring encryption protection parameters, wherein the encryption protection parameters comprise an encryption key and a decryption key;
the encrypting the first variable value of the target variable to obtain the stored value of the target variable includes:
encrypting a first variable value of the target variable by adopting the encryption key to obtain a stored value of the target variable;
the decrypting the stored value to obtain a first variable value of the target variable includes:
decrypting the stored value by adopting the decryption key to obtain a first variable value of the target variable;
the encrypting the second variable value to obtain a new stored value comprises:
and encrypting the second variable value by adopting the encryption key to obtain the new stored value.
6. A data storage device comprising:
the first acquisition module is used for acquiring the stored value of the target variable in the memory;
the second acquisition module is used for decrypting the stored value to obtain a first variable value of the target variable;
the third acquisition module is used for calculating the first variable value to obtain a second variable value;
the fourth acquisition module is used for encrypting the second variable value to obtain a new stored value;
and the updating module is used for updating the storage value stored in the memory into the new storage value.
7. The apparatus of claim 6, further comprising:
the fifth acquisition module is used for acquiring a first variable value of the target variable;
a sixth obtaining module, configured to encrypt the first variable value of the target variable to obtain a stored value of the target variable;
a first storage module, configured to store the stored value in the memory.
8. The apparatus of claim 7, wherein the fifth obtaining means comprises:
the determining submodule is used for determining a first variable value of the target variable, the target variable is used for counting, and the first variable value is an initial value of the target variable;
the distribution submodule is used for distributing a storage address for the target variable in the memory, and the storage address is used for storing the first variable value;
the first storage module is configured to store the storage value to the storage address.
9. The apparatus of claim 6, further comprising:
a second storage module for storing a first variable value of the target variable on a stack;
a release module to release the first variable value stored on the stack.
10. The apparatus of claim 7, further comprising:
a seventh obtaining module, configured to obtain an encryption protection parameter, where the encryption protection parameter includes an encryption key and a decryption key;
a sixth obtaining module, configured to encrypt the first variable value of the target variable with the encryption key to obtain a stored value of the target variable;
the second obtaining module is configured to decrypt the stored value with the decryption key to obtain a first variable value of the target variable;
and the fourth obtaining module is configured to encrypt the second variable value by using the encryption key to obtain the new stored value.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202011429801.1A 2020-12-07 2020-12-07 Data storage method and device and electronic equipment Pending CN112765615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011429801.1A CN112765615A (en) 2020-12-07 2020-12-07 Data storage method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011429801.1A CN112765615A (en) 2020-12-07 2020-12-07 Data storage method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112765615A true CN112765615A (en) 2021-05-07

Family

ID=75693513

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011429801.1A Pending CN112765615A (en) 2020-12-07 2020-12-07 Data storage method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112765615A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170085926A (en) * 2016-01-15 2017-07-25 단국대학교 산학협력단 Electronic money terminal and method for providing elecronic money using the same
CN110008662A (en) * 2019-04-11 2019-07-12 北京字节跳动网络技术有限公司 Operation method, device, electronic equipment and the readable storage medium storing program for executing of application program
US20190394171A1 (en) * 2018-06-25 2019-12-26 Virtual Software Systems, Inc. Systems and methods for securing communications
CN111291273A (en) * 2020-02-20 2020-06-16 深圳前海微众银行股份有限公司 Recommendation system optimization method, device, equipment and readable storage medium
US20200210626A1 (en) * 2018-12-28 2020-07-02 Samsung Electronics Co., Ltd. Secure branch predictor with context-specific learned instruction target address encryption
CN111552591A (en) * 2020-03-25 2020-08-18 中国平安财产保险股份有限公司 Page abnormity recovery method, device, equipment and computer readable storage medium
WO2020237868A1 (en) * 2019-05-24 2020-12-03 平安科技(深圳)有限公司 Data transmission method, electronic device, server and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170085926A (en) * 2016-01-15 2017-07-25 단국대학교 산학협력단 Electronic money terminal and method for providing elecronic money using the same
US20190394171A1 (en) * 2018-06-25 2019-12-26 Virtual Software Systems, Inc. Systems and methods for securing communications
US20200210626A1 (en) * 2018-12-28 2020-07-02 Samsung Electronics Co., Ltd. Secure branch predictor with context-specific learned instruction target address encryption
CN110008662A (en) * 2019-04-11 2019-07-12 北京字节跳动网络技术有限公司 Operation method, device, electronic equipment and the readable storage medium storing program for executing of application program
WO2020237868A1 (en) * 2019-05-24 2020-12-03 平安科技(深圳)有限公司 Data transmission method, electronic device, server and storage medium
CN111291273A (en) * 2020-02-20 2020-06-16 深圳前海微众银行股份有限公司 Recommendation system optimization method, device, equipment and readable storage medium
CN111552591A (en) * 2020-03-25 2020-08-18 中国平安财产保险股份有限公司 Page abnormity recovery method, device, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
郭伟博;王力;: "具有密钥自动分配功能的网络化口令认证系统", 微电子学与计算机, no. 10 *

Similar Documents

Publication Publication Date Title
US9344410B1 (en) Telecommunication method for securely exchanging data
CN111310221B (en) Encryption and decryption method, device, equipment and storage medium for persistent layer data
CN111934872B (en) Key processing method, device, electronic equipment and storage medium
CN111565109A (en) Key processing method, device, equipment and medium for block chain
US9767295B2 (en) Content based hardware security module assignment to virtual machines
CN111400735B (en) Data transmission method, device, electronic equipment and computer readable storage medium
JP2022054386A (en) Model joint training method, apparatus, electronic device, storage medium, and computer program
CN111310204B (en) Data processing method and device
CN111464297B (en) Transaction processing method, device, electronic equipment and medium based on block chain
US10148430B1 (en) Revocable stream ciphers for upgrading encryption in a shared resource environment
CN111695166A (en) Disk encryption protection method and device
CN110909372A (en) Data processing method, device, equipment and medium
CN112016068A (en) Account control method, device, equipment and computer readable storage medium
CN111611606B (en) File encryption and decryption method and device
CN112016104A (en) Encryption method, device and system for financial sensitive data
CN109711178B (en) Key value pair storage method, device, equipment and storage medium
CN112989400A (en) Privacy transaction processing method and device, electronic equipment and medium
CN114363088A (en) Method and device for requesting data
CN113132304B (en) Rights and interests service processing method and device, electronic equipment and storage medium
CN111371773A (en) Information sending and displaying method, device, equipment and storage medium
CN108595973B (en) Instruction determination method, equipment control method, device and system
CN112765615A (en) Data storage method and device and electronic equipment
US20170279658A1 (en) Communicating between components in business process management systems
CN115333851A (en) Automatic driving data transmission method and device and electronic equipment
CN113992345A (en) Method and device for encrypting and decrypting webpage sensitive data, electronic equipment and storage medium

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