Log management method, device, electronic device and storage medium

By obtaining the public key information generated by the encryption server for the encrypted log, calculating the first stem and branch day corresponding to the year date, generating private key information based on this stem and branch day, and then decrypting the encrypted log, solving the problems of low log security and high key exposure risk in the prior art, and achieving high security log management.

CN115225265BActive Publication Date: 2025-03-11CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210699578.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-03-11
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

In the prior art, server-managed logs are usually not encrypted, resulting in low log security; even if encrypted, the key generation method is single and long-term use increases the risk of key exposure.

Method used

By obtaining the public key information generated by the encryption server for the encrypted log, calculating the first stem and branch day corresponding to the year date, generating private key information based on this stem and branch day, and then decrypting the encrypted log. This method uses the Tiantan Stems and Earthly Branches algorithm to dynamically generate keys, improving the complexity of keys and reducing the risk of log exposure.

Benefits of technology

Improve the security of logs. By dynamically generating public and private keys, each log has a different key, which significantly reduces the risk of key exposure and ensures high security of keys.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115225265B_ABST
    Figure CN115225265B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a log management method, device, electronic device and storage medium, the method comprising: obtaining public key information generated by an encryption server for an encrypted log, the public key information including the year date, then calculating the first zodiac day corresponding to the year date, then generating private key information based on the first zodiac day, and finally using the private key information to decrypt the encrypted log. The embodiment of the present invention uses the Heavenly Stems and Earthly Branches algorithm to generate a key, and requires the user to correctly master the Heavenly Stems and Earthly Branches calculation formula agreed in advance to obtain the private key information, thereby greatly increasing the complexity of the key, and dynamically generating the public key and private key in real time each time, so that each log has a different public key and private key, thereby greatly reducing the risk of log exposure and greatly ensuring the security of the key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of network technology and security technology, and in particular to a log management method, a log management device, an electronic device and a computer-readable storage medium. Background Art

[0002] With the rapid development of technology, there are bound to be many potential security risks in enterprise information systems. The log data in the system involves a lot of sensitive information and is easily vulnerable to various human attacks, such as information leakage, information theft, data tampering, etc. Therefore, some important logs need to be encrypted and managed to improve security.

[0003] However, many companies or individuals do not encrypt the logs managed by the server. As long as they log in to the server, they can view the logs at will, resulting in low log security. Even if the logs are encrypted, the current method uses a fixed key, the key generation method is single, and it is often used for a long time. Generally, the key will not be changed, which greatly increases the risk of key exposure. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide a log management method that overcomes the above problems or at least partially solves the above problems.

[0005] The embodiment of the present invention also provides a log management device, an electronic device and a storage medium to ensure the implementation of the above method.

[0006] In order to solve the above problem, an embodiment of the present invention discloses a log management method, which is applied to a log management platform, wherein the log management platform communicates with an encryption server, and the method includes:

[0007] Obtaining public key information generated by the encryption server for the encrypted log; the public key information includes the year and date;

[0008] Calculate the first Chinese zodiac day corresponding to the year date;

[0009] Generate private key information according to the first Chinese zodiac day;

[0010] The encrypted log is decrypted using the private key information.

[0011] Optionally, before obtaining the public key information generated by the encryption server for the encrypted log, the method further includes:

[0012] Each ciphertext package generated by the encryption server for each log is stored; the ciphertext package includes the encrypted log and the corresponding public key information; the public key information is generated by the encryption server according to the randomly assigned year date.

[0013] Optionally, storing each ciphertext package generated by the encryption server for each log includes:

[0014] Sending an encryption request to the encryption server; the encryption request includes each log and a corresponding timestamp; the timestamp is used to identify the generation time of the log;

[0015] Receive each encrypted log and each public key information returned by the encryption server, and store each encrypted log and each public key information; the encrypted log is obtained by the encryption server encrypting the log; the public key information is obtained by the encryption server combining and reversing the randomly assigned year date and the generation time of the log.

[0016] Optionally, the calculating the first Chinese zodiac day corresponding to the year date includes:

[0017] Using a preset Heavenly Stems algorithm, calculate the number of digits corresponding to the Heavenly Stems of the year and date;

[0018] Using a preset earthly branch algorithm, calculate the number of digits corresponding to the earthly branch of the year and date;

[0019] The first heavenly stem and earthly branch day corresponding to the year date is determined according to the number of digits corresponding to the heavenly stems and the number of digits corresponding to the earthly branches.

[0020] Optionally, generating private key information according to the first Chinese zodiac day includes:

[0021] Obtaining a random number randomly assigned by the encryption server;

[0022] Generate private key information based on the first zodiac day and the random number.

[0023] Optionally, obtaining a random number randomly assigned by the encryption server includes:

[0024] Sending the first zodiac day to the encryption server, so that the encryption server determines whether the first zodiac day corresponding to the year date currently calculated by the log management platform is consistent with the second zodiac day corresponding to the year date pre-calculated by the encryption server;

[0025] Receive a random number returned by the encryption server when the first zodiac day is consistent with the second zodiac day.

[0026] Optionally, generating private key information according to the first zodiac day and the random number includes:

[0027] The first Chinese zodiac day and the random number are combined to obtain a private key combination; the private key combination includes text and numbers;

[0028] According to a preset reverse order rule, the order of letters and numbers in the private key combination is reversed to obtain private key information.

[0029] The embodiment of the present invention further discloses a log management device, which is applied to a log management platform. The log management platform communicates with an encryption server. The device includes:

[0030] A public key information acquisition module, used to acquire the public key information generated by the encryption server for the encrypted log; the public key information includes the year and date;

[0031] The first zodiac day calculation module is used to calculate the first zodiac day corresponding to the year date;

[0032] A private key information generation module, used to generate private key information according to the first zodiac day;

[0033] The decryption module is used to decrypt the encrypted log using the private key information.

[0034] Optionally, before obtaining the public key information generated by the encryption server for the encrypted log, the device further includes:

[0035] The storage module is used to store each ciphertext package generated by the encryption server for each log; the ciphertext package includes the encrypted log and the corresponding public key information; the public key information is generated by the encryption server according to the randomly assigned year date.

[0036] Optionally, the storage module includes:

[0037] An encryption request sending submodule, used to send an encryption request to the encryption server; the encryption request includes each log and a corresponding timestamp; the timestamp is used to identify the generation time of the log;

[0038] The storage submodule is used to receive each encrypted log and each public key information returned by the encryption server, and store the each encrypted log and each public key information; the encrypted log is obtained by the encryption server encrypting the log; the public key information is obtained by the encryption server combining and reversing the randomly assigned year date and the generation time of the log.

[0039] Optionally, the first Ganzhi day calculation module includes:

[0040] A Heavenly Stems calculation submodule, for calculating the number of digits corresponding to the Heavenly Stems of the year and date using a preset Heavenly Stems algorithm;

[0041] The earthly branch calculation submodule is used to calculate the number of digits corresponding to the earthly branch of the year date using a preset earthly branch algorithm;

[0042] The first celestial stem and earthly branch day calculation submodule is used to determine the first celestial stem and earthly branch day corresponding to the year date according to the number of digits corresponding to the celestial stem and the number of digits corresponding to the earthly branch.

[0043] Optionally, the private key information generation module includes:

[0044] A random number acquisition submodule, used to obtain a random number randomly assigned by the encryption server;

[0045] The private key information generation submodule is used to generate private key information according to the first zodiac day and the random number.

[0046] Optionally, the random number acquisition submodule includes:

[0047] A first zodiac day sending unit, used to send the first zodiac day to the encryption server, so that the encryption server determines whether the first zodiac day corresponding to the year date currently calculated by the log management platform is consistent with the second zodiac day corresponding to the year date pre-calculated by the encryption server;

[0048] A random number receiving unit is used to receive the random number returned by the encryption server when the first zodiac day is consistent with the second zodiac day.

[0049] Optionally, the private key information generation submodule includes:

[0050] A combining unit, used for combining the first Chinese zodiac day and the random number to obtain a private key combination; the private key combination includes text and numbers;

[0051] The reversal unit is used to reverse the order of the letters and numbers in the private key combination according to a preset reversal rule to obtain the private key information.

[0052] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0053] The memory is used to store computer programs;

[0054] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0055] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.

[0056] Compared with the prior art, the embodiments of the present invention have the following advantages:

[0057] In an embodiment of the present invention, the public key information generated by the encryption server for the encrypted log is obtained, the public key information includes the year date, and then the first zodiac day corresponding to the year date is calculated, and then the private key information is generated according to the first zodiac day, and finally the encrypted log is decrypted using the private key information. The embodiment of the present invention uses the Heavenly Stems and Earthly Branches algorithm to generate the key, and the user needs to correctly master the Heavenly Stems and Earthly Branches calculation formula agreed in advance to obtain the private key information, thereby greatly increasing the complexity of the key, and each time the public key and private key are dynamically generated in real time, so that each log has a different public key and private key, thereby greatly reducing the risk of log exposure and greatly ensuring the security of the key. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 It is a flow chart of the steps of a log management method provided by an embodiment of the present invention;

[0060] Figure 2 is an interaction diagram between the log management platform and the encryption server in an embodiment of the present invention;

[0061] Figure 3 It is a structural block diagram of a log management device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0063] Reference Figure 1, shows a flow chart of the steps of a log management method provided by an embodiment of the present invention, which is applied to a log management platform, and the log management platform communicates with an encryption server. The method may specifically include the following steps:

[0064] Step 101, obtaining the public key information generated by the encryption server for the encrypted log; the public key information includes the year and date.

[0065] In the embodiment of the present invention, it can be applied to the log management platform, and the log management platform can be responsible for the storage and transmission of logs. In order to ensure the security of the storage and transmission of logs, the log management platform can communicate with the encryption server, and the encryption server can be responsible for the encryption and decryption of logs.

[0066] In a specific implementation, when a user requests to view an encrypted log, the log management platform can obtain the public key information corresponding to the encrypted log. The public key information can be the public key information generated by the encryption server for the encrypted log before the log management platform stores the encrypted log, and the public key information can include the year and date.

[0067] In the prior art, many enterprises or individuals do not encrypt the logs managed by the server, and can view the logs at will as long as they log in to the server, resulting in low log security. In the embodiment of the present invention, when a user requests to view the log, since the log stored in the log management platform is encrypted by the encryption server, the log management platform needs to obtain the public key information generated by the encryption server for the encrypted log, thereby preventing the log from being viewed at will as long as the user logs in to the log management platform. Compared with the prior art, the embodiment of the present invention can greatly improve the security of the log.

[0068] In an optional embodiment of the present invention, before obtaining the public key information generated by the encryption server for the encrypted log, the method may further include:

[0069] Each ciphertext package generated by the encryption server for each log is stored; the ciphertext package includes the encrypted log and the corresponding public key information; the public key information is generated by the encryption server according to the randomly assigned year date.

[0070] In a specific implementation, before the log management platform obtains the public key information generated by the encryption server for the encrypted log, the encryption server can generate a corresponding ciphertext package for each log, and the ciphertext package can include the encrypted log and the corresponding public key information. Among them, the public key information can be generated by the encryption server based on the year date randomly assigned by the encryption server. After receiving each ciphertext package generated by the encryption server for each log, the log management platform can store each ciphertext package.

[0071] In an optional embodiment of the present invention, the step of storing each ciphertext package generated by the encryption server for each log may include the following sub-steps:

[0072] Sub-step S11, sending an encryption request to the encryption server; the encryption request includes each log and a corresponding timestamp; the timestamp is used to identify the generation time of the log.

[0073] In a specific implementation, before storing or transmitting each log, the log management platform can generate a corresponding timestamp for each log, and the timestamp can be used to identify the generation time of the log. At this time, each log is not encrypted, so the log management platform can use each log and the corresponding timestamp as an encryption request and send an encryption request to the encryption server, so that the encryption server encrypts the unencrypted log.

[0074] Sub-step S12, receiving each encrypted log and each public key information returned by the encryption server, and storing each encrypted log and each public key information; the encrypted log is obtained by the encryption server encrypting the log; the public key information is obtained by the encryption server combining and reversely processing the randomly assigned year date and the generation time of the log.

[0075] In a specific implementation, after receiving the encryption request sent by the log management platform, the encryption server can extract each log and the corresponding timestamp from the encryption request. The encryption server can randomly assign a corresponding year date to each log, and then the encryption server can combine the corresponding year date and the corresponding generation time of each log to obtain each public key combination. The encryption server can then reverse the order of each number in each public key combination according to a preset reverse order rule, so that the encryption server can obtain the public key information corresponding to each log, wherein the preset reverse order rule can be a rule agreed upon in advance by the encryption server and the log management platform. The encryption server can encrypt each log according to the corresponding public key information, so that the encryption server can obtain each encrypted log. The encryption server can return each encrypted log and each public key information to the log management platform so that the log management platform stores each encrypted log and each public key information.

