[go: up one dir, main page]

CN106919810A - Registration code generating method and device, software registration method and device - Google Patents

Registration code generating method and device, software registration method and device Download PDF

Info

Publication number
CN106919810A
CN106919810A CN201710096734.8A CN201710096734A CN106919810A CN 106919810 A CN106919810 A CN 106919810A CN 201710096734 A CN201710096734 A CN 201710096734A CN 106919810 A CN106919810 A CN 106919810A
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.)
Granted
Application number
CN201710096734.8A
Other languages
Chinese (zh)
Other versions
CN106919810B (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.)
Guangdian Yuntong Group Co ltd
Original Assignee
Guangdian Yuntong Financial Electronic 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 Guangdian Yuntong Financial Electronic Co Ltd filed Critical Guangdian Yuntong Financial Electronic 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

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

本发明公开了一种注册码生成方法,通过使所述注册码包括机器码、软件产品密码和若干软件权限三种信息,其中机器码能防止软件被非法拷贝安装、重装系统重新安装、约定试用条件到期后重新安装等非法使用软件的情况,而不同的软件产品密码,使得软件开发商可以使用同样的软件注册保护方法对多种软件产品进行保护,再者,设置不同的软件的权限可以满足不同用户多样化的需求,控制灵活,因此本方案能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,方便用户输入,且在试用软件阶段切换到正式使用阶段只需更换注册码,无需重新安装,方便快捷。

The invention discloses a method for generating a registration code. By making the registration code include three kinds of information: a machine code, a software product password and several software permissions, the machine code can prevent the software from being illegally copied and installed, reinstalled by the system, and agreed upon. Illegal use of software such as reinstallation after the trial conditions expire, and different software product passwords enable software developers to use the same software registration protection method to protect multiple software products, and set different software permissions It can meet the diverse needs of different users, and the control is flexible. Therefore, this solution can effectively overcome the defects of the existing registration code that contains less information and single function, and avoids the problem of using the license file authorization process that is too cumbersome and the parameters are fixed, which is convenient for users to input , and switching from the trial software stage to the formal use stage only needs to change the registration code, no need to reinstall, which is convenient and fast.

Description

注册码生成方法及装置、软件注册方法及装置Registration code generation method and device, software registration method and device

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种注册码生成方法及装置、软件注册方法及装置。The invention relates to the field of computer technology, in particular to a registration code generation method and device, and a software registration method and device.

背景技术Background technique

软件开发商为了推广软件,常常提供软件给潜在客户试用,同时软件开发商为了保护自身的利益,会对对试用版本软件功能进行一定限制。通常的做法有三种,一是软件开发商提供裁减掉部分功能的试用版本软件给客户进行体验,客户正式购买后才提供正式版本全功能软件;二是软件开发商提供全功能但有使用期限的试用版软件给客户试用,试用到期后需购买并安装正式版本才能使;三是软件开发商提供全功能软件给客户试用,但是软件默认有一个使用期限,期限过后必须向软件开发商索取License(授权许可)文件或者输入注册码后软件才能正常使用。这三种方式中,裁减功能的软件会令用户试用体验不好,可能丢失潜在客户。又或者裁减功能的试用版软件即可满足客户要求,导致客户没有进一步购买动力,相当于提供了免费软件。全功能但有使用期限的试用软件,由于试用软件的程序文件与正式软件的程序文件不同,在购买后还需重新安装或升级软件,无法实现由试用到正式使用平滑过渡。In order to promote software, software developers often provide software to potential customers for trial use. At the same time, in order to protect their own interests, software developers will impose certain restrictions on the software functions of the trial version. There are three common methods. One is that software developers provide trial version software with some functions cut off for customers to experience, and the official version of full-featured software is provided only after customers formally purchase; Trial version software is for trial use by customers. After the trial period expires, the official version needs to be purchased and installed; third, the software developer provides full-featured software for trial use by customers, but the software has a default period of use. After the period expires, a license must be obtained from the software developer (Authorization license) file or the software can be used normally only after entering the registration code. Among these three methods, the software with reduced functions will make the user trial experience not good, and may lose potential customers. Or the trial version software with reduced functions can meet customer requirements, resulting in no further purchase motivation for customers, which is equivalent to providing free software. Full-featured trial software with a time limit, because the program files of the trial software are different from those of the official software, the software needs to be reinstalled or upgraded after purchase, which cannot achieve a smooth transition from trial to official use.

采用License文件授权的方式固然可以通过多组信息单元控制软件使用,但是License文件一般文件体积较大,内容也不利于人类阅读与记忆,很难通过电话、短信进行传递,也不适于批量使用,更不可能在像在类似ATM机一样应用的目标机上手工输入License文件内容。通常使用注册码的软件虽然方便输入,但由于注册码包含信息单元少,功能单一,只能通过识别注册码有效或者无效状态来决定软件是否可以继续使用。使用License文件或者注册码方式的有使用期限的试用版软件的试用时长固定,没法灵活控制,也可能存在客户试用到期后,通过重装系统后继续试用使用情况。The license file authorization method can certainly control the use of software through multiple sets of information units, but the license file is generally large in size, and the content is not conducive to human reading and memory. It is difficult to transfer by phone or text message, and it is not suitable for batch use. It is even more impossible to manually input the content of the License file on a target machine similar to an ATM machine. Although the software that usually uses the registration code is convenient to input, because the registration code contains few information units and has a single function, it can only be determined whether the software can continue to be used by identifying the valid or invalid state of the registration code. The trial period of trial version software with a period of use using license files or registration codes is fixed and cannot be flexibly controlled. There may also be cases where customers continue to use the trial version after reinstalling the system after the trial period expires.

因此,需要一种既方便输入、又能灵活控制软件使用权限的方法,能满足用户需求和有效保护软件产权。Therefore, there is a need for a method that is convenient for input and can flexibly control software usage rights, which can meet user needs and effectively protect software property rights.

发明内容Contents of the invention

本发明实施例的目的是提供一种注册码生成方法及装置、软件注册方法及装置,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。The purpose of the embodiments of the present invention is to provide a registration code generation method and device, and a software registration method and device, which can effectively overcome the defects of existing registration codes containing less information and single functions, and avoid the cumbersome and cumbersome authorization process of using license files. The problem of fixed parameters can not only facilitate input, but also allow flexible control.

为实现上述目的,本发明实施例提供了一种注册码生成方法,包括步骤:In order to achieve the above purpose, the embodiment of the present invention provides a method for generating a registration code, including steps:

基于机器码和软件产品密码通过第一加密算法生成第一中间密文;generating a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;

根据预设的若干软件使用权限,生成授权信息密文;Generate authorization information ciphertext according to several preset software usage rights;

根据所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文;After performing an encryption operation according to the first intermediate ciphertext and the authorization information ciphertext, generate a registration code ciphertext;

根据所述注册码密文,输出注册码的字符串序列。According to the ciphertext of the registration code, a character string sequence of the registration code is output.

与现有技术相比,本发明公开的注册码生成方法先通过对基于机器码和软件产品密码通过第一加密算法生成第一中间密文,再根据预设的若干软件使用权限,生成授权信息密文,然后将所述第一中间密文和授权信息密文生成注册码密文,从而输出注册码的字符串序列,使得所述注册码包括机器码、软件产品密码和若干软件权限三种信息,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,可灵活控制又能保护软件的产权。Compared with the prior art, the registration code generation method disclosed in the present invention first generates the first intermediate ciphertext through the first encryption algorithm based on the machine code and the software product password, and then generates the authorization information according to several preset software usage rights ciphertext, and then generate the registration code ciphertext from the first intermediate ciphertext and authorization information ciphertext, so as to output the string sequence of the registration code, so that the registration code includes three types: machine code, software product password and several software permissions Information can effectively overcome the shortcomings of existing registration codes that contain less information and single functions, and avoid the problem of cumbersome authorization process and fixed parameters using license files. It can be flexibly controlled and protect software property rights.

作为上述方案的改进,所述机器码通过对软件产品密码和以下一种或几种信息进行Hash运算后生成:计算机硬盘编号、计算机CPU编号、计算机网卡MAC地址、第一次计算机器码的系统时间、软件配置文件内容。通过对软件产品密码和计算机硬件信息生成机器码,可以防止软件的非法拷贝。且使用软件配置文件内容作为机器码计算输入可以限制用户不能修改关键配置,有利于保护软件的产权。As an improvement of the above scheme, the machine code is generated by performing Hash operation on the software product password and one or more of the following information: computer hard disk serial number, computer CPU serial number, computer network card MAC address, system for calculating the machine code for the first time Time, software configuration file content. By generating machine codes for software product passwords and computer hardware information, illegal copying of software can be prevented. Moreover, using the content of the software configuration file as the input of the machine code calculation can restrict the user from modifying the key configuration, which is conducive to protecting the property rights of the software.

作为上述方案的改进,所述将所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文具体包括步骤:As an improvement of the above solution, after the encryption operation of the first intermediate ciphertext and the authorization information ciphertext, the generation of the registration code ciphertext specifically includes steps:

将所述第一中间密文拆分为第一部分和第二部分后,将所述第一中间密文的第二部分与所述授权信息密文通过第二加密算法生成临时密文;After splitting the first intermediate ciphertext into a first part and a second part, the second part of the first intermediate ciphertext and the authorization information ciphertext are generated through a second encryption algorithm to generate a temporary ciphertext;

将所述第一中间密文的第一部分和所述临时密文进行组合后生成第二中间密文,并通过所述第一加密算法生成第三中间密文;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;

将所述第三中间密文拆分为第一部分和第二部分后,将所述第三中间密文的第一部分和所述临时密文进行组合生成注册码密文。After the third intermediate ciphertext is split into a first part and a second part, the first part of the third intermediate ciphertext and the temporary ciphertext are combined to generate a registration code ciphertext.

通过多次的组合和加密运算,既保证注册码包括软件产品密码、机器码和若干软件使用权限三者的信息,又保证了注册码的不可重复性。Through multiple combinations and encryption operations, it not only ensures that the registration code includes the information of software product password, machine code and some software usage rights, but also ensures the non-repeatability of the registration code.

作为上述方案的改进,所述第一中间密文和机器码密文的长度为16个字节;且所述第一中间密文或第三中间密文的第一部分和第二部分的长度满足以下关系: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 relationship:

X+Y=16,X>0&Y>0X+Y=16, X>0&Y>0

其中,所述X为第一中间密文的第一部分或第三中间密文的第一部分所占的字节数,Y为第一中间密文的第二部分或第三中间密文的第二部分所占的字节数。所述第一部分所占的字节数小于第二部分所占的字节数,可以保证所述注册密文有足够的存储空间以包括所需的软件使用权限。Wherein, the 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 second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext. The number of bytes occupied by the section. The number of bytes occupied by the first part is smaller than the number of bytes occupied by the second part, which can ensure that the registration ciphertext has enough storage space to include the required software usage rights.

作为上述方案的改进,所述第二加密算法为异或加密算法、循环移位加密算法或代换加密算法。且通过设置不同的长度组成,可以使该方法适用于不同的软件使用授权设置。As an improvement of the above solution, the second encryption algorithm is an XOR encryption algorithm, a cyclic shift encryption algorithm or a substitution encryption algorithm. And by setting different length components, the method can be applied to different software authorization settings.

作为上述方案的改进,所述第一加密算法为Hash加密算法。Hash加密算法能保证信息的完整性和紧凑型。As an improvement to the above solution, the first encryption algorithm is a Hash encryption algorithm. Hash encryption algorithm can ensure the integrity and compactness of information.

作为上述方案的改进,所述授权信息密文包括模块组成的信息单元、限制次数的信息单元、软件使用的限制天数的信息单元、限制日期的信息单元、客户端最大连接数的信息单元、最大同时使用用户数量的信息单元、最大吞吐量的信息单元或支持CPU最大个数的信息单元。通过设置多种的软件使用权限,可使得所述授权信息密文包括多种软件使用权限信息,使得软件使用更加灵活,满足用户多样化的需求。As an improvement of the above solution, the authorization information ciphertext includes information units composed of modules, information units with limited times, information units with limited days of software use, information units with limited dates, information units with the maximum number of client connections, maximum Simultaneously use information units for the number of users, information units for maximum throughput, or information units for supporting the maximum number of CPUs. By setting a variety of software usage rights, the authorization information ciphertext can include a variety of software usage rights information, so that the software can be used more flexibly and meet the diverse needs of users.

本发明实施例还对应提供了一种软件注册方法,包括步骤:The embodiment of the present invention also provides a corresponding software registration method, including steps:

基于机器码和软件产品密码通过第一加密算法成第一中间密文,将所述第一中间密文拆分为第一部分和第二部分;Based on the machine code and the software product password, a first intermediate ciphertext is generated through a first encryption algorithm, and the first intermediate ciphertext is split into a first part and a second part;

接收用户输入的注册码并转换成注册码密文,将所述注册码密文拆分为第一部分和第二部分;Receive the registration code input by the user and convert it into a registration code ciphertext, and split the registration code ciphertext into a first part and a second part;

将所述第一中间密文的第一部分和所述注册码密文的第二部分进行组合生成第二中间密文,并通过第一加密算法生成第三中间密文,将所述第三中间密文拆分为第一部分和第二部分;combining the first part of the first intermediate ciphertext with the second part of the registration code ciphertext to generate a second intermediate ciphertext, and generating a third intermediate ciphertext through a first encryption algorithm, and converting the third intermediate ciphertext to The ciphertext is split 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, it is determined that the registration code is valid, and the registration code ciphertext is saved to the registry;

当所述注册码有效时,将注册码密文的第二部分和第一中间密文的第二部分通过第二加密算法获得授权信息密文,解析所述授权信息密文获得软件产品的授权信息。When the registration code is valid, pass the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through the second encryption algorithm to obtain the authorization information ciphertext, and analyze the authorization information ciphertext to obtain the authorization of the software product information.

本发明实施例公开的一种软件注册方法,首先将机器码和软件产品密码进行加密运算后与所述注册码密文进行拆分、重新组合和加密运算后得到第三中间密文,若所述第三中间密文的第一部分和所述注册码密文的第一部分相同,确定注册码有效;若注册码有效,将所述第三中间密文的第二部分和所述注册码密文的第二部分进行加密运算后生成授权信息密文,解析所述授权信息密文即可获得授权信息。通过对所述注册码密文的第一部分进行验证软件的使用权,可防止软件的非法拷贝、重装系统后重新安装等非法使用软件的使用,有效保护了软件的产权;通过软件使用权的验证后,通过解析所述授权信息密文获得授权信息,可灵活配置软件功能模块组成、使用次数、使用天数、使用期限等软件使用权限,可满足用户多样化的需求,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。In the software registration method disclosed in the embodiment of the present invention, first, the machine code and the software product password are encrypted and then split, reassembled and encrypted with the ciphertext of the registration code to obtain the third intermediate ciphertext. The first part of the third intermediate ciphertext is the same as the first part of the registration code ciphertext, and the registration code is determined to be valid; if the registration code is valid, the second part of the third intermediate ciphertext and the registration code ciphertext The second part of is encrypted to generate the authorization information ciphertext, and the authorization information can be obtained by analyzing the authorization information ciphertext. By verifying the right to use the software on the first part of the ciphertext of the registration code, illegal use of software such as illegal copying of the software, reinstallation after reinstalling the system, etc. can be prevented, and the property rights of the software are effectively protected; After verification, the authorization information is obtained by analyzing the ciphertext of the authorization information, and the software usage rights such as the composition of software function modules, the number of times of use, the number of days of use, and the period of use can be flexibly configured, which can meet the diverse needs of users and effectively overcome the existing registration requirements. The code contains the defects of less information and single function, and avoids the problem of too cumbersome and fixed parameters in the authorization process of using the license file, which can not only facilitate input, but also allow flexible control.

本发明实施例还对应提供了一种注册码生成装置,包括:The embodiment of the present invention also provides a device for generating a registration code correspondingly, including:

第一中间密文生成模块,用于基于机器码和软件产品密码通过第一加密算法生成第一中间密文;The first intermediate ciphertext generating module is used to generate the first intermediate ciphertext through the first encryption algorithm based on the machine code and the software product password;

授权信息生成模块,用于预设的若干软件使用权限,生成授权信息密文;The authorization information generation module is used to generate authorization information ciphertext for a number of preset software usage rights;

注册码生成模块,用于根据所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文。The registration code generating module is configured to generate a registration code ciphertext after performing an encryption operation according to the first intermediate ciphertext and the authorization information ciphertext.

注册码输出模块,用于根据注册码密文,输出注册码的字符串序列。The registration code output module is configured to output the character string sequence of the registration code according to the registration code ciphertext.

本发明实施例公开的一种注册码生成装置,通过第一中间密文生成模块整合机器码和软件产品密码生成第一中间密文,再根据预设的若干软件使用权限通过授权信息生成模块生成授权信息密文,将所述第一中间密文和注册码生成模块进行组合和加密运算后生成注册码密文,使得所述注册码包括机器码、软件产品密码和若干软件权限三种信息,避免软件被非法拷贝安装,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,可灵活控制又能保护软件的产权。A registration code generation device disclosed in an embodiment of the present invention uses a first intermediate ciphertext generation module to integrate a machine code and a software product password to generate a first intermediate ciphertext, and then generates the first intermediate ciphertext through an authorization information generation module according to a number of preset software usage rights Authorization information ciphertext, the first intermediate ciphertext and the registration code generation module are combined and encrypted to generate the registration code ciphertext, so that the registration code includes three kinds of information: machine code, software product password and several software permissions, Avoiding illegal copying and installation of software can effectively overcome the shortcomings of existing registration codes that contain little information and single functions, and avoid the problem of cumbersome authorization process and fixed parameters using license files. It can be flexibly controlled and protect software property rights.

本发明实施例还对应提供了一种软件注册装置,包括:The embodiment of the present invention also provides a corresponding software registration device, including:

第一中间密文拆分模块,用于基于机器码和软件产品密码通过第一加密算法成第一中间密文,将所述第一中间密文拆分为第一部分和第二部分;The first intermediate ciphertext splitting module is used to generate the first intermediate ciphertext through the first encryption algorithm based on the machine code and the software product password, and split the first intermediate ciphertext into the first part and the second part;

注册码密文拆分模块,用于接收用户输入的注册码并转换成注册码密文,将所述注册码密文拆分为第一部分和第二部分;The registration code ciphertext splitting module is used to receive the registration code input by the user and convert it into a registration code ciphertext, and split the registration code ciphertext into a first part and a second part;

第三中间密文拆分模块,用于将所述第一中间密文的第一部分和所述注册码密文的第二部分进行组合生成第二中间密文,并通过第一加密算法生成第三中间密文,将所述第三中间密文拆分为第一部分和第二部分;The third intermediate ciphertext splitting module is used to combine the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, and generate the second intermediate ciphertext through the first encryption algorithm Three intermediate ciphertexts, splitting the third intermediate ciphertext into a first part and a second part;

注册码验证模块,用于当所述第三中间密文的第一部分与所述注册码密文的第一部分相等时,则确定注册码有效,并将所述注册码密文保存至注册表;A registration code verification module, configured to determine that the registration code is valid when the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, and save the registration code ciphertext to the registry;

授权信息解析模块,用于当所述注册码有效时,将注册码密文的第二部分和第一中间密文的第二部分通过第二加密算法获得授权信息密文,解析所述授权信息密文获得软件产品的授权信息。An authorization information parsing module, configured to use the second part of the registration code ciphertext and the second part of the first intermediate ciphertext to obtain the authorization information ciphertext through a second encryption algorithm when the registration code is valid, and analyze the authorization information The ciphertext obtains the authorization information of the software product.

本发明实施例公开的一种软件注册装置,首先将机器码和软件产品密码进行加密运算后与所述注册码密文进行拆分、重新组合和加密运算后得到第三中间密文,若所述第三中间密文的第一部分和所述注册码密文的第一部分相同,确定注册码有效;若注册码有效,通过授权信息解析模块将所述第三中间密文的第二部分和所述注册码密文的第二部分进行加密运算后生成授权信息密文,解析所述授权信息密文即可获得授权信息。通过对所述注册码密文的第一部分进行验证软件的使用权,可防止软件的非法拷贝、重装系统后重新安装等非法使用软件的使用,有效保护了软件的产权;通过软件使用权的验证后,通过解析所述授权信息密文获得授权信息,可灵活配置软件功能模块组成、使用次数、使用天数、使用期限等软件使用权限,可满足用户多样化的需求,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。In the software registration device disclosed in the embodiment of the present invention, first, the machine code and the software product password are encrypted and then split, reassembled and encrypted with the ciphertext of the registration code to obtain the third intermediate ciphertext. The first part of the third intermediate ciphertext is the same as the first part of the registration code ciphertext, and it is determined that the registration code is valid; if the registration code is valid, the second part of the third intermediate ciphertext and the first part of the registration code are combined by the authorization information analysis module The second part of the ciphertext of the registration code is encrypted to generate the ciphertext of the authorization information, and the authorization information can be obtained by analyzing the ciphertext of the authorization information. By verifying the right to use the software on the first part of the ciphertext of the registration code, illegal use of software such as illegal copying of the software, reinstallation after reinstalling the system, etc. can be prevented, and the property rights of the software are effectively protected; After verification, the authorization information is obtained by analyzing the ciphertext of the authorization information, and the software usage rights such as the composition of software function modules, the number of times of use, the number of days of use, and the period of use can be flexibly configured, which can meet the diverse needs of users and effectively overcome the existing registration requirements. The code contains the defects of less information and single function, and avoids the problem of too cumbersome and fixed parameters in the authorization process of using the license file, which can not only facilitate input, but also allow flexible control.

附图说明Description of drawings

图1是本发明实施例1中一种注册码生成方法的流程示意图。FIG. 1 is a schematic flowchart of a method for generating a registration code in Embodiment 1 of the present invention.

图2是本发明实施例2中一种注册码生成方法的流程示意图。Fig. 2 is a schematic flowchart of a method for generating a registration code in Embodiment 2 of the present invention.

图3是本发明实施例2中注册码生成的过程示意图。Fig. 3 is a schematic diagram of the registration code generation process in Embodiment 2 of the present invention.

图4是本发明实施例3中一种软件注册方法的流程示意图。FIG. 4 is a schematic flowchart of a software registration method in Embodiment 3 of the present invention.

图5是本发明实施例4中一种注册码生成装置的结构示意图。Fig. 5 is a schematic structural diagram of a registration code generation device in Embodiment 4 of the present invention.

图6是本发明实施例5中一种软件注册装置的结构示意图。Fig. 6 is a schematic structural diagram of a software registration device in Embodiment 5 of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

参见图1,是本发明实施例1提供的一种注册码生成方法的流程示意图。如图1所示的注册码生成方法包括步骤:Referring to FIG. 1 , it is a schematic flowchart of a method for generating a registration code provided by Embodiment 1 of the present invention. The method for generating the registration code as shown in Figure 1 includes steps:

S11、基于机器码和软件产品密码通过第一加密算法生成第一中间密文;S11. Generate a first intermediate ciphertext through a first encryption algorithm based on the machine code and the software product password;

S12、根据预设的若干软件使用权限,生成授权信息密文;S12. Generate authorization information ciphertext according to several preset software usage rights;

S13、将所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文;S13. After encrypting the first intermediate ciphertext and the authorization information ciphertext, generate a registration code ciphertext;

S14、根据所述注册码密文,输出注册码的字符串序列。S14. Output a character string sequence of the registration code according to the registration code ciphertext.

具体实施时,所述软件产品密码为软件开发商对不同版本的软件设置的产品密码,为开发商私有,不对外开放。先对机器码和软件产品密码进行加密运算可得到第一中间密文,所述第一中间密文包括机器码和软件产品密码两者的信息;接着,根据预设的若干软件使用权限,生成授权信息密文,所述若干软件使用权限可在软件开发设计阶段由软件开发商针对不同的客户群体进行设置,也可在软件销售使用阶段和正式使用阶段由用户设置;然后,将将所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文,再根据注册码密文输出注册码的字符串序列。通过以上过程,可在注册码密文中整合软件产品密码、机器码和软件使用权限三者的信息,其中,所述机器码和软件产品密码用于软件使用时对软件使用权的验证,而配置不同的软件使用权限可灵活控制软件的功能模块组成、使用天数、使用次数等,满足用户多样化的需求,因此本方案能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。During specific implementation, the software product password is the product password set by the software developer for different versions of the software, which is privately owned by the developer and not open to the outside world. First, the first intermediate ciphertext is obtained by encrypting the machine code and the software product password, and the first intermediate ciphertext includes the information of both the machine code and the software product password; then, according to several preset software usage rights, generate Authorization information ciphertext, said several software usage rights can be set by software developers for different customer groups in the software development and design stage, and can also be set by users in the software sales and use stage and formal use stage; then, the said After the first intermediate ciphertext and the authorization information ciphertext are encrypted, a registration code ciphertext is generated, and a string sequence of the registration code is output according to the registration code ciphertext. Through the above process, the information of the software product password, the machine code and the software use right can be integrated in the registration code ciphertext, wherein the machine code and the software product password are used to verify the software use right when the software is used, and the configuration Different software usage rights can flexibly control the composition of functional modules, days of use, and times of use of the software to meet the diverse needs of users. Therefore, this solution can effectively overcome the shortcomings of existing registration codes that contain less information and single functions, and avoid The authorization process using license files is too cumbersome and the parameters are fixed, which can not only facilitate input, but also allow flexible control.

优选地,所述机器码通过对软件产品密码和以下一种或几种信息进行Hash运算后生成:计算机硬盘编号、计算机CPU编号、计算机网卡MAC地址、第一次计算机器码的系统时间、软件配置文件内容。其中,硬盘编号、CPU编号、网卡MAC地址,可以通过操作系统API函数直接读取,这三组数据的使用可以使得每一台物理机机器码将会不同,也就限制了同一注册码在多台机器上同时使用可能。比如某一计算机硬盘编号为HDS722525VLAT80,MAC地址为50-7B-9D-C1-A6-96,这些数据一般都具唯一性,因此不同计算机对应的机器码也不同,因此同一注册码只能识别唯一一台机器,不能拷贝到其他机器上使用。另一方面,使用第一次计算机器码的系统时间来生成机器码,可以防止系统重装后重新安装软件的漏洞。因为,第一次计算机器码的系统时间,在特定操作系统安装实例上,执行第一次计算机器码操作后将当前系统时间以毫秒为粒度的数值写入注册表,当再下一次再需要计算机器码时,将读取并使用注册表记录的时间值,这就保证了每次计算机器码结果一致,但是重装系统后由于很难保证第一次获取机器码的时间毫秒值相同,所以机器码一定是变化的,机器码的变化会使当前注册码失效。再者,软件配置内容作为机器码计算输入可以限制用户用户不能自已修改关键配置,如有些软件在会在窗口标题上显示使用的客户公司名称,如果使用客户公司名称的内容作为计算机器码的参数,在用户自行软件修改显示公司名称后机器码会变化,机器码的变化会使当前注册码失效。因此,通过软件配置内容生成机器码,再通过机器码生成注册码,可以防止软件的非法拷贝和盗版使用。以上6项内容,软件产品密码为计算机器码的输入项,其他项在计算机器码时不必要全部使用,可以根据软件功能限制策略中任选其中一项或几项的组合使用。对于不同的软件配置不同的软件密码,有利于对多软件产品注册码使用同一的后台软件进行管理,也可以实现不同软件产品的注册码不能通用。Preferably, the machine code is generated by hashing the software product password and one or more of the following information: computer hard disk number, computer CPU number, computer network card MAC address, system time of the first computer code, software Configuration file content. Among them, the hard disk number, CPU number, and MAC address of the network card can be directly read through the API function of the operating system. The use of these three sets of data can make the machine code of each physical machine different, which also limits the number of registration codes for the same registration code. Simultaneous use possible on two machines. For example, the hard disk number of a certain computer is HDS722525VLAT80, and the MAC address is 50-7B-9D-C1-A6-96. These data are generally unique, so the machine codes corresponding to different computers are also different, so the same registration code can only identify unique One machine cannot be copied to other machines for use. On the other hand, using the system time of calculating the machine code for the first time to generate the machine code can prevent the loophole of reinstalling the software after the system is reinstalled. Because, the system time of the first computer code calculation, on a specific operating system installation instance, after the first computer code operation is performed, the current system time is written into the registry with the granularity of milliseconds, and when it is needed next time When calculating the machine code, the time value recorded in the registry will be read and used, which ensures that the result of calculating the machine code is consistent every time. However, after reinstalling the system, it is difficult to ensure that the millisecond value of the time to obtain the machine code for the first time is the same. Therefore, the machine code must change, and the change of the machine code will invalidate the current registration code. Furthermore, the software configuration content can be used as machine code calculation input to restrict users from modifying key configurations by themselves. For example, some software will display the name of the customer company used on the window title. If the content of the customer company name is used as the parameter for calculating the machine code , after the user modifies the software to display the company name, the machine code will change, and the change of the machine code will invalidate the current registration code. Therefore, generating a machine code through software configuration content, and then generating a registration code through the machine code can prevent illegal copying and pirated use of software. For the above 6 items, the software product password is an input item for calculating the machine code. It is not necessary to use all other items when calculating the machine code. You can choose one or a combination of several items according to the software function restriction policy. For different software, different software passwords are configured, which is beneficial to use the same background software to manage the registration codes of multiple software products, and can also realize that the registration codes of different software products cannot be used in common.

因此,机器码用于在有限范围唯一识别一个软件安装环境,可在用户使用的计算机上自动生成,用户可在软件界面上直接查看机器码。优选地,为方便输入的考虑,机器码为全数字而且长度限制在10个字符,所述10个字符可为0-9的一串数字表示。所述机器码在大范围内可能会重复,但在有限范围内极少量的重复不会对销售和使用产生影响。Therefore, the machine code is used to uniquely identify a software installation environment within a limited range, and can be automatically generated on the computer used by the user, and the user can directly view the machine code on the software interface. Preferably, for the convenience of input, the machine code is all numbers and the length is limited to 10 characters, and the 10 characters can be represented by a string of numbers from 0-9. The machine code may be repeated in a large range, but a very small amount of repetition in a limited range will not affect sales and use.

参见图2,是本发明实施例2提供的一种注册码生成方法的流程示意图。如图2所示的注册码生成方法在实施例1的基础上,所述步骤S13具体包括步骤:Referring to FIG. 2 , it is a schematic flowchart of a method for generating a registration code provided by Embodiment 2 of the present invention. The registration code generating method as shown in Figure 2 is based on Embodiment 1, and the step S13 specifically includes steps:

S131、将所述第一中间密文拆分为第一部分和第二部分后,将所述第一中间密文的第二部分与所述授权信息密文通过第二加密算法生成临时密文;S131. After splitting the first intermediate ciphertext into a first part and a second part, generate a temporary ciphertext by using a second encryption algorithm with the second part of the first intermediate ciphertext and the authorization information ciphertext;

