CN106919810B - Registration code generation method and device and software registration method and device - Google Patents

Registration code generation method and device and software registration method and device Download PDF

Info

Publication number
CN106919810B
CN106919810B CN201710096734.8A CN201710096734A CN106919810B CN 106919810 B CN106919810 B CN 106919810B CN 201710096734 A CN201710096734 A CN 201710096734A CN 106919810 B CN106919810 B CN 106919810B
Authority
CN
China
Prior art keywords
ciphertext
registration code
software
code
registration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710096734.8A
Other languages
Chinese (zh)
Other versions
CN106919810A (en
Inventor
罗忠明
熊飞
陈明宇
张雲瑞
伍鹏辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
GRG Banking Equipment Co Ltd
Original Assignee
GRG Banking Equipment 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 GRG Banking Equipment Co Ltd filed Critical GRG Banking Equipment Co Ltd
Priority to CN201710096734.8A priority Critical patent/CN106919810B/en
Publication of CN106919810A publication Critical patent/CN106919810A/en
Application granted granted Critical
Publication of CN106919810B publication Critical patent/CN106919810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/105Arrangements for software license management or administration, e.g. for managing licenses at corporate level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software

Abstract

The invention discloses a method for generating registration codes, which can effectively overcome the defects of less information and single function of the existing registration codes, avoid the problems of complicated authorization process and fixed parameters of license files, facilitate user input, and only need to replace the registration codes when switching to a formal use stage in a trial software stage by enabling the registration codes to comprise three information of machine codes, software product passwords and a plurality of software authorities, wherein the machine codes can prevent the software from being illegally copied and installed, reinstalled by a reinstallation system, reinstalled after an appointed trial condition is expired and the like, and different software product passwords can protect a plurality of software products by using the same software registration protection method, need not to reinstall, convenient and fast.

Description

Registration code generation method and device and software registration method and device
Technical Field
The invention relates to the technical field of computers, in particular to a registration code generation method and device and a software registration method and device.
Background
Software developers often provide software for potential customers to try out in order to promote the software, and meanwhile, in order to protect the benefits of the software developers, the software developers can limit the functions of software of trial versions. Firstly, a software developer provides trial version software with partial cut-off functions for a customer to experience, and the customer provides full-function software with a formal version only after formal purchase; secondly, the software developer provides full-function trial version software with a service life for the trial of the client, and a formal version is required to be purchased and installed after the trial is over; thirdly, the software developer provides full-function software for the customer to try out, but the software defaults to have a service life, and after the service life, the software developer must ask for a License file or input a registration code to normally use the software. In these three ways, the software of the cutting function will make the user experience bad on trial, and may lose the potential customers. Or the trial software with the cutting function can meet the requirements of the customers, so that the customers do not purchase power further, which is equivalent to providing free software. The full-function trial software with the service life is different from the formal software in program files, so that the software needs to be reinstalled or upgraded after being purchased, and smooth transition from trial to formal use cannot be realized.
The License file authorization mode can be used by a plurality of groups of information unit control software, but the License file generally has a large file volume, is not beneficial to human reading and memory, is difficult to transmit through telephone and short message, is not suitable for batch use, and is even impossible to manually input the content of the License file on a target machine applied like an ATM. Although the software using the registration code is convenient to input, the registration code contains a few information units and has a single function, and whether the software can be used continuously can be determined only by identifying the valid or invalid state of the registration code. The trial duration of the trial version software with the service life in the License file or registration code mode is fixed, flexible control cannot be achieved, and the condition of use can be continuously tried after a customer tries to expire and the system is reinstalled.
Therefore, a method for conveniently inputting and flexibly controlling the software use permission is needed, which can meet the requirements of users and effectively protect the software property rights.
Disclosure of Invention
The embodiment of the invention aims to provide a registration code generation method and device and a software registration method and device, which can effectively overcome the defects of less information and single function of the existing registration code, avoid the problems of complicated license file authorization process and fixed parameters, and can facilitate input and flexibly control.
In order to achieve the above object, an embodiment of the present invention provides a registration code generation method, including:
generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
generating an authorization information ciphertext according to a plurality of preset software use authorities;
performing encryption operation according to the first intermediate ciphertext and the authorization information ciphertext to generate a registration code ciphertext;
and outputting a character string sequence of the registration code according to the registration code ciphertext.
Compared with the prior art, the registration code generation method disclosed by the invention has the advantages that a first intermediate ciphertext is generated by a first encryption algorithm based on the machine code and the software product password, an authorization information ciphertext is generated according to a plurality of preset software use authorities, and then the first intermediate ciphertext and the authorization information ciphertext are generated into the registration code ciphertext, so that a character string sequence of the registration code is output, the registration code comprises three kinds of information of the machine code, the software product password and a plurality of software authorities, the defects of less information and single function of the existing registration code can be effectively overcome, the problems of complicated license file authorization process and fixed parameters are avoided, the property right of the software can be flexibly controlled and protected.
As an improvement of the scheme, the machine code is generated by carrying out Hash operation on the software product password and one or more of the following information: the serial number of a computer hard disk, the serial number of a computer CPU, the MAC address of a computer network card, the system time of first-time calculation of a machine code and the content of a software configuration file. By generating the machine code for the software product password and the computer hardware information, illegal copying of software can be prevented. And the software configuration file content is used as the machine code calculation input, so that the condition that the user cannot modify the key configuration can be limited, and the property right of the software is protected.
As an improvement of the above scheme, after performing encryption operation on the first intermediate ciphertext and the authorization information ciphertext, generating a registration code ciphertext specifically includes the steps of:
splitting the first intermediate ciphertext into a first part and a second part, and generating a temporary ciphertext by using the second part of the first intermediate ciphertext and the authorization information ciphertext through a second encryption algorithm;
combining the first part of the first intermediate ciphertext with the temporary ciphertext to generate a second intermediate ciphertext, and generating a third intermediate ciphertext through the first encryption algorithm;
and splitting the third intermediate ciphertext into a first part and a second part, and combining the first part of the third intermediate ciphertext and the temporary ciphertext to generate a registration code ciphertext.
Through repeated combination and encryption operation, the registration code is ensured to include the information of the software product password, the machine code and a plurality of software use authorities, and the unrepeatability of the registration code is also ensured.
As an improvement of the above scheme, the length of the first intermediate ciphertext and the machine code ciphertext is 16 bytes; and the lengths of the first part and the second part of the first intermediate ciphertext or the third intermediate ciphertext satisfy the following relation:
X+Y=16,X>0&Y>0
wherein, X is the number of bytes occupied by the first part of the first intermediate ciphertext or the first part of the third intermediate ciphertext, and Y is the number of bytes occupied by the second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext. The byte number occupied by the first part is smaller than that occupied by the second part, so that the register ciphertext can be ensured to have enough storage space to include the required software use permission.
As an improvement of the above scheme, the second encryption algorithm is an exclusive-or encryption algorithm, a cyclic shift encryption algorithm, or a substitution encryption algorithm. And the method can be suitable for different software use authorization settings by setting different length compositions.
As an improvement of the above scheme, the first encryption algorithm is a Hash encryption algorithm. The Hash encryption algorithm can ensure the integrity and compactness of information.
As an improvement of the scheme, the authorization information ciphertext comprises an information unit consisting of modules, an information unit for limiting times, an information unit for limiting the number of days of software use, an information unit for limiting dates, an information unit for the maximum number of connections of a client, an information unit for the maximum number of simultaneous users, an information unit for the maximum throughput or an information unit for supporting the maximum number of CPUs. By setting various software use permissions, the authorization information ciphertext can comprise various software use permission information, so that the software is more flexibly used, and the diversified requirements of users are met.
The embodiment of the invention also correspondingly provides a software registration method, which comprises the following steps:
dividing a machine code and a software product password into a first intermediate ciphertext through a first encryption algorithm, and dividing the first intermediate ciphertext into a first part and a second part;
receiving a registration code input by a user, converting the registration code into a registration code ciphertext, and splitting the registration code ciphertext into a first part and a second part;
combining the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, generating a third intermediate ciphertext through a first encryption algorithm, and splitting the third intermediate ciphertext into the first part and the second part;
when the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, determining that the registration code is valid, and storing the registration code ciphertext into a registry;
and when the registration code is valid, obtaining an authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm, and analyzing the authorization information ciphertext to obtain the authorization information of the software product.
The embodiment of the invention discloses a software registration method, which comprises the steps of firstly carrying out encryption operation on a machine code and a software product password, then carrying out splitting, recombination and encryption operation on the machine code and the software product password and a registration code ciphertext to obtain a third intermediate ciphertext, and if the first part of the third intermediate ciphertext is the same as the first part of the registration code ciphertext, determining that the registration code is valid; and if the registration code is valid, performing encryption operation on the second part of the third intermediate ciphertext and the second part of the registration code ciphertext to generate an authorization information ciphertext, and analyzing the authorization information ciphertext to obtain the authorization information. By verifying the right of use of the software for the first part of the registration code ciphertext, the use of illegally used software such as illegal copying of the software, reinstallation after the system is reinstalled and the like can be prevented, and the property right of the software is effectively protected; after the software use right is verified, the authorization information is obtained by analyzing the authorization information ciphertext, the software use rights such as software function module composition, use times, use days, use period and the like can be flexibly configured, the diversified requirements of users can be met, the defects that the existing registration code contains less information and has single function can be effectively overcome, the problems that the license file authorization process is too complicated and parameters are fixed are avoided, the input is convenient, and the control is flexible.
The embodiment of the invention also correspondingly provides a registration code generating device, which comprises:
the first intermediate ciphertext generating module is used for generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
the authorization information generation module is used for generating an authorization information ciphertext according to a plurality of preset software use authorities;
and the registration code generating module is used for generating a registration code ciphertext after carrying out encryption operation according to the first intermediate ciphertext and the authorization information ciphertext.
And the registration code output module is used for outputting the character string sequence of the registration code according to the registration code ciphertext.
According to the register code generating device disclosed by the embodiment of the invention, the machine code and the software product password are integrated through the first intermediate ciphertext generating module to generate the first intermediate ciphertext, the authorization information ciphertext is generated through the authorization information generating module according to the preset software use permission, and the first intermediate ciphertext and the register code generating module are combined and encrypted to generate the register code ciphertext, so that the register code comprises three kinds of information of the machine code, the software product password and the software permission, the software is prevented from being illegally copied and installed, the defects of less information and single function of the existing register code can be effectively overcome, the problems of excessively complicated authorization process and fixed parameters of using a license file are avoided, and the property right of the software can be flexibly controlled and protected.
The embodiment of the invention also correspondingly provides a software registration device, which comprises:
the first intermediate ciphertext splitting module is used for forming a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password, and splitting the first intermediate ciphertext into a first part and a second part;
the registration code ciphertext splitting module is used for receiving a registration code input by a user, converting the registration code into a registration code ciphertext and splitting the registration code ciphertext into a first part and a second part;
a third intermediate ciphertext splitting module, configured to combine the first portion of the first intermediate ciphertext and the second portion of the registration code ciphertext to generate a second intermediate ciphertext, generate a third intermediate ciphertext through a first encryption algorithm, and split the third intermediate ciphertext into the first portion and the second portion;
a registration code verification module, configured to determine that a registration code is valid when the first portion of the third intermediate ciphertext is equal to the first portion of the registration code ciphertext, and store the registration code ciphertext in a registry;
and the authorization information analysis module is used for obtaining an authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm when the registration code is valid, and analyzing the authorization information ciphertext to obtain the authorization information of the software product.
The embodiment of the invention discloses a software registration device, which comprises the steps of firstly carrying out encryption operation on a machine code and a software product password, then carrying out splitting, recombination and encryption operation on the machine code and the software product password and a registration code ciphertext to obtain a third intermediate ciphertext, and if the first part of the third intermediate ciphertext is the same as the first part of the registration code ciphertext, determining that the registration code is valid; if the registration code is valid, performing encryption operation on the second part of the third intermediate ciphertext and the second part of the registration code ciphertext through an authorization information analysis module to generate an authorization information ciphertext, and analyzing the authorization information ciphertext to obtain authorization information. By verifying the right of use of the software for the first part of the registration code ciphertext, the use of illegally used software such as illegal copying of the software, reinstallation after the system is reinstalled and the like can be prevented, and the property right of the software is effectively protected; after the software use right is verified, the authorization information is obtained by analyzing the authorization information ciphertext, the software use rights such as software function module composition, use times, use days, use period and the like can be flexibly configured, the diversified requirements of users can be met, the defects that the existing registration code contains less information and has single function can be effectively overcome, the problems that the license file authorization process is too complicated and parameters are fixed are avoided, the input is convenient, and the control is flexible.
Drawings
Fig. 1 is a flowchart illustrating a registration code generation method in embodiment 1 of the present invention.
Fig. 2 is a flowchart illustrating a registration code generation method in embodiment 2 of the present invention.
Fig. 3 is a schematic diagram of a process of generating a registration code in embodiment 2 of the present invention.
Fig. 4 is a flowchart illustrating a software registration method in embodiment 3 of the present invention.
Fig. 5 is a schematic structural diagram of a registration code generation apparatus in embodiment 4 of the present invention.
Fig. 6 is a schematic structural diagram of a software registration apparatus in embodiment 5 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flowchart of a registration code generation method provided in embodiment 1 of the present invention. The registration code generation method shown in fig. 1 includes the steps of:
s11, generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
s12, generating an authorization information ciphertext according to a plurality of preset software use authorities;
s13, after the first intermediate ciphertext and the authorization information ciphertext are subjected to encryption operation, a registration code ciphertext is generated;
and S14, outputting a character string sequence of the registration code according to the registration code ciphertext.
In specific implementation, the software product password is a product password set by a software developer for software of different versions, is private for the developer and is not open to the outside. Firstly, carrying out encryption operation on the machine code and the software product password to obtain a first intermediate ciphertext, wherein the first intermediate ciphertext comprises information of the machine code and the software product password; secondly, generating an authorization information ciphertext according to a plurality of preset software use authorities, wherein the software use authorities can be set by a software developer aiming at different customer groups in a software development and design stage, and can also be set by a user in a software sale use stage and a formal use stage; and then, after carrying out encryption operation on the first intermediate ciphertext and the authorization information ciphertext, generating a registration code ciphertext, and outputting a character string sequence of the registration code according to the registration code ciphertext. Through the process, the information of the software product password, the machine code and the software use permission three can be integrated in the registration code ciphertext, wherein the machine code and the software product password are used for verifying the software use permission when the software is used, and different software use permissions can be configured to flexibly control the functional module composition, the number of days of use, the number of use times and the like of the software, so that the diversified requirements of users are met, the defects that the existing registration code contains less information and has single function can be effectively overcome, the problems that the license file authorization process is too complicated and the parameters are fixed are avoided, the input can be facilitated, and the control can be flexibly performed.
Preferably, the machine code is generated by performing a Hash operation on the software product password and one or more of the following information: the serial number of a computer hard disk, the serial number of a computer CPU, the MAC address of a computer network card, the system time of first-time calculation of a machine code and the content of a software configuration file. The hard disk number, the CPU number and the MAC address of the network card can be directly read through an API function of an operating system, and the use of the three groups of data can lead the machine code of each physical machine to be different, thereby limiting the possibility that the same registration code can be simultaneously used on a plurality of machines. For example, the hard disk number of a certain computer is HDS722525VLAT80, and the MAC address is 50-7B-9D-C1-A6-96, and these data are generally unique, so that the machine codes corresponding to different computers are different, and therefore, the same registration code can only identify a unique machine and cannot be copied to other machines for use. On the other hand, the machine code is generated by using the system time of the first calculation of the machine code, so that the vulnerability of reinstalling software after the system is reinstalled can be prevented. Because the system time of the machine code is calculated for the first time, on a specific operating system installation example, the current system time is written into the registry in a numerical value with the granularity of millisecond after the machine code is calculated for the first time, and when the machine code needs to be calculated again for the next time, the time value recorded by the registry is read and used, so that the result of calculating the machine code for each time is consistent, but the machine code is changed certainly because the time millisecond value of acquiring the machine code for the first time is difficult to ensure to be the same after the system is reinstalled, and the current registry code can be invalidated due to the change of the machine code. Furthermore, the software configuration content as the machine code calculation input can limit the user from being able to modify the key configuration, for example, some software may display the name of the client company used on the window title, if the content of the client company name is used as the parameter of the computer code, the machine code may change after the user modifies the displayed company name by the software itself, and the change of the machine code may disable the current registration code. Therefore, the machine code is generated through the software configuration content, and the registration code is generated through the machine code, so that illegal copying and pirating use of the software can be prevented. In the above 6 items, the password of the software product is an input item for computing the machine code, and other items are not necessarily all used in computing the machine code, and may be used in combination with one or more optional items in the software function restriction policy. Different software passwords are configured for different software, so that the management of the registration codes of multiple software products by using the same background software is facilitated, and the fact that the registration codes of different software products cannot be used universally can also be realized.
Therefore, the machine code is used for uniquely identifying a software installation environment in a limited range, can be automatically generated on a computer used by a user, and the user can directly view the machine code on a software interface. Preferably, for ease of input considerations, the machine code is all digital and is limited in length to 10 characters, which 10 characters may be a string of digital representations from 0 to 9. The machine code may be repeated over a wide range, but a very small number of repetitions over a limited range will have no impact on sales and use.
Fig. 2 is a schematic flow chart of a registration code generation method according to embodiment 2 of the present invention. Based on embodiment 1, in the registration code generation method shown in fig. 2, the step S13 specifically includes the steps of:
s131, after the first intermediate ciphertext is split into a first part and a second part, the second part of the first intermediate ciphertext and the authorization information ciphertext are subjected to a second encryption algorithm to generate a temporary ciphertext;
s132, combining the first part of the first intermediate ciphertext and the temporary ciphertext to generate a second intermediate ciphertext, and generating a third intermediate ciphertext through the first encryption algorithm;
and S133, after the third intermediate ciphertext is split into a first part and a second part, combining the first part of the third intermediate ciphertext and the temporary ciphertext to generate a registration code ciphertext.
The operation of the embodiment of the present invention will be described in detail below with reference to fig. 3. In specific implementation, a machine code S provided by a user is received, the machine code S and a software product password K are used as input, a first intermediate ciphertext M1 is generated through a first encryption algorithm, and the first intermediate ciphertext is split into a first part M1-1 and a second part M1-2; generating an authorization information ciphertext P according to a plurality of preset software use authorities; generating a temporary ciphertext R1 through a second encryption algorithm using the second portion M1-2 of the first intermediate ciphertext and the authorization information ciphertext P; then, combining the first part M1-1 of the first intermediate ciphertext with the temporary ciphertext R1 to generate a second intermediate ciphertext M2, and generating a third intermediate ciphertext M3 through a first encryption algorithm; then, the third intermediate ciphertext M3 is split into a first part M3-1 and a second part M3-2, and the first part M3-1 and the temporary ciphertext R1 of the third intermediate ciphertext are combined to generate a registration code ciphertext M4; and finally, outputting a character string sequence R of the registration code according to the registration code ciphertext M4. In the process, a plurality of rounds of encryption operation can be performed through the first encryption algorithm, so that the unrepeatability of the registration codes is facilitated, the cracking difficulty of the registration codes is increased, and the property right of software is protected. Through the process, the registration code comprises three kinds of information of machine code, software product password and a plurality of software authorities, wherein the machine code can prevent the software from being illegally copied and installed, reinstalled by a reinstallation system, reinstalled after the appointed trial condition is expired and the like, different software product passwords ensure that a software developer can use the same software registration protection method to protect various software products, and moreover, the setting of the authority of different software can meet the diversified requirements of different users, the control is flexible, therefore, the scheme can effectively overcome the defects of less information and single function of the existing registration code, avoid the problems of complicated authorization process and fixed parameters when license files are used, facilitate the input of users, and only the registration code needs to be replaced when the trial software stage is switched to the formal use stage, and reinstallation is not needed.
Preferably, the authorization information ciphertext comprises an information unit consisting of modules, an information unit for limiting times, an information unit for limiting the number of days of software use, an information unit for limiting dates, an information unit for the maximum number of connections of the client, an information unit for the maximum number of users simultaneously used, an information unit for the maximum throughput or an information unit for supporting the maximum number of CPUs. The authorization information ciphertext contains information of a plurality of software use authorities, wherein the authorization information ciphertext can comprise a module identifier, two counter initial values and time limit. One for number counting and the other for number of days counting. The number count may be a maximum connection number count of the client, a maximum simultaneous use user number count, a maximum throughput count, or a maximum number count of the supported CPUs, and may be set according to different requirements of the users. Correspondingly, when the software is started or in a certain period during the running of the software, the software is checked and authorized, whether the check item is registered or not, the number of days of use, whether the service life is up or not, whether the designated module is available or not and the like are achieved.
Preferably, the length of the first intermediate ciphertext and the machine code ciphertext may be set to 16 bytes; and the lengths of the first part and the second part of the first intermediate ciphertext or the third intermediate ciphertext satisfy the following relation:
X+Y=16,X>0&Y>0
wherein, X is the number of bytes occupied by the first part of the first intermediate ciphertext or the first part of the third intermediate ciphertext, and Y is the number of bytes occupied by the second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext. And Y is the number of bytes occupied by the second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext. In practical application, the number of bytes X occupied by the first part is smaller than the number of bytes Y occupied by the second part, so that the register ciphertext can be ensured to have enough storage space to include the required software use permission (generally, Y is larger than or equal to 8). As can be seen from the above process, the cipher text of the registration Code takes 16 bytes, that is, 128 bits, and 128 bits can be converted into 32 characters through an ASCII (American Standard Code for information exchange) Code table, and the registration Code is composed of characters of 0 to 9 and a to F for easier input and transfer according to the habit of forming the registration Code.
Further, the first algorithm is a Hash algorithm. The Hash algorithm maps a binary value of arbitrary length to a shorter binary value of fixed length, this small binary value being called the Hash value. The Hash value is a unique and extremely compact representation of a piece of data. If there is a change in the input data, the Hash value will also change. Among them, the more commonly used Hash algorithms are MD5 and SHA.
Preferably, the second encryption algorithm is an exclusive-or encryption algorithm, a cyclic shift encryption algorithm, or a substitution encryption algorithm, which may be exemplified by the following equation:
such as plaintext T, key K; the exclusive or encryption algorithm is E ═ T xor K; the cyclic shift algorithm is that E is T, and the left shift and the right shift are performed circularly (or circularly and rightly); the substitution encryption algorithm is E ═ Table [ K + T mod L ], and L is the size of the substitution Table Table. The cyclic shift is inconvenient to implement in a high-level language, and the substitution encryption needs to construct a substitution mapping table, so that the second encryption algorithm can be preferably an exclusive-or encryption algorithm.
According to the above-mentioned registration code generation method, embodiment 3 of the present invention further provides a software registration method (i.e. an authorization method, which is basically the inverse operation of the above-mentioned registration code generation method) correspondingly, as shown in fig. 4, including the steps of:
s31, based on the machine code and the software product password, a first intermediate ciphertext is formed through a first encryption algorithm, and the first intermediate ciphertext is divided into a first part and a second part;
s32, receiving a registration code input by a user, converting the registration code into a registration code ciphertext, and splitting the registration code ciphertext into a first part and a second part;
s33, combining the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, generating a third intermediate ciphertext through a first encryption algorithm, and splitting the third intermediate ciphertext into the first part and the second part;
s34, when the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, determining that the registration code is valid, and storing the registration code ciphertext into a registry;
and S35, when the registration code is valid, obtaining the authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm, and analyzing the authorization information ciphertext to obtain the authorization information of the software product.
During specific implementation, the machine code S and the software product code K are firstly converted into a first intermediate ciphertext M1 through a first encryption algorithm, and the first intermediate ciphertext M1 is split into a first part M1-1 and a second part M1-2; then converting a registration code R input by a user into a registration code ciphertext M4, and splitting the registration code ciphertext into a first part M4-1 and a second part M4-2; combining a first part M1-1 of the first intermediate ciphertext and a second part M4-2 of the registration code ciphertext to generate a second intermediate ciphertext M2, generating a third intermediate ciphertext M3 through a first encryption algorithm, and splitting the third intermediate ciphertext into a first part M3-1 and a second part M3-2; when the first part M3-1 of the third intermediate ciphertext and the first part M4-1 of the registration code ciphertext are equal, determining that the registration code is valid, and saving the registration code R to a registry; and when the registration code is valid, obtaining an authorization information ciphertext P from the second part M4-2 of the registration code ciphertext and the second part M1-2 of the first intermediate ciphertext through a second encryption algorithm, and analyzing the authorization information ciphertext P to obtain the authorization information of the software product. According to the registration code generation process and the corresponding software registration process, the first encryption algorithm is an irreversible algorithm, preferably a Hash encryption algorithm, and the second encryption algorithm is a reversible algorithm, preferably an exclusive-or encryption algorithm. By verifying the right of use of the software for the first part of the registration code ciphertext, the use of illegally used software such as illegal copying of the software, reinstallation after the system is reinstalled and the like can be prevented, and the property right of the software is effectively protected; after the software use right is verified, the authorization information is obtained by analyzing the authorization information ciphertext, the software use rights such as software function module composition, use times, use days, use period and the like can be flexibly configured, the diversified requirements of users can be met, the defects that the existing registration code contains less information and has single function can be effectively overcome, the problems that the license file authorization process is too complicated and parameters are fixed are avoided, the input is convenient, and the control is flexible.
Embodiment 4 of the present invention also provides a registration code generating apparatus, and as shown in fig. 5, the registration code generating apparatus 100 includes:
a first intermediate ciphertext generation module 101, configured to generate a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
the authorization information generation module 102 is configured to generate an authorization information ciphertext according to a plurality of preset software use permissions;
and the registration code generating module 103 is configured to perform encryption operation according to the first intermediate ciphertext and the authorization information ciphertext to generate a registration code ciphertext.
And the registration code output module 104 is configured to output a character string sequence of the registration code according to the registration code ciphertext.
The registration code generation device 100 disclosed by the embodiment of the invention integrates the machine code and the software product code through the first intermediate cryptograph generation module 101 to generate a first intermediate cryptograph, generates the authorization information cryptograph through the authorization information generation module 102 according to a plurality of preset software use authorities, combines and encrypts the first intermediate cryptograph and the registration code generation module through the registration code generation module 103 to generate the registration code cryptograph, so that the registration code comprises three kinds of information of the machine code, the software product code and a plurality of software authorities, the software is prevented from being illegally copied and installed, the defects of less information and single function of the existing registration code can be effectively overcome, the problems of complicated authorization process and fixed parameters of using a license file are avoided, and the property right of the software can be flexibly controlled and protected.
Embodiment 5 of the present invention also provides a software registration apparatus 200, as shown in fig. 6, including:
a first intermediate ciphertext splitting module 201, configured to split a first intermediate ciphertext into a first part and a second part by using a first encryption algorithm based on a machine code and a software product password;
a registration code ciphertext splitting module 202, configured to receive a registration code input by a user, convert the registration code into a registration code ciphertext, and split the registration code ciphertext into a first part and a second part;
a third intermediate ciphertext splitting module 203, configured to combine the first portion of the first intermediate ciphertext and the second portion of the registration code ciphertext to generate a second intermediate ciphertext, generate a third intermediate ciphertext through a first encryption algorithm, and split the third intermediate ciphertext into the first portion and the second portion;
a registration code verification module 204, configured to determine that the registration code is valid when the first portion of the third intermediate ciphertext is equal to the first portion of the registration code ciphertext, and store the registration code ciphertext in a registry;
and the authorization information analysis module 205 is configured to, when the registration code is valid, obtain an authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm, and analyze the authorization information ciphertext to obtain authorization information of the software product.
The working process of the software registration apparatus 200 according to the embodiment of the present invention may refer to the detailed description of the software registration method in embodiment 3, which is not described herein again.
In summary, the invention discloses a method for generating registration code, a software registration method and a device for generating registration code, which generate a first intermediate cryptograph based on machine code and software product password through a first encryption algorithm, generate an authorization information cryptograph according to a plurality of preset software use authorities, and generate the registration code cryptograph by the first intermediate cryptograph and the authorization information cryptograph, thereby outputting a character string sequence of the registration code, so that the registration code comprises three information of the machine code, the software product password and a plurality of software authorities, wherein the machine code can prevent the situations of illegal software use, such as illegal copy installation of software, reinstallation of a reinstallation system, reinstallation after the expiration of a trial condition, and the like, and different software product passwords can protect a plurality of software products by using the same software registration protection method, moreover, different software use authorities are configured to flexibly control the functional module composition, the number of days of use, the number of times of use and the like of the software, and the diversified requirements of users are met, so that the defects that existing registration codes contain less information and are single in function can be effectively overcome, the problems that the license file authorization process is too complicated and parameters are fixed are avoided, the input is convenient, and the flexible control is realized.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (9)

1. A method for generating a registration code, comprising:
generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
generating an authorization information ciphertext according to a plurality of preset software use authorities;
after the first intermediate ciphertext and the authorization information ciphertext are subjected to encryption operation, a registration code ciphertext is generated;
outputting a character string sequence of the registration code according to the registration code ciphertext;
after the encryption operation is performed on the first intermediate ciphertext and the authorization information ciphertext, generating a registration code ciphertext specifically includes:
splitting the first intermediate ciphertext into a first part and a second part, and generating a temporary ciphertext by using the second part of the first intermediate ciphertext and the authorization information ciphertext through a second encryption algorithm;
combining the first part of the first intermediate ciphertext with the temporary ciphertext to generate a second intermediate ciphertext, and generating a third intermediate ciphertext through the first encryption algorithm;
and splitting the third intermediate ciphertext into a first part and a second part, and combining the first part of the third intermediate ciphertext and the temporary ciphertext to generate a registration code ciphertext.
2. The method for generating registration code according to claim 1, wherein the machine code is generated by performing Hash operation on the software product password and one or more of the following information: the serial number of a computer hard disk, the serial number of a computer CPU, the MAC address of a computer network card, the system time of first-time calculation of a machine code and the content of a software configuration file.
3. The method of generating a registration code of claim 1, wherein the first intermediate ciphertext and the machine code ciphertext are 16 bytes in length: and the lengths of the first part and the second part of the first intermediate ciphertext or the third intermediate ciphertext satisfy the following relation:
X+Y=16,X>0&Y>0
wherein, X is the number of bytes occupied by the first part of the first intermediate ciphertext or the first part of the third intermediate ciphertext, and Y is the number of bytes occupied by the second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext.
4. The registration code generation method of claim 1, wherein the second encryption algorithm is an exclusive-or encryption algorithm, a cyclic shift encryption algorithm, or a substitution encryption algorithm.
5. The registration code generation method of claim 1, wherein the first encryption algorithm is a Hash encryption algorithm.
6. The method for generating registration code according to claim 1, wherein the authorization information ciphertext comprises an information unit consisting of modules, an information unit for limiting times, an information unit for limiting days of software use, an information unit for limiting dates, an information unit for maximum connection number of client, an information unit for maximum number of simultaneous users, an information unit for maximum throughput, or an information unit for supporting maximum number of CPUs.
7. A software registration method, comprising the steps of:
dividing a machine code and a software product password into a first intermediate ciphertext through a first encryption algorithm, and dividing the first intermediate ciphertext into a first part and a second part;
receiving a registration code input by a user, converting the registration code into a registration code ciphertext, and splitting the registration code ciphertext into a first part and a second part;
combining the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, generating a third intermediate ciphertext through a first encryption algorithm, and splitting the third intermediate ciphertext into the first part and the second part;
when the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, determining that the registration code is valid, and storing the registration code ciphertext into a registry;
and when the registration code is valid, obtaining an authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm, and analyzing the authorization information ciphertext to obtain the authorization information of the software product.
8. A registration code generation apparatus, comprising:
the first intermediate ciphertext generating module is used for generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;
the authorization information generation module is used for generating an authorization information ciphertext according to a plurality of preset software use authorities:
the registration code generating module is used for generating a registration code ciphertext after performing encryption operation according to the first intermediate ciphertext and the authorization information ciphertext;
a register code output module for outputting the character string sequence of the register code according to the cipher text of the register code
After the encryption operation is performed on the first intermediate ciphertext and the authorization information ciphertext, generating a registration code ciphertext specifically includes:
splitting the first intermediate ciphertext into a first part and a second part, and generating a temporary ciphertext by using the second part of the first intermediate ciphertext and the authorization information ciphertext through a second encryption algorithm;
combining the first part of the first intermediate ciphertext with the temporary ciphertext to generate a second intermediate ciphertext, and generating a third intermediate ciphertext through the first encryption algorithm;
and splitting the third intermediate ciphertext into a first part and a second part, and combining the first part of the third intermediate ciphertext and the temporary ciphertext to generate a registration code ciphertext.
9. A software registration apparatus, comprising:
the first intermediate ciphertext splitting module is used for forming a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password, and splitting the first intermediate ciphertext into a first part and a second part;
the registration code ciphertext splitting module is used for receiving a registration code input by a user, converting the registration code into a registration code ciphertext and splitting the registration code ciphertext into a first part and a second part;
a third intermediate ciphertext splitting module, configured to combine the first portion of the first intermediate ciphertext and the second portion of the registration code ciphertext to generate a second intermediate ciphertext, generate a third intermediate ciphertext through a first encryption algorithm, and split the third intermediate ciphertext into the first portion and the second portion;
a registration code verification module, configured to determine that a registration code is valid when the first portion of the third intermediate ciphertext is equal to the first portion of the registration code ciphertext, and store the registration code ciphertext in a registry; and the authorization information analysis module is used for obtaining an authorization information ciphertext from the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through a second encryption algorithm when the registration code is valid, and analyzing the authorization information ciphertext to obtain the authorization information of the software product.
CN201710096734.8A 2017-02-22 2017-02-22 Registration code generation method and device and software registration method and device Active CN106919810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710096734.8A CN106919810B (en) 2017-02-22 2017-02-22 Registration code generation method and device and software registration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710096734.8A CN106919810B (en) 2017-02-22 2017-02-22 Registration code generation method and device and software registration method and device

Publications (2)

Publication Number Publication Date
CN106919810A CN106919810A (en) 2017-07-04
CN106919810B true CN106919810B (en) 2020-04-07

Family

ID=59454472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710096734.8A Active CN106919810B (en) 2017-02-22 2017-02-22 Registration code generation method and device and software registration method and device

Country Status (1)

Country Link
CN (1) CN106919810B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107563211A (en) * 2017-09-06 2018-01-09 荷花科技(北京)有限公司 Safe encryption method and system
CN110213306B (en) * 2018-02-28 2022-03-08 北京金风科创风电设备有限公司 Wind generating set starting control method and device
CN108548271B (en) * 2018-04-17 2020-04-21 奥克斯空调股份有限公司 Method and system for air conditioner monitoring and debugging software authorization
CN108897995A (en) * 2018-06-19 2018-11-27 河南正来电子科技有限公司 A kind of embedded software encrypting registration method of combination embedded device
CN109450618B (en) * 2019-01-11 2021-12-31 无锡华大国奇科技有限公司 MD 5-based encryption method and system
CN111859364A (en) * 2020-07-29 2020-10-30 杭州安恒信息技术股份有限公司 Authority authentication method, device, equipment and storage medium
CN115357869A (en) * 2022-10-19 2022-11-18 安徽华云安科技有限公司 Software activation method and device based on multipath configuration
CN116318982B (en) * 2023-03-10 2023-11-17 深圳市银拓科技有限公司 License-based method for activating software of product to be authorized and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1592190B (en) * 2003-08-29 2011-06-29 三星电子株式会社 Hardware cryptographic engine and encryption method
CN102314572A (en) * 2011-10-14 2012-01-11 迈普通信技术股份有限公司 Registration information file generation method and device, and use authorization method of application software
CN103093129A (en) * 2013-01-09 2013-05-08 上海大唐移动通信设备有限公司 Registration code generation method and device used for software licensing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595510B2 (en) * 2011-06-22 2013-11-26 Media Patents, S.L. Methods, apparatus and systems to improve security in computer systems

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1592190B (en) * 2003-08-29 2011-06-29 三星电子株式会社 Hardware cryptographic engine and encryption method
CN102314572A (en) * 2011-10-14 2012-01-11 迈普通信技术股份有限公司 Registration information file generation method and device, and use authorization method of application software
CN103093129A (en) * 2013-01-09 2013-05-08 上海大唐移动通信设备有限公司 Registration code generation method and device used for software licensing

Also Published As

Publication number Publication date
CN106919810A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
CN106919810B (en) Registration code generation method and device and software registration method and device
KR100188505B1 (en) Method and apparatus enabling software trial using an encryption header
KR100200444B1 (en) Method of distribute software object
US6961852B2 (en) System and method for authenticating software using hidden intermediate keys
KR100200443B1 (en) Method of distribution software object
TWI557589B (en) Secure software product identifier for product validation and activation
US7694153B2 (en) Changing product behavior in accordance with license
US20090077387A1 (en) Authenticating Software Using Protected Master Key
WO2021218331A1 (en) Offline software licensing method, apparatus and device, and storage medium
US8769675B2 (en) Clock roll forward detection
WO2020253469A1 (en) Hot update method and apparatus for script file package
US20120303967A1 (en) Digital rights management system and method for protecting digital content
US20070156788A1 (en) Protected data replication
CN112883361B (en) Function jump method and device of application program, computer equipment and storage medium
US11783094B2 (en) System and method for providing protected data storage in data memory
US10536276B2 (en) Associating identical fields encrypted with different keys
CN111404892B (en) Data supervision method and device and server
US7640438B2 (en) System and method for protected content rendering
KR101043255B1 (en) Usb hub device for providing datasecurity and method for providing datasecurity using the same
CN111104693A (en) Android platform software data cracking method, terminal device and storage medium
WO2019178981A1 (en) Password management method and device employing customized rules, terminal apparatus, and storage medium
CN111949996A (en) Generation method, encryption method, system, device and medium of security private key
CN114092488A (en) Image processing method, image processing device, electronic equipment and storage medium
JP4989806B2 (en) System and method for remote device registration
CN116933298B (en) Encryption processing method, device, storage medium and equipment for scientific and technological achievement data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant