CN112069519A - Method and equipment for outputting encrypted record of information file - Google Patents

Method and equipment for outputting encrypted record of information file Download PDF

Info

Publication number
CN112069519A
CN112069519A CN202010937260.7A CN202010937260A CN112069519A CN 112069519 A CN112069519 A CN 112069519A CN 202010937260 A CN202010937260 A CN 202010937260A CN 112069519 A CN112069519 A CN 112069519A
Authority
CN
China
Prior art keywords
information
program
log record
record file
output information
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
CN202010937260.7A
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.)
Shaanxi Suninfo Technology Co ltd
Original Assignee
Shaanxi Suninfo 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 Shaanxi Suninfo Technology Co ltd filed Critical Shaanxi Suninfo Technology Co ltd
Priority to CN202010937260.7A priority Critical patent/CN112069519A/en
Publication of CN112069519A publication Critical patent/CN112069519A/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/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The application aims at providing a method and equipment for outputting an information file encryption record, and the method and equipment determine a log record file of a program, wherein the log record file has a write attribute; recording information at each node in the process of running the program in an output format to obtain output information; and encrypting the output information, and writing the encrypted output information into the log record file. Therefore, the recording, encryption and storage work of the operation process is conveniently realized, and the practicability, safety and flexibility of the program are improved; the running track of the program is recorded and managed as the operation and maintenance information, and the later examination work is facilitated.

Description