S132、将所述第一中间密文的第一部分和所述临时密文进行组合后生成第二中间密文,并通过所述第一加密算法生成第三中间密文;S132. Combine the first part of the first intermediate ciphertext and the temporary ciphertext to generate a second intermediate ciphertext, and use the first encryption algorithm to generate a third intermediate ciphertext;

S133、将所述第三中间密文拆分为第一部分和第二部分后,将所述第三中间密文的第一部分和所述临时密文进行组合生成注册码密文。S133. After splitting the third intermediate ciphertext into a first part and a second part, combine the first part of the third intermediate ciphertext with the temporary ciphertext to generate a registration code ciphertext.

结合图3,下面将对本发明实施例的工作过程进行具体描述。具体实施时,先接收用户提供的机器码S,将所述机器码S和软件产品密码K作为输入,通过第一加密算法生成第一中间密文M1,将第一中间密文拆分为第一部分M1-1和第二部分M1-2;根据预设的若干软件使用权限,生成授权信息密文P;将所述第一中间密文的第二部分M1-2和所述授权信息密文P通过第二加密算法生成临时密文R1;接着,将所述第一中间密文的第一部分M1-1和所述临时密文R1进行组合后生成第二中间密文M2,并通过第一加密算法生成第三中间密文M3;然后,将所述第三中间密文M3拆分成第一部分M3-1和第二部分M3-2,将所述第三中间密文的第一部分M3-1和临时密文R1进行组合后生成注册码密文M4;最后,根据所述注册码密文M4输出注册码的字符串序列R。在上述过程中,可通过所述第一加密算法进行多个轮次的加密运算,有利于注册码的不可重复性,增加了注册码的破解难度,保护了软件的产权。通过上述过程,使得所述注册码包括机器码、软件产品密码和若干软件权限三种信息,其中机器码能防止软件被非法拷贝安装、重装系统重新安装、约定试用条件到期后重新安装等非法使用软件的情况,而不同的软件产品密码,使得软件开发商可以使用同样的软件注册保护方法对多种软件产品进行保护,再者,设置不同的软件的权限可以满足不同用户多样化的需求,控制灵活,因此本方案能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,方便用户输入,且在试用软件阶段切换到正式使用阶段只需更换注册码,无需重新安装。With reference to FIG. 3 , the working process of the embodiment of the present invention will be described in detail below. During specific implementation, first receive the machine code S provided by the user, use the machine code S and the software product password K as input, generate the first intermediate ciphertext M1 through the first encryption algorithm, and split the first intermediate ciphertext into the first intermediate ciphertext A part M1-1 and a second part M1-2; generate authorization information ciphertext P according to a number of preset software usage rights; combine the second part M1-2 of the first intermediate ciphertext and the authorization information P generates the temporary ciphertext R1 through the second encryption algorithm; then, the first part M1-1 of the first intermediate ciphertext and the temporary ciphertext R1 are combined to generate the second intermediate ciphertext M2, and pass the first The encryption algorithm generates a third intermediate ciphertext M3; 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-2 of the third intermediate ciphertext is 1 and the temporary ciphertext R1 are combined to generate a registration code ciphertext M4; finally, a character string sequence R of the registration code is output according to the registration code ciphertext M4. In the above process, multiple rounds of encryption operations can be performed by the first encryption algorithm, which is beneficial to the non-repeatability of the registration code, increases the difficulty of deciphering the registration code, and protects the property rights of the software. Through the above process, the registration code includes three kinds of information: machine code, software product password and several software permissions, wherein the machine code can prevent the software from being illegally copied and installed, reinstalling the system and reinstalling, reinstalling after the agreed trial conditions expire, etc. Illegal use of software, and different software product passwords enable software developers to use the same software registration protection method to protect multiple software products. Furthermore, setting different software permissions can meet the diverse needs of different users , the control is flexible, so this solution can effectively overcome the defects that the existing registration code contains less information and single function, and avoids the problem that the license file authorization process is too cumbersome and the parameters are fixed, it is convenient for users to input, and it is switched to during the trial software stage In the official use stage, only the registration code needs to be replaced, and no reinstallation is required.

优选地,所述授权信息密文包括模块组成的信息单元、限制次数的信息单元、软件使用的限制天数的信息单元、限制日期的信息单元、客户端最大连接数的信息单元、最大同时使用用户数量的信息单元、最大吞吐量的信息单元或支持CPU最大个数的信息单元。所述授权信息密文包含多种软件使用权限的信息,其中所述授权信息密文可包括模块标识、两个计数器初值以及时间限制。其中,一个计数器用于次数计数,另一个计数器用于天数计数。所述次数计数可以为客户端最大连接数计数、最大同时使用用户数量计数、最大吞吐量计数或支持CPU最大个数计数,可根据用户的不同的需求进行设置。对应的,软件开启时,或软件运行时的一定周期内,会对软件进行检查授权,检查项有是否注册、使用天数、使用期限是否已达到、指定模块是否可用等。Preferably, the authorization information ciphertext includes information units composed of modules, information units of limited times, information units of limited days of software use, information units of limited dates, information units of the maximum number of client connections, maximum simultaneous users The number of information units, the information unit with the maximum throughput, or the information unit that supports the maximum number of CPUs. The authorization information ciphertext includes information on various software usage rights, wherein the authorization information ciphertext may include a module identifier, two initial values of counters and a time limit. Among them, one counter is used for counting the number of times, and the other counter is used for counting the number of days. The number of counts can be the count of the maximum number of client connections, the maximum number of simultaneous users, the maximum throughput, or the maximum number of supported CPUs, which can be set according to different needs of users. Correspondingly, when the software is started, or within a certain period of time when the software is running, the software will be checked and authorized, and the check items include whether it is registered, the number of days of use, whether the use period has been reached, whether the specified module is available, etc.

优选地,可将所述第一中间密文和机器码密文的长度设置为16个字节;且所述第一中间密文或第三中间密文的第一部分和第二部分的长度满足以下关系:Preferably, the length of the first intermediate ciphertext and the machine code ciphertext can 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 relationship:

X+Y=16,X>0&Y>0X+Y=16, X>0&Y>0

其中,所述X为第一中间密文的第一部分或第三中间密文的第一部分所占的字节数,Y为第一中间密文的第二部分或第三中间密文的第二部分所占的字节数。字节数,Y为第一中间密文的第二部分或第三中间密文的第二部分所占的字节数。在实际应用中,所述第一部分所占的字节数X小于第二部分所占的字节数Y,可以保证所述注册密文有足够的存储空间以包括所需的软件使用权限(通常Y≥8)。由上述过程可知,注册码密文占16个字节,也就是128位,采用十六进制,通过ASCII(American Standard Code for InformationInterchange,美国信息交换标准代码)码表,可将128位转化成32个字符,根据注册码组成的习惯,也为了更方便输入和传递,所述述注册码由0-9、A-F的字符组成。Wherein, the 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 second part of the first intermediate ciphertext or the second part of the third intermediate ciphertext. The number of bytes occupied by the section. The number of bytes, 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 applications, the number of bytes X occupied by the first part is smaller than the number of bytes Y occupied by the second part, which can ensure that the registration ciphertext has enough storage space to include the required software usage rights (usually Y≥8). It can be seen from the above process that the ciphertext of the registration code occupies 16 bytes, that is, 128 bits. Using hexadecimal, 128 bits can be converted into 32 characters, according to the habit of registration code composition, and for more convenient input and transmission, the registration code is composed of characters 0-9, A-F.

进一步地,所述第一算法为Hash算法。Hash算法将任意长度的二进制值映射为较短的固定长度的二进制值,这个小的二进制值称为Hash值。Hash值是一段数据唯一且极其紧凑的数值表示形式。如果输入数据中有变化,则Hash值也会发生变化。其中,比较常用的Hash算法为MD5和SHA。Further, the first algorithm is a Hash algorithm. The Hash algorithm maps a binary value of any length to a shorter fixed-length binary value, and this small binary value is called a Hash value. Hash value is a unique and extremely compact numerical 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 XOR encryption algorithm, a cyclic shift encryption algorithm or a substitution encryption algorithm, and these algorithms can be illustrated by the following formula:

如明文T,密钥K;异或加密算法为E=T xor K;循环移位算法为E=T循环左移K(或循环右移);代换加密算法为E=Table[K+T mod L],L为代换表Table的大小。其中,循环移位在高级语言中实现不方便,代换加密需要构建代换的变换表,所以第二加密算法可优选为异或加密算法。Such as plaintext T, key K; XOR encryption algorithm is E=T xor K; cyclic shift algorithm is E=T cyclic left shift K (or cyclic right shift); substitution encryption algorithm is E=Table[K+T mod L], L is the size of the table. Among them, the cyclic shift is inconvenient to implement in a high-level language, and the substitution encryption needs to construct a substitution transformation table, so the second encryption algorithm can preferably be an XOR encryption algorithm.

根据以上所述的注册码生成方法,本发明实施例3还对应提供了一种软件注册方法(即授权方法,基本是上述注册码生成方法的逆运算),如图4所示,包括步骤:According to the registration code generation method described above, Embodiment 3 of the present invention also provides a corresponding software registration method (that is, an authorization method, which is basically the inverse operation of the above registration code generation method), as shown in Figure 4, including steps:

S31、基于机器码和软件产品密码通过第一加密算法成第一中间密文,将所述第一中间密文拆分为第一部分和第二部分;S31. Based on the machine code and the software product password, use the first encryption algorithm to generate a first intermediate ciphertext, and split the first intermediate ciphertext into a first part and a second part;

S32、接收用户输入的注册码并转换成注册码密文,将所述注册码密文拆分为第一部分和第二部分;S32. Receive the registration code input by the user and convert it into a registration code ciphertext, and split the registration code ciphertext into a first part and a second part;

S33、将所述第一中间密文的第一部分和所述注册码密文的第二部分进行组合后生成第二中间密文,并通过第一加密算法生成第三中间密文,将所述第三中间密文拆分为第一部分和第二部分;S33. Combine the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, and use the first encryption algorithm to generate a third intermediate ciphertext, and convert the The third intermediate ciphertext is split into the first part and the second part;

S34、当所述第三中间密文的第一部分与所述注册码密文的第一部分相等时,则确定注册码有效,并将所述注册码密文保存至注册表;S34. When the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, determine that the registration code is valid, and save the registration code ciphertext to the registry;

S35、当所述注册码有效时,将注册码密文的第二部分和第一中间密文的第二部分通过第二加密算法获得授权信息密文,解析所述授权信息密文获得软件产品的授权信息。S35. When the registration code is valid, pass the second part of the registration code ciphertext and the second part of the first intermediate ciphertext through the second encryption algorithm to obtain the authorization information ciphertext, and analyze the authorization information ciphertext to obtain the software product authorization information.

具体实施时,先将机器码S和软件产品密码K通过第一加密算法成第一中间密文M1,将所述第一中间密文M1拆分为第一部分M1-1和第二部分M1-2;再将用户输入的注册码R并转换成注册码密文M4,将所述注册码密文拆分为第一部分M4-1和第二部分M4-2;将所述第一中间密文的第一部分M1-1和所述注册码密文的第二部分M4-2进行组合生成第二中间密文M2,并通过第一加密算法生成第三中间密文M3,将所述第三中间密文拆分为第一部分M3-1和第二部分M3-2;当所述第三中间密文的第一部分M3-1与所述注册码密文的第一部分M4-1相等时,则确定注册码有效,并将所述注册码R保存至注册表;当所述注册码有效时,将注册码密文的第二部分M4-2和第一中间密文的第二部分M1-2通过第二加密算法获得授权信息密文P,解析所述授权信息密文P获得软件产品的授权信息。通过注册码生成过程和对应的软件注册过程可知,所述第一加密算法为不可逆算法,可优选为Hash加密算法,所述第二加密算法为可逆算法,可优选为异或加密算法。通过对所述注册码密文的第一部分进行验证软件的使用权,可防止软件的非法拷贝、重装系统后重新安装等非法使用软件的使用,有效保护了软件的产权;通过软件使用权的验证后,通过解析所述授权信息密文获得授权信息,可灵活配置软件功能模块组成、使用次数、使用天数、使用期限等软件使用权限,可满足用户多样化的需求,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。During specific implementation, the machine code S and the software product password K are first encrypted into the first intermediate ciphertext M1 through the first encryption algorithm, and the first intermediate ciphertext M1 is split into the first part M1-1 and the second part M1- 2; then convert the registration code R input by the user into a registration code ciphertext M4, split the registration code ciphertext into a first part M4-1 and a second part M4-2; convert the first intermediate ciphertext The first part M1-1 of the registration code and the second part M4-2 of the registration code ciphertext are combined to generate the second intermediate ciphertext M2, and the third intermediate ciphertext M3 is generated by the first encryption algorithm, and the third intermediate The ciphertext is split into a first part M3-1 and a second part M3-2; when the first part M3-1 of the third intermediate ciphertext is equal to the first part M4-1 of the registration code ciphertext, then determine The registration code is valid, and the registration code R is saved to the registry; when the registration code is valid, the second part M4-2 of the registration code ciphertext and the second part M1-2 of the first intermediate ciphertext are passed The second encryption algorithm obtains the authorization information ciphertext P, and analyzes the authorization information ciphertext P to obtain the authorization information of the software product. It can be known from the registration code generation process and the corresponding software registration process that the first encryption algorithm is an irreversible algorithm, preferably a Hash encryption algorithm, and the second encryption algorithm is a reversible algorithm, preferably an XOR encryption algorithm. By verifying the right to use the software on the first part of the ciphertext of the registration code, illegal use of software such as illegal copying of the software, reinstallation after reinstalling the system, etc. can be prevented, and the property rights of the software are effectively protected; After verification, the authorization information is obtained by analyzing the ciphertext of the authorization information, and the software usage rights such as the composition of software function modules, the number of times of use, the number of days of use, and the period of use can be flexibly configured, which can meet the diverse needs of users and effectively overcome the existing registration requirements. The code contains the defects of less information and single function, and avoids the problem of too cumbersome and fixed parameters in the authorization process of using the license file, which can not only facilitate input, but also allow flexible control.

本发明实施例4还是对应提供了一种注册码生成装置,如图5所示,所述注册码生成装置100包括:Embodiment 4 of the present invention also provides a corresponding registration code generation device, as shown in Figure 5, the registration code generation device 100 includes:

第一中间密文生成模块101,用于基于机器码和软件产品密码通过第一加密算法生成第一中间密文;The first intermediate ciphertext generation module 101 is used to generate the first intermediate ciphertext by the first encryption algorithm based on the machine code and the software product password;

授权信息生成模块102,用于预设的若干软件使用权限,生成授权信息密文;Authorization information generation module 102, used for a number of preset software usage rights, to generate authorization information ciphertext;

注册码生成模块103,用于根据所述第一中间密文和授权信息密文进行加密运算后,生成注册码密文。The registration code generation module 103 is configured to generate a registration code ciphertext after performing an encryption operation according to the first intermediate ciphertext and the authorization information ciphertext.

注册码输出模块104,用于根据注册码密文,输出注册码的字符串序列。The registration code output module 104 is configured to output a character string sequence of the registration code according to the registration code ciphertext.