[0076] In one example, assuming that the generation time of log A is 16:30 on June 16, 2022, the timestamp generated by the log management platform for log A may be "202206161630". The log management platform may send log A and the timestamp "202206161630" as an encryption request to the encryption server. The encryption server may randomly assign a corresponding year date to log A. Assuming that the year date is "20060401", the encryption server may combine the year date "20060401" and the timestamp "202206161630" to obtain a public key combination, which may be "20060401202206161630". The encryption server may reverse the order of the numbers in the public key combination according to the preset reverse order rule, so that the encryption server may obtain the public key information A of log A, which may be "03616160220210406002". The examples are only used to help those skilled in the art to better understand the embodiments of the present invention, and the present invention is not limited thereto.

[0077] Since the public key information is just a string of numbers obtained by combining the year date and the generation time of the log and processing them in reverse order, even if the public key information is exposed to other users, only a string of time numbers is exposed. Because the preset reverse order rule cannot be known, other users cannot restore the order of each number in the public key information before the reverse order, and because the generation time of the log cannot be known, other users cannot extract the year date implied in the public key information, and because the year date is randomly assigned by the encryption server, other users cannot infer the year date implied in the public key information. By encrypting the public key information, the embodiment of the present invention can greatly improve the security of the key compared to the single, fixed key in the prior art.

[0078] Step 102, calculating the first Chinese zodiac day corresponding to the year date.

[0079] In an embodiment of the present invention, the log management platform can restore the order of each number in the public key information according to a preset reverse rule, and then extract the implicit year date from the restored public key information according to the generation time of the log, so that the log management platform can calculate the first zodiac day corresponding to the year date.

[0080] In one example, assuming that the public key information A of log A is "03616160220210406002", the log management platform can restore the order of each number in the public key information A before the inversion according to the preset inversion rule, and the order before the inversion can be "20060401202206161630", and the log management platform can extract the implicit year date "20060401" from the restored public key information "20060401202206161630" according to the generation time of log A on June 16, 2022 at 16:30, so that the log management platform can calculate the first zodiac day corresponding to the year date "20060401". The example is only used to enable those skilled in the art to better understand the embodiments of the present invention, and the present invention does not limit this.

[0081] It should be noted that the Heavenly Stems and Earthly Branches can be abbreviated as "ganzhi", which is derived from the trunks and branches of trees. There are ten Heavenly Stems, namely Jia, Yi, Bing, Ding, Wu, Ji, Geng, Xin, Ren, and Gui; there are twelve Earthly Branches, namely Zi, Chou, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu, and Hai. The Heavenly Stems and Earthly Branches are combined into sixty timing numbers, which are used as the names of years, months, days, and hours. It is called the "ganzhi calendar", and each rotation number is called a jiazi. Sixty jiazis are used to record years in sequence, and a cycle of sixty years is a reincarnation. The node of the Heavenly Stems and Earthly Branches is the beginning of spring in the lunar calendar each year. When the beginning of spring comes, it is a new year, that is, January and February are calculated according to the 13th and 14th months of the previous year.

[0082] In the embodiment of the present invention, the Heavenly Stems and Earthly Branches algorithm agreed upon in advance by the encryption server and the log management platform can be used to calculate the first Heavenly Stems and Earthly Branches day corresponding to the year date.

[0083] In an optional embodiment of the present invention, step 102 may include the following sub-steps:

[0084] Sub-step S21, using a preset Heavenly Stems algorithm to calculate the number of digits corresponding to the Heavenly Stems of the year and date;

[0085] In the embodiment of the present invention, the year date is composed of year, month and day, and the first stem day is composed of heavenly stems and earthly branches. The encryption server and the log management platform can agree in advance on a preset heavenly stem algorithm, so that the log management platform can use the preset heavenly stem algorithm to calculate the digits corresponding to the heavenly stems of the year date.

[0086] In the specific implementation, the preset Tiangan algorithm is shown in Formula 1:

[0087]

[0088] Among them, C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, and numbers with [] represent rounding. After calculating the G value, divide the G value by 10, and the remainder obtained is the digit corresponding to the heavenly stem of the year and date.

[0089] In one example, assuming that the encryption server randomly assigns the year date "20060401" to log A, "20060401" is April 1, 2006. The log management platform can substitute the value of the year date into Formula 1:

[0090]

[0091] The calculation results in G=117, and then the remainder obtained by dividing the G value by 10 is 7. The remainder 7 is the digit corresponding to the heavenly stem of the year date "20060401".

[0092] Sub-step S22, using a preset earthly branch algorithm, calculates the number of digits corresponding to the earthly branch of the year date.