Method and equipment for outputting encrypted record of information file
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for outputting an encrypted record of an information file.
Background
With the advancement of the national information industry, information security is increasingly receiving attention from governments and enterprises. After the construction of various IT infrastructures is completed, the encryption and storage of information under different scenes become more important. The indispensable function is to save the log of the operation of the recording device, encrypt and save the log. It becomes particularly important to explore the implementation of such functions.
Disclosure of Invention
An object of the present application is to provide a method and device for outputting an encrypted record of an information file, which solve the problems in the prior art that the running information of the device in the process of running is required to be recorded and stored, and that important and sensitive information is easily leaked.
According to one aspect of the present application, there is provided a method of outputting an encrypted record of an information file, the method comprising:
determining a log record file of a program, wherein the log record file has a write attribute;
recording information at each node in the process of running the program in an output format to obtain output information;
and encrypting the output information, and writing the encrypted output information into the log record file.
Further, after writing the encrypted output information into the log record file, the method includes:
and arranging the log record file containing the encrypted output information.
Further, determining a log record file of the program includes:
and running a program, detecting whether the log record file of the program exists or not, if not, newly building the log record file, and if so, adding a time suffix to rename the original log record file.
Further, recording information at each node in the process of running the program in an output format to obtain output information, including:
and performing output information screen printing on the information at each node in the process of running the program through the combination of macro-type data and a vfprintf function, and recording the information of the screen printing in an output format to obtain output information.
Further, the information at each node includes interpretation information of the program and running data presentation information of the program.
Further, encrypting the output information includes:
and adding a time stamp to the output information, and encrypting the output information added with the time stamp character by character.
Further, arranging the log record file containing the encrypted output information includes:
before starting the program each time, checking whether a log record file containing the encrypted output information exists, if so, renaming the log record file by adding a time suffix, and arranging according to the renamed log record file.
According to yet another aspect of the present application, there is also provided an apparatus for outputting an encrypted record of an information file, the apparatus comprising:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
According to yet another aspect of the present application, there is also provided a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement the method as described above.
Compared with the prior art, the method and the device have the advantages that the log record file of the program is determined, wherein the log record file has the write attribute; recording information at each node in the process of running the program in an output format to obtain output information; and encrypting the output information, and writing the encrypted output information into the log record file. Therefore, the recording, encryption and storage work of the operation process is conveniently realized, and the practicability, safety and flexibility of the program are improved; the running track of the program is recorded and managed as the operation and maintenance information, and the later examination work is facilitated.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method for outputting encrypted records of an information file, provided in accordance with an aspect of the present application;
FIG. 2 is a flow chart illustrating recording of program running information according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an apparatus for outputting encrypted records of information files according to still another aspect of the present application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (e.g., Central Processing Units (CPUs)), input/output interfaces, network interfaces, and memory.
The Memory may include volatile Memory in a computer readable medium, Random Access Memory (RAM), and/or nonvolatile Memory such as Read Only Memory (ROM) or flash Memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, Phase-Change RAM (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other Memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, magnetic cassette tape, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
Fig. 1 is a schematic flow chart of a method for outputting an encrypted record of an information file according to an aspect of the present application, where the method includes: step S11 to step S13,
in step S11, determining a log record file of the program, wherein the log record file has a write attribute; here, each time a program runs, a log record file corresponding to the program needs to be determined, where the log record file is a file having a write attribute and can be used to record information of the program running and the like.
In step S12, recording information at each node in the process of running the program in an output format to obtain output information; and the program is run, the information at each node in the running process of the program is subjected to output information screen printing work, and the printing information formed by the information at each node is output according to an output format to obtain the output information.
In step S13, the output information is encrypted, and the encrypted output information is written in the log file. Here, the obtained output information is encrypted, so that an encryption algorithm can be customized, and the encrypted output information is written into the log record file. Therefore, the running information of the equipment in the process running process is recorded and stored, the stored information is encrypted in real time, and important and sensitive information is prevented from being leaked.
In an embodiment of the present application, after the encrypted output information is written into the log record file, the log record file containing the encrypted output information may be arranged. Here, because the file content is encrypted and risks exist during decryption to a certain extent, the log record files containing the encrypted output information are uniformly arranged, and later-stage query and positioning can be facilitated by arranging the log record files.
In an embodiment of the present application, in step S11, a program is executed to detect whether a log file of the program already exists, if not, a new log file is created, and if yes, a time suffix is added to rename an original log file. As shown in fig. 2, each time the program runs, the program is checked, and the program is run to detect whether the log record file exists, if so, a time suffix is added to rename the original file, and if not, the log file is newly created.
In an embodiment of the present application, in step S12, output information screen printing is performed on information at each node in the process of running the program through a combination of macro-type data and a vfprintf function, and information of the screen printing is recorded in an output format, so as to obtain output information. The information at each node comprises interpretation information of a program and running data display information of the program. Here, the screen printing work of the output information is performed at each node of the program, and the information at each node may be interpretation information of the program or operation data presentation information of the program. Outputting the printing information to a file or a screen in a mode simulating printf is realized by combined application of macro-type data (such as va _ list) and a vfprintf function according to a mode of an output (printf) program. It should be noted that the vfprintf function writes the formatted character string to a specified output stream, such as a file or a database.
In an embodiment of the present invention, in step S13, the output information is time-stamped, and the time-stamped output information is encrypted character by character. Here, as shown in fig. 2, after the information at the program node is recorded in the printf format, a time stamp is added to the print information (output information after output) to facilitate later positioning and tracking, the print information with the time stamp added is encrypted character by character, and the encrypted information is written in the log record file in vprintf.
In an embodiment of the present application, when arranging the log record files containing the encrypted output information, before starting the program each time, whether the log record files containing the encrypted output information exist may be checked, and if yes, the log record files are renamed by adding a time suffix, and are arranged according to the renamed log record files. Once the program starts, the running of the program is repeated, the information records are increased all the time, before each program is started, the early-stage file record checking work is carried out, whether a log record file containing encrypted output information exists is checked, if the log record file exists, the log record file is added with a time suffix for renaming, and the file is arranged according to the name after renaming, so that the correctness and the integrity of the record file are ensured.
The method can be arbitrarily cut into process-oriented or object-oriented code development of systems such as windows, linux, ARM and the like, can be applied to C language, Java or other programming languages, conveniently realizes the recording, encryption and storage work of the operation process, and improves the practicability, safety and flexibility of the program; the running track of the program is recorded and managed as the operation and maintenance information, and the later examination work is facilitated.
In addition, the embodiment of the present application also provides a computer readable medium, on which computer readable instructions are stored, the computer readable instructions being executable by a processor to implement the foregoing method for outputting encrypted records of information files.
In correspondence with the method described above, the present application also provides a terminal, which includes modules or units capable of executing the method steps described in fig. 1 or fig. 2 or various embodiments, and these modules or units can be implemented by hardware, software or a combination of hardware and software, and the present application is not limited thereto. For example, in an embodiment of the present application, there is also provided an apparatus for outputting an encrypted record of an information file, the apparatus including:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method as previously described.
For example, the computer readable instructions, when executed, cause the one or more processors to:
determining a log record file of a program, wherein the log record file has a write attribute;
recording information at each node in the process of running the program in an output format to obtain output information;
and encrypting the output information, and writing the encrypted output information into the log record file.
Fig. 3 is a schematic structural diagram of an apparatus for outputting encrypted records of an information file according to another aspect of the present application, where the apparatus includes: the device comprises a determining device 11, a recording device 12 and an encrypting device 13, wherein the determining device 11 is used for determining a log record file of a program, and the log record file has a writing attribute; the recording device 12 is configured to record information at each node in the process of running the program in an output format to obtain output information; the encryption device 13 is configured to encrypt the output information, and write the encrypted output information into the log record file.
It should be noted that the content executed by the determining device 11, the recording device 12 and the encrypting device 13 is the same as or corresponding to the content in the above steps S11, S12 and S13, respectively, and for brevity, the description thereof is omitted.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (9)

1. A method of outputting an encrypted record of an information file, wherein the method comprises:
determining a log record file of a program, wherein the log record file has a write attribute;
recording information at each node in the process of running the program in an output format to obtain output information;
and encrypting the output information, and writing the encrypted output information into the log record file.
2. The method of claim 1, wherein writing the encrypted output information into the log record file comprises:
and arranging the log record file containing the encrypted output information.
3. The method of claim 1, wherein determining a log record file for a program comprises:
and running a program, detecting whether the log record file of the program exists or not, if not, newly building the log record file, and if so, adding a time suffix to rename the original log record file.
4. The method of claim 1, wherein recording information at each node in the process of running the program in an output format to obtain output information comprises:
and performing output information screen printing on the information at each node in the process of running the program through the combination of macro-type data and a vfprintf function, and recording the information of the screen printing in an output format to obtain output information.
5. The method according to claim 1 or 4, wherein the information at each node comprises interpretation information of the program, and running data presentation information of the program.
6. The method of claim 1, wherein encrypting the output information comprises:
and adding a time stamp to the output information, and encrypting the output information added with the time stamp character by character.
7. The method of claim 2, wherein arranging the log record file containing the encrypted output information comprises:
before starting the program each time, checking whether a log record file containing the encrypted output information exists, if so, renaming the log record file by adding a time suffix, and arranging according to the renamed log record file.
8. An apparatus for outputting an encrypted record of an information file, wherein the apparatus comprises:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method of any of claims 1 to 7.
9. A computer readable medium having computer readable instructions stored thereon which are executable by a processor to implement the method of any one of claims 1 to 7.
CN202010937260.7A 2020-09-08 2020-09-08 Method and equipment for outputting encrypted record of information file Pending CN112069519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010937260.7A CN112069519A (en) 2020-09-08 2020-09-08 Method and equipment for outputting encrypted record of information file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010937260.7A CN112069519A (en) 2020-09-08 2020-09-08 Method and equipment for outputting encrypted record of information file

Publications (1)

Publication Number Publication Date
CN112069519A true CN112069519A (en) 2020-12-11

Family

ID=73664503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010937260.7A Pending CN112069519A (en) 2020-09-08 2020-09-08 Method and equipment for outputting encrypted record of information file

Country Status (1)

Country Link
CN (1) CN112069519A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986855A (en) * 2021-09-17 2022-01-28 苏州浪潮智能科技有限公司 Method, system, equipment and medium for locking file by network file system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2519964Y (en) * 2001-09-03 2002-11-06 广州广电运通金融电子有限公司 Electronic daily record equipment
CN106649735A (en) * 2016-12-23 2017-05-10 腾讯科技(深圳)有限公司 Log data recording method and apparatus
CN109739728A (en) * 2019-01-08 2019-05-10 益模(东莞)智能科技有限公司 A kind of MES system performance and daily record data monitoring method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2519964Y (en) * 2001-09-03 2002-11-06 广州广电运通金融电子有限公司 Electronic daily record equipment
CN106649735A (en) * 2016-12-23 2017-05-10 腾讯科技(深圳)有限公司 Log data recording method and apparatus
CN109739728A (en) * 2019-01-08 2019-05-10 益模(东莞)智能科技有限公司 A kind of MES system performance and daily record data monitoring method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986855A (en) * 2021-09-17 2022-01-28 苏州浪潮智能科技有限公司 Method, system, equipment and medium for locking file by network file system
CN113986855B (en) * 2021-09-17 2023-11-14 苏州浪潮智能科技有限公司 Method, system, equipment and medium for locking files by network file system

Similar Documents

Publication Publication Date Title
Stamatogiannakis et al. Looking inside the black-box: capturing data provenance using dynamic instrumentation
WO2017107808A1 (en) Method and system for locating obfuscated scripting language
CN114329366B (en) Network disk file control method and device, network disk and storage medium
CN114329367B (en) Network disk file tracing method and device, network disk and storage medium
CN110765152B (en) SQL extraction method, SQL extraction device, computer equipment and storage medium
CN112069519A (en) Method and equipment for outputting encrypted record of information file
CN111552618B (en) Method and equipment for collecting logs
CN114493551B (en) Contract generation method and device, electronic equipment and storage medium
Stamatogiannakis et al. Prov 2r: practical provenance analysis of unstructured processes
CN116028469A (en) Data security link tracking method and device
Didriksen Forensic analysis of OOXML documents
CN112732489B (en) Data desensitization method and device based on database virtualization
US20210182453A1 (en) Application behavior identification
US9412412B2 (en) Logical block protection for tape interchange
CN114510300A (en) Method and equipment for embedding target object in derived class
CN115374074A (en) Log processing method and device, storage medium and electronic equipment
CN112632211A (en) Semantic information processing method and equipment for mobile robot
CN113760696A (en) Program problem positioning method and device, electronic equipment and storage medium
US10649851B2 (en) Extraction of audit trails
CN113986517B (en) API call log acquisition method and device, electronic equipment and storage medium
CN112131193B (en) Application program compression method and device
CN113971252A (en) Log recording method and device
CN112380058A (en) File recovery method and equipment
CN113971184A (en) Method and equipment for managing operation and maintenance operation based on database proxy server
CN116578951A (en) Interface access method, computing device 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