本发明实施例公开的注册码生成装置100通过第一中间密文生成模块101整合机器码和软件产品密码生成第一中间密文,再根据预设的若干软件使用权限通过授权信息生成模块102生成授权信息密文,通过注册码生成模块103将所述第一中间密文和注册码生成模块进行组合和加密运算后生成注册码密文,使得所述注册码包括机器码、软件产品密码和若干软件权限三种信息,避免软件被非法拷贝安装,能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,可灵活控制又能保护软件的产权。The registration code generation device 100 disclosed in the embodiment of the present invention uses the first intermediate ciphertext generation module 101 to integrate the machine code and the software product password to generate the first intermediate ciphertext, and then generates the first intermediate ciphertext through the authorization information generation module 102 according to several preset software usage rights. Authorization information ciphertext, the registration code ciphertext is generated after the first intermediate ciphertext and the registration code generation module are combined and encrypted by the registration code generation module 103, so that the registration code includes machine code, software product password and several Three types of information about software permissions, avoiding illegal copying and installation of software, can effectively overcome the shortcomings of existing registration codes that contain less information and single functions, and avoid the problem that the authorization process of using license files is too cumbersome and the parameters are fixed. It can be controlled flexibly and can Protect software property rights.

本发明实施例5还是对应提供了一种软件注册装置200,如图6所示,包括:Embodiment 5 of the present invention also provides a corresponding software registration device 200, as shown in FIG. 6, including:

第一中间密文拆分模块201,用于基于机器码和软件产品密码通过第一加密算法成第一中间密文,将所述第一中间密文拆分为第一部分和第二部分;The first intermediate ciphertext splitting module 201 is used to generate a first intermediate ciphertext based on the machine code and software product password through a first encryption algorithm, and split the first intermediate ciphertext into a first part and a second part;

注册码密文拆分模块202,用于接收用户输入的注册码并转换成注册码密文,将所述注册码密文拆分为第一部分和第二部分;The registration code ciphertext splitting module 202 is used to receive the registration code input by the user and convert it into a registration code ciphertext, and split the registration code ciphertext into a first part and a second part;

第三中间密文拆分模块203,用于将所述第一中间密文的第一部分和所述注册码密文的第二部分进行组合生成第二中间密文,并通过第一加密算法生成第三中间密文,将所述第三中间密文拆分为第一部分和第二部分;The third intermediate ciphertext splitting module 203 is configured to combine the first part of the first intermediate ciphertext and the second part of the registration code ciphertext to generate a second intermediate ciphertext, and generate the second intermediate ciphertext through the first encryption algorithm a third intermediate ciphertext, splitting the third intermediate ciphertext into a first part and a second part;

注册码验证模块204,用于当所述第三中间密文的第一部分与所述注册码密文的第一部分相等时,则确定注册码有效,并将所述注册码密文保存至注册表;A registration code verification module 204, configured to determine that the registration code is valid when the first part of the third intermediate ciphertext is equal to the first part of the registration code ciphertext, and save the registration code ciphertext to the registry ;

授权信息解析模块205,用于当所述注册码有效时,将注册码密文的第二部分和第一中间密文的第二部分通过第二加密算法获得授权信息密文,解析所述授权信息密文获得软件产品的授权信息。The authorization information parsing module 205 is configured to obtain the authorization information ciphertext by using the second encryption algorithm of the second part of the registration code ciphertext and the second part of the first intermediate ciphertext when the registration code is valid, and analyze the authorization information. The information ciphertext obtains the authorization information of the software product.

本发明实施例的软件注册装置200的工作过程可参考上述实施例3对软件注册方法的具体描述,在此不再赘述。For the working process of the software registration device 200 in the embodiment of the present invention, reference may be made to the specific description of the software registration method in the third embodiment above, and details are not repeated here.

综上,本发明公开了一种注册码生成方法、软件注册方法及注册码生成装置,通过对基于机器码和软件产品密码通过第一加密算法生成第一中间密文,再根据预设的若干软件使用权限,生成授权信息密文,然后将所述第一中间密文和授权信息密文生成注册码密文,从而输出注册码的字符串序列,使得所述注册码包括机器码、软件产品密码和若干软件权限三种信息,其中,其中机器码能防止软件被非法拷贝安装、重装系统重新安装、约定试用条件到期后重新安装等非法使用软件的情况,而不同的软件产品密码,使得软件开发商可以使用同样的软件注册保护方法对多种软件产品进行保护,再者配置不同的软件使用权限可灵活控制软件的功能模块组成、使用天数、使用次数等,满足用户多样化的需求,因此本方案能能有效克服现有注册码包含信息少、功能单一的缺陷,且避免了使用license文件授权过程过于繁琐且参数固定的问题,既能方便输入,又能灵活控制。To sum up, the present invention discloses a registration code generation method, a software registration method and a registration code generation device. The first intermediate ciphertext is generated by the first encryption algorithm based on the machine code and the software product password, and then according to several preset Software use rights, generate authorization information ciphertext, and then generate registration code ciphertext from the first intermediate ciphertext and authorization information ciphertext, thereby outputting a string sequence of registration codes, so that the registration code includes machine code, software product Password and some software permissions. Among them, the machine code can prevent the software from being illegally copied and installed, reinstalling the system and reinstalling, reinstalling after the agreed trial conditions expire, etc., and different software product passwords, It enables software developers to use the same software registration protection method to protect multiple software products, and configure different software usage rights to flexibly control the composition of software function modules, the number of days of use, the number of times of use, etc., to meet the diverse needs of users , so this solution can effectively overcome the shortcomings of existing registration codes that contain less information and single function, and avoid the problem that the authorization process of using the license file is too cumbersome and the parameters are fixed. It can not only facilitate input, but also allow flexible control.

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。The above description is a preferred embodiment of the present invention, and it should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications are also considered Be the protection scope of the present invention.

Claims (10)

1. it is a kind of to register code generating method, it is characterised in that including:
First intermediate ciphertext is generated by the first AES based on machine code and software product password;
Limited according to default some software licenses, generate authorization message ciphertext;
After first intermediate ciphertext and authorization message ciphertext are encrypted into computing, registration code ciphertext is generated;
According to the registration code ciphertext, the character string sequence of registration code is exported.
2. it is as claimed in claim 1 to register code generating method, it is characterised in that the machine code is by software product password Generated after carrying out Hash computings with following one or more information:Hard disc of computer numbering, computer CPU numbering, computer network System time, the software configuration file content of card MAC Address, first time computing machine code.
3. it is as claimed in claim 1 to register code generating method, it is characterised in that described by first intermediate ciphertext and mandate After information ciphertext is encrypted computing, generation registration code ciphertext specifically includes step:
After first intermediate ciphertext is split as into Part I and Part II, by the Part II of first intermediate ciphertext Interim ciphertext is generated by the second AES with the authorization message ciphertext;
The second intermediate ciphertext is generated after the Part I of first intermediate ciphertext and the interim ciphertext are combined, and is led to Cross first AES and generate the 3rd intermediate ciphertext;
After 3rd intermediate ciphertext is split as into Part I and Part II, by the Part I of the 3rd intermediate ciphertext Generation registration code ciphertext is combined with the interim ciphertext.
4. it is as claimed in claim 3 to register code generating method, it is characterised in that first intermediate ciphertext and machine code ciphertext Length be 16 bytes;And the length of the Part I and Part II of first intermediate ciphertext or the 3rd intermediate ciphertext expires It is enough to lower relation:
X+Y=16, X>0&Y>0
Wherein, the X is the Part I of the first intermediate ciphertext or the byte number shared by the Part I of the 3rd intermediate ciphertext, Y Byte number shared by the Part II of the first intermediate ciphertext or the Part II of the 3rd intermediate ciphertext.
5. it is as claimed in claim 3 to register code generating method, it is characterised in that second AES is that XOR encrypts calculation Method, cyclic shift AES or replacement AES.
6. the registration code generating method as described in claim 1 or 3, it is characterised in that first AES adds for Hash Close algorithm.
7. it is as claimed in claim 1 to register code generating method, it is characterised in that the authorization message ciphertext includes that module is constituted Information unit, the information unit of limited number of times, software information unit, the information list of limiting date of limitation number of days that use Unit, the information unit of client maximum number of connections, maximum use information unit, the information of maximum throughput of number of users simultaneously The information unit of unit or support CPU maximum numbers.
8. a kind of software registration method, it is characterised in that including step:
First AES is passed through into the first intermediate ciphertext based on machine code and software product password, by first intermediate ciphertext It is split as Part I and Part II;
The registration code for receiving user input is simultaneously converted into registration code ciphertext, and the registration code ciphertext is split as into Part I and the Two parts;
The Part II of the Part I of first intermediate ciphertext and the registration code ciphertext is combined in generation second Between ciphertext, and by the first AES generate the 3rd intermediate ciphertext, by the 3rd intermediate ciphertext be split as Part I and Part II;
When the Part I of the 3rd intermediate ciphertext is equal with the Part I of the registration code ciphertext, it is determined that registration code Effectively, and by the registration code ciphertext preserve to registration table;
When the registration code is effective, the Part II of the Part II of registration code ciphertext and the first intermediate ciphertext is passed through second AES obtains authorization message ciphertext, parses the authorization message that the authorization message ciphertext obtains software product.
9. a kind of registration code generating means, it is characterised in that including:
First intermediate ciphertext generation module, for generating first by the first AES based on machine code and software product password Intermediate ciphertext;
Authorization message generation module, limits for default some software licenses, generates authorization message ciphertext;
Registration code generation module, after being encrypted computing according to first intermediate ciphertext and authorization message ciphertext, generation Registration code ciphertext.
Registration code output module, for according to registration code ciphertext, exporting the character string sequence of registration code.
10. a kind of software registration device, it is characterised in that including:
First intermediate ciphertext splits module, for based on machine code and software product password by the first AES into first Between ciphertext, first intermediate ciphertext is split as Part I and Part II;
Registration code ciphertext splits module, for receiving the registration code of user input and being converted into registration code ciphertext, by the registration Code ciphertext is split as Part I and Part II;
3rd intermediate ciphertext splits module, for by the of the Part I of first intermediate ciphertext and the registration code ciphertext Two parts are combined the second intermediate ciphertext of generation, and generate the 3rd intermediate ciphertext by the first AES, by the described 3rd Intermediate ciphertext is split as Part I and Part II;
Registration code authentication module, for the Part I of the Part I when the 3rd intermediate ciphertext and the registration code ciphertext When equal, it is determined that registration code effectively, and the registration code ciphertext is preserved to registration table;
Authorization message parsing module, for when the registration code is effective, in the middle of the Part II of registration code ciphertext and first The Part II of ciphertext obtains authorization message ciphertext by the second AES, parses the authorization message ciphertext and obtains software product The authorization message of 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 true CN106919810A (en) 2017-07-04
CN106919810B 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)