[0093] In the embodiment of the present invention, the year date is composed of year, month and day, and the first zodiac day is composed of heavenly stems and earthly branches. The encryption server and the log management platform can agree in advance on a preset earthly branch algorithm, so that the log management platform can use the preset earthly branch algorithm to calculate the digits corresponding to the earthly branches of the year date.

[0094] In the specific implementation, the preset earthly branch algorithm is shown in Formula 2:

[0095]

[0096] Among them, C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, odd-numbered months i=0, even-numbered months i=6, and numbers with [] represent rounding. After calculating the Z value, divide the Z value by 12, and the remainder obtained is the digit corresponding to the earthly branch of the year and date.

[0097] In one example, assuming that the encryption server randomly assigns the year date "20060401" to log A, "20060401" is April 1, 2006. The log management platform can substitute the value of the year date into Formula 2:

[0098]

[0099] The calculation results in Z=213, and the remainder obtained by dividing the Z value by 12 is 9. The remainder 9 is the digit corresponding to the earthly branch of the year date "20060401".

[0100] Sub-step S23, determining the first heavenly stem and earthly branch day corresponding to the year date according to the number of digits corresponding to the heavenly stems and the number of digits corresponding to the earthly branches.

[0101] In one example, the number of digits corresponding to the Heavenly Stems of the year date "20060401" can be obtained from sub-step S21 as "7", and the number of digits corresponding to the Earthly Branches of the year date "20060401" can be obtained from sub-step S22 as "9". According to the ranking of the Heavenly Stems, the 7th position of the Heavenly Stems is "Geng", so the Heavenly Stems of the year date "20060401" are "Geng". According to the ranking of the Earthly Branches, the 9th position of the Earthly Branches is "Shen", so the Earthly Branches of the year date "20060401" are "Shen". By combining the Heavenly Stems "Geng" and the Earthly Branches "Shen", it can be obtained that the first Heavenly Stems and Earthly Branches day corresponding to the year date "20060401" is "Gengshen Day".

[0102] Step 103, generating private key information according to the first Chinese zodiac day.

[0103] In an embodiment of the present invention, after calculating the first zodiac day corresponding to the year date, the log management platform can use the first zodiac day to generate private key information. The embodiment of the present invention uses the Heavenly Stems and Earthly Branches algorithm to generate keys, and requires users to correctly master the Heavenly Stems and Earthly Branches calculation formula agreed in advance to obtain private key information, thereby greatly increasing the complexity of the key, and dynamically generating public keys and private keys in real time each time, so that each log has a different public key and private key, thereby greatly reducing the risk of log exposure and greatly ensuring the security of the key.

[0104] In an optional embodiment of the present invention, step 103 may include the following sub-steps:

[0105] Sub-step S31, obtaining a random number randomly assigned by the encryption server.

[0106] In an optional embodiment of the present invention, sub-step S31 may include the following sub-steps:

[0107] Sub-step S311, sending the first zodiac day to the encryption server, so that the encryption server determines whether the first zodiac day corresponding to the year date currently calculated by the log management platform is consistent with the second zodiac day corresponding to the year date pre-calculated by the encryption server;

[0108] Sub-step S312, receiving a random number returned by the encryption server when the first zodiac day is consistent with the second zodiac day.

[0109] In an embodiment of the present invention, the log management platform needs to decrypt the year and date implied in the public key information, and needs to calculate the first zodiac day corresponding to the year and date. In order to ensure the security of the private key, the encryption server can be used to identify whether the first zodiac day calculated by the log management platform meets the preset conditions. When the first zodiac day meets the preset conditions, the log management platform can obtain the random number randomly assigned by the encryption server, so that the log management platform can use the first zodiac day and the random number to generate private key information. Among them, the random number can be a six-digit random number, a nine-digit random number, a twelve-digit random number, etc. The embodiment of the present invention does not limit the number of digits of the random number.

[0110] It should be noted that before the log management platform stores the encrypted logs, the encryption server can not only generate corresponding public key information for the encrypted logs, but also generate corresponding private key information for the encrypted logs.

[0111] Specifically, the process of the encryption server generating private key information is as follows: the encryption server can calculate the second zodiac day corresponding to the year date in the public key information, and the specific calculation process can refer to the above-mentioned sub-steps S21 to S23; the encryption server can randomly assign a random number to the encrypted log; the encryption server can combine the second zodiac day and the random number to obtain a private key combination, wherein the private key combination can include text and numbers; the encryption server can reverse the text order and the number order in the private key combination according to the preset reverse order rule, so that the encryption server can obtain the private key information corresponding to the encrypted log. The encryption server can send the public key information to the log management platform for storage, and the private key information can be stored in the encryption server.

[0112] In a specific implementation, after receiving the first zodiac day sent by the log management platform, the encryption server can obtain the private key information stored locally. The encryption server can restore the order of the numbers in the private key information according to the preset reverse order rule to obtain a private key combination, and then the encryption server can extract the second zodiac day corresponding to the year date from the private key combination. The encryption server can determine whether the first zodiac day is consistent with the second zodiac day. When the first zodiac day is consistent with the second zodiac day, the encryption server can extract a random number from the private key combination. The encryption server can return the random number to the log management platform.

[0113] It should be noted that the first zodiac day is the zodiac day corresponding to the year and date calculated by the log management platform after the log management platform detects that the user requests to view the encrypted log; the second zodiac day is the zodiac day corresponding to the year and date calculated by the encryption server before the log management platform stores the encrypted log.

[0114] Sub-step S32, generating private key information according to the first Chinese zodiac day and the random number.

[0115] In an optional embodiment of the present invention, sub-step S32 may include the following sub-steps:

[0116] Sub-step S321, combining the first Chinese zodiac day and the random number to obtain a private key combination; the private key combination includes text and numbers;

[0117] Sub-step S322, according to a preset reverse order rule, the order of the letters and the order of the numbers in the private key combination are reversed to obtain the private key information.

[0118] In an embodiment of the present invention, after the log management platform obtains the random number randomly assigned by the encryption server, it can combine the first zodiac day and the random number to obtain a private key combination, wherein the private key combination can be composed of text and numbers. Then the log management platform can reverse the text order and the number order in the private key combination according to the preset reverse order rule, so that the log management platform can obtain the final private key information.

[0119] In an example, assuming that the first zodiac day calculated by the log management platform is "Gengshen Day", and the random number randomly assigned by the encryption server is "512738", the log management platform can combine the first zodiac day and the random number to obtain a private key combination composed of text and numbers, and the private key combination can be "Gengshen Day 512738". Then the log management platform can reverse the order of the text and numbers in the private key combination according to the preset reverse order rule, so that the log management platform can obtain the final private key information, and the private key information can be "837215 Day Shen Geng".

[0120] Step 104: Decrypt the encrypted log using the private key information.

[0121] In the embodiment of the present invention, after the log management platform generates the final private key information, the private key information can be used to decrypt the encrypted log, so that the user can view the decrypted log.

[0122] In an embodiment of the present invention, the public key information generated by the encryption server for the encrypted log is obtained, the public key information includes the year date, and then the first zodiac day corresponding to the year date is calculated, and then the private key information is generated according to the first zodiac day, and finally the encrypted log is decrypted using the private key information. The embodiment of the present invention uses the Heavenly Stems and Earthly Branches algorithm to generate the key, and the user needs to correctly master the Heavenly Stems and Earthly Branches calculation formula agreed in advance to obtain the private key information, thereby greatly increasing the complexity of the key, and each time the public key and private key are dynamically generated in real time, so that each log has a different public key and private key, thereby greatly reducing the risk of log exposure and greatly ensuring the security of the key.

[0123] In order to enable those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention are described below through the following examples:

[0124] refer to Figure 2 , shows an interaction diagram between the log management platform and the encryption server in an embodiment of the present invention, and the log management process is specifically as follows:

[0125] 1. The log management platform sends an encryption request to the encryption server; the encryption request includes the log and the corresponding timestamp; the timestamp is used to identify the generation time of the log;

[0126] 2. The encryption server randomly assigns a year and date to the log; the encryption server combines the year and date with the generation time of the log and processes them in reverse order to obtain public key information; the encryption server encrypts the log to obtain an encrypted log;

[0127] 3. The encryption server randomly assigns a random number to the log; the encryption server calculates the second zodiac day corresponding to the year date in the public key information; the encryption server combines the second zodiac day and the random number and processes them in reverse order to obtain the private key information; the encryption server stores the private key information;

[0128] 4. The encryption server returns the encrypted log and public key information to the log management platform;

[0129] 5. The log management platform stores the encrypted logs and public key information;

[0130] 6. When a user requests to view an encrypted log, the log management platform obtains the public key information corresponding to the encrypted log; the log management platform extracts the year and date from the public key information according to the preset reverse order rule;