Cited By (11)

* 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
CN108548271A (en) * 2018-04-17 2018-09-18 奥克斯空调股份有限公司 Air conditioning monitoring and the method and system of debugging software mandate
CN108897995A (en) * 2018-06-19 2018-11-27 河南正来电子科技有限公司 A kind of embedded software encrypting registration method of combination embedded device
CN109450618A (en) * 2019-01-11 2019-03-08 无锡华大国奇科技有限公司 A kind of encryption method and system based on MD5
CN110213306A (en) * 2018-02-28 2019-09-06 北京金风科创风电设备有限公司 Start-up control method and device for wind power generating set
CN111859364A (en) * 2020-07-29 2020-10-30 杭州安恒信息技术股份有限公司 Authority authentication method, device, equipment and storage medium
CN113835738A (en) * 2021-09-13 2021-12-24 许昌许继软件技术有限公司 Transformer substation monitoring system application program management method and device
CN114912080A (en) * 2022-04-21 2022-08-16 健帆生物科技集团股份有限公司 Registration code generation method, control method, terminal device and storage medium
CN115017475A (en) * 2022-06-29 2022-09-06 吴江绿控电控科技有限公司 Method for software off-line authorization
CN115357869A (en) * 2022-10-19 2022-11-18 安徽华云安科技有限公司 Software activation method and device based on multipath configuration
CN116318982A (en) * 2023-03-10 2023-06-23 深圳市银拓科技有限公司 License-based method for activating software of product to be authorized and electronic equipment

Citations (4)

* 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
US20140082370A1 (en) * 2011-06-22 2014-03-20 Media Patents . S.L. Methods, apparatus and systems to improve security in computer systems

Patent Citations (4)

* 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
US20140082370A1 (en) * 2011-06-22 2014-03-20 Media Patents . S.L. Methods, apparatus and systems to improve security in computer systems
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

Cited By (16)

* 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
CN110213306A (en) * 2018-02-28 2019-09-06 北京金风科创风电设备有限公司 Start-up control method and device for wind power generating set
CN108548271A (en) * 2018-04-17 2018-09-18 奥克斯空调股份有限公司 Air conditioning monitoring and the method and system of debugging software mandate
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
CN109450618A (en) * 2019-01-11 2019-03-08 无锡华大国奇科技有限公司 A kind of encryption method and system based on MD5
CN111859364A (en) * 2020-07-29 2020-10-30 杭州安恒信息技术股份有限公司 Authority authentication method, device, equipment and storage medium
CN113835738A (en) * 2021-09-13 2021-12-24 许昌许继软件技术有限公司 Transformer substation monitoring system application program management method and device
CN114912080A (en) * 2022-04-21 2022-08-16 健帆生物科技集团股份有限公司 Registration code generation method, control method, terminal device and storage medium
CN114912080B (en) * 2022-04-21 2024-07-16 健帆生物科技集团股份有限公司 Registration code generation method, control method, terminal device and storage medium
CN115017475A (en) * 2022-06-29 2022-09-06 吴江绿控电控科技有限公司 Method for software off-line authorization
CN115357869A (en) * 2022-10-19 2022-11-18 安徽华云安科技有限公司 Software activation method and device based on multipath configuration
CN116318982A (en) * 2023-03-10 2023-06-23 深圳市银拓科技有限公司 License-based method for activating software of product to be authorized and electronic equipment
CN116318982B (en) * 2023-03-10 2023-11-17 深圳市银拓科技有限公司 License-based method for activating software of product to be authorized and electronic equipment

Also Published As

Publication number Publication date
CN106919810B (en) 2020-04-07

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) How to distribute software objects
KR100200443B1 (en) Method of distribution software object
US7376976B2 (en) Transcryption of digital content between content protection systems
WO2021218331A1 (en) Offline software licensing method, apparatus and device, and storage medium
US8117221B2 (en) Database obfuscation system and method
US9344275B2 (en) System, device, and method of secure entry and handling of passwords
US8375224B2 (en) Data masking with an encrypted seed
KR100200445B1 (en) Method and device for securing file access
JP5417092B2 (en) Cryptography speeded up using encrypted attributes
US20080310624A1 (en) Encryption Apparatus and Method for Providing an Encrypted File System
US7694153B2 (en) Changing product behavior in accordance with license
CN109104281A (en) Tokenized hardware security module
US20130262882A1 (en) Secure island computing system and method
TW202526631A (en) Nuts: encrypted userdata transit and storage
US11783094B2 (en) System and method for providing protected data storage in data memory
NO333104B1 (en) Secure architecture with server plugins for digital rights management systems
CN108090366B (en) Data protection method and device, computer device and readable storage medium
CN110855433A (en) Data encryption method and device based on encryption algorithm and computer equipment
CN111368322B (en) A file decryption method, device, electronic device and storage medium
JP2004171367A (en) Circuit operation simulation apparatus, circuit operation simulation method, circuit operation simulation program, and circuit information decoding program
CN116132065A (en) Key determination method, device, computer equipment and storage medium
CN116933298B (en) A method, device, storage medium and equipment for data encryption processing of scientific and technological achievements
CN111079165B (en) Data processing method, data processing device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 510663 9, 11, science Road, science and Technology City, Guangzhou high tech Industrial Development Zone, Guangdong

Patentee after: Guangdian Yuntong Group Co.,Ltd.

Country or region after: China

Address before: No. 9-11 Kelin Road, Science City, Guangzhou High tech Industrial Development Zone, Guangdong Province

Patentee before: GRG BANKING EQUIPMENT Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address