[0131] 7. The log management platform calculates the first zodiac day corresponding to the year date;

[0132] 8. The log management platform sends the first zodiac day to the encryption server;

[0133] 9. The encryption server obtains the private key information corresponding to the encrypted log; the encryption server extracts the year date and random number from the private key information according to the preset reverse order rule; the encryption server matches the first zodiac day corresponding to the year date currently calculated by the log management platform with the second zodiac day corresponding to the year date pre-calculated by the encryption server, and determines whether the first zodiac day is consistent with the second zodiac day;

[0134] 10. When the first zodiac day is the same as the second zodiac day, the encryption server returns a random number to the log management platform;

[0135] 11. The log management platform combines the first zodiac day and the random number and processes them in reverse order to obtain the private key information;

[0136] 12. The log management platform uses private key information to decrypt encrypted logs.

[0137] refer to Figure 3 , shows a structural block diagram of a log management device provided by an embodiment of the present invention, which is applied to a log management platform. The log management platform communicates with an encryption server and may specifically include the following modules:

[0138] The public key information acquisition module 301 is used to acquire the public key information generated by the encryption server for the encrypted log; the public key information includes the year and date;

[0139] The first zodiac day calculation module 302 is used to calculate the first zodiac day corresponding to the year date;

[0140] A private key information generating module 303, configured to generate private key information according to the first zodiac day;

[0141] The decryption module 304 is used to decrypt the encrypted log using the private key information.

[0142] In an optional embodiment of the present invention, before obtaining the public key information generated by the encryption server for the encrypted log, the apparatus may further include:

[0143] The storage module is used to store each ciphertext package generated by the encryption server for each log; the ciphertext package includes the encrypted log and the corresponding public key information; the public key information is generated by the encryption server according to the randomly assigned year date.

[0144] In an optional embodiment of the present invention, the storage module may include:

[0145] An encryption request sending submodule, used to send an encryption request to the encryption server; the encryption request includes each log and a corresponding timestamp; the timestamp is used to identify the generation time of the log;

[0146] The storage submodule is used to receive each encrypted log and each public key information returned by the encryption server, and store the each encrypted log and each public key information; the encrypted log is obtained by the encryption server encrypting the log; the public key information is obtained by the encryption server combining and reversing the randomly assigned year date and the generation time of the log.

[0147] In an optional embodiment of the present invention, the first stem-branch day calculation module 302 may include:

[0148] A Heavenly Stems calculation submodule, for calculating the number of digits corresponding to the Heavenly Stems of the year and date using a preset Heavenly Stems algorithm;

[0149] The earthly branch calculation submodule is used to calculate the number of digits corresponding to the earthly branch of the year date using a preset earthly branch algorithm;

[0150] The first celestial stem and earthly branch day calculation submodule is used to determine the first celestial stem and earthly branch day corresponding to the year date according to the number of digits corresponding to the celestial stem and the number of digits corresponding to the earthly branch.

[0151] In an optional embodiment of the present invention, the private key information generation module 303 may include:

[0152] A random number acquisition submodule, used to obtain a random number randomly assigned by the encryption server;

[0153] The private key information generation submodule is used to generate private key information according to the first zodiac day and the random number.

[0154] In an optional embodiment of the present invention, the random number acquisition submodule includes:

[0155] A first zodiac day sending unit, used to send the first zodiac day to the encryption server, so that the encryption server determines whether the first zodiac day corresponding to the year date currently calculated by the log management platform is consistent with the second zodiac day corresponding to the year date pre-calculated by the encryption server;

[0156] A random number receiving unit is used to receive the random number returned by the encryption server when the first zodiac day is consistent with the second zodiac day.

[0157] In an optional embodiment of the present invention, the private key information generation submodule includes:

[0158] A combining unit, used for combining the first Chinese zodiac day and the random number to obtain a private key combination; the private key combination includes text and numbers;

[0159] The reversal unit is used to reverse the order of the letters and numbers in the private key combination according to a preset reversal rule to obtain the private key information.

[0160] In an embodiment of the present invention, the public key information generated by the encryption server for the encrypted log is obtained, the public key information includes the year date, and then the first zodiac day corresponding to the year date is calculated, and then the private key information is generated according to the first zodiac day, and finally the encrypted log is decrypted using the private key information. The embodiment of the present invention uses the Heavenly Stems and Earthly Branches algorithm to generate the key, and the user needs to correctly master the Heavenly Stems and Earthly Branches calculation formula agreed in advance to obtain the private key information, thereby greatly increasing the complexity of the key, and each time the public key and private key are dynamically generated in real time, so that each log has a different public key and private key, thereby greatly reducing the risk of log exposure and greatly ensuring the security of the key.

[0161] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0162] An embodiment of the present invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned log management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0163] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned log management method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0164] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0165] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0166] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0167] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0169] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0170] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0171] The log management method, device, electronic device and computer-readable storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A log management method, characterized in that: Applied to a log management platform, the log management platform communicates with an encryption server, the method comprising: Obtaining public key information generated by the encryption server for the encrypted log; the public key information includes the year and date; Calculate the first Chinese zodiac day corresponding to the year date; Generate private key information according to the first Chinese zodiac day; Decrypting the encrypted log using the private key information; The step of calculating the first Chinese zodiac day corresponding to the year date includes: The preset Heavenly Stems algorithm is used to calculate the digits corresponding to the Heavenly Stems of the year and date. The preset Heavenly Stems algorithm is: Among them, C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, and numbers with [] represent rounding; The preset earthly branch algorithm is used to calculate the digits corresponding to the earthly branch of the year date, and the preset earthly branch algorithm is: Where C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, i=0 for odd months, i=6 for even months, and numbers with [] represent rounding; The first heavenly stem and earthly branch day corresponding to the year date is determined according to the number of digits corresponding to the heavenly stems and the number of digits corresponding to the earthly branches.

2. The method according to claim 1, characterized in that Before obtaining the public key information generated by the encryption server for the encrypted log, the method further includes: Each ciphertext package generated by the encryption server for each log is stored; the ciphertext package includes the encrypted log and the corresponding public key information; the public key information is generated by the encryption server according to the randomly assigned year date.

3. The method according to claim 2, characterized in that The storing of each ciphertext package generated by the encryption server for each log includes: Sending an encryption request to the encryption server; the encryption request includes each log and a corresponding timestamp; the timestamp is used to identify the generation time of the log; Receive each encrypted log and each public key information returned by the encryption server, and store each encrypted log and each public key information; the encrypted log is obtained by the encryption server encrypting the log; the public key information is obtained by the encryption server combining and reversing the randomly assigned year date and the generation time of the log.

4. The method according to claim 1, characterized in that: The generating of private key information according to the first zodiac day includes: Obtaining a random number randomly assigned by the encryption server; Generate private key information based on the first zodiac day and the random number.

5. The method according to claim 4, characterized in that The obtaining of the random number randomly assigned by the encryption server comprises: Sending the first zodiac day to the encryption server, so that the encryption server determines whether the first zodiac day corresponding to the year date currently calculated by the log management platform is consistent with the second zodiac day corresponding to the year date pre-calculated by the encryption server; Receive a random number returned by the encryption server when the first zodiac day is consistent with the second zodiac day.

6. The method according to claim 4, characterized in that The generating of private key information according to the first zodiac day and the random number includes: The first Chinese zodiac day and the random number are combined to obtain a private key combination; the private key combination includes text and numbers; According to a preset reverse order rule, the order of letters and numbers in the private key combination is reversed to obtain private key information.

7. A log management device, characterized in that: Applied to a log management platform, the log management platform communicates with an encryption server, the device comprises: A public key information acquisition module, used to acquire the public key information generated by the encryption server for the encrypted log; the public key information includes the year and date; The first zodiac day calculation module is used to calculate the first zodiac day corresponding to the year date; A private key information generation module, used to generate private key information according to the first zodiac day; A decryption module, used to decrypt the encrypted log using the private key information; The step of calculating the first Chinese zodiac day corresponding to the year date includes: The preset Heavenly Stems algorithm is used to calculate the digits corresponding to the Heavenly Stems of the year and date. The preset Heavenly Stems algorithm is: Among them, C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, and numbers with [] represent rounding; The preset earthly branch algorithm is used to calculate the digits corresponding to the earthly branch of the year date, and the preset earthly branch algorithm is: Where C represents the century minus one, y represents the last two digits of the year, M represents the month, d represents the day, i=0 for odd months, i=6 for even months, and numbers with [] represent rounding; The first heavenly stem and earthly branch day corresponding to the year date is determined according to the number of digits corresponding to the heavenly stems and the number of digits corresponding to the earthly branches.

8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the log management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the log management method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Encryption method, decryption method and devices for log file

    CN108833091A

  • Log storage and reading method and device based on block chain, equipment and medium

    CN110839015A