Software data protection mechanism

Abstract: A protection mechanism includes means for taking an input binary value and generating a unique key value as well as performing the reverse operation of taking a key value and generating an input binary value. The mechanism includes a scrambler which includes an array having a number of multibit container locations for storing a unique sequence of random numbers. The scrambler forms another binary value by rearranging the bits of the input binary value as a function of the random number values in addition to altering the states of such bits as a function of the random number values and the numeric bit position values of sources of the input binary bits. The resulting binary value is applied to an alphanumeric encoder which converts the binary value into a series of alphanumeric characters containing a valid key value.

Description: BACKGROUND OF THE INVENTION Field of Use The present invention pertains to data protection systems and, more particularly, to systems useful in performing software licensing verification. Prior Art Software is viewed as an important valuable asset whose use must be protected to the extent possible from unauthorized copying and distribution. Many companies protect software through the use of license agreements. In certain instances, locking mechanisms have been incorporated into software packages distributed to end users which prevent the making of copies of such software after the software is installed into a system. However, this type of approach has been found inconvenient to users since it does not allow users to make necessary copies (e.g. archival copies) to prevent interruptions in normal business operations. Others have employed encryption and decryption techniques to protect unauthorized copying. The overhead in performing such operations is substantial which reduces processing system efficiency. Still others have utilized programmed algorithms to protect against unauthorized access. Such algorithms can be ascertained from an examination of the program's source code. Also, decompiler products are available on the market which can be used to extract the algorithms from the object code version of the program. Thus, it has become difficult to ensure the security of such algorithms in such cases. Further, the above approaches have been found to be costly to implement, complex or complicated to use or inconvenient to end users. U.S. Patent No. 4,888,798, entitled "Modular Software Security" concerns already an apparatus for protecting software elements in a computer system from unauthorized copying and distribution by generating user keys from input binary values and for transforming user keys vice versa into said input binary values, said apparatus comprising: an input register for storing a first n-bit binary value including a predetermined number of bytes, said first binary value to be converted into a user key; a pseudo random number generator which in response to seed values generates a repeatable sequence of random numbers wherein said seed values are arbitrary values which require safeguarding to prevent duplication of valid keys notwithstanding disclosure of the protection mechanism; a scrambler having an output register for storing a second n-bit binary value, and rearranging means for moving each of said n bits of said first n-bit binary value to a new bit position of said output register as a function of said repeatable sequence of random numbers, said scrambler further comprising means for using said random numbers to select either a complement or a non-complement output of said rearranging means for moving to said output register; and an alphanumeric encoder operativaly coupled to said scramler for receiving said second n bit binary value to extract portions of said second binary value corresponding to groups of m bits from said second binary value and to use said groups of bits as indexes for referencing different ones of alphanumeric characters to produce a series of alphanumeric characters representing one of said user keys. The U.S. Patent No. 5,079,733 discloses an apparatus to generate pseudo random numbers based on the use of shift registers which include a feedback link which conveys a bit linked with the output sequence to modifiers inserted between every two stages of the register. Such multiplier registers utilize mathematical analogy in accordance with which these registers effect the multiplication of a sequence of bits supplied serially to the input, by a polynomial. A secure microprocessor is disclosed in the U.S. Patent No. 4,598,170 for the protection of computer programs through encrypting using the principles of inversion and permutation. The reordering is accomplished in a permutator matrix the crosspoints of which can be programmed to switch any of the inputs to any of the outputs through the use of variables. Accordingly, it is a primary object of the present invention to provide an alternative mechanism for generating key values that cannot be easily counterfeited which control the use of software packages. SUMMARY OF THE INVENTION The above object of the present invention is achieved by employing the hardware components and method steps according to the claims 1 and 2. The design documentation of the present invention in addition to any source code related to its implementation are not required to be hidden. The reason is that without knowing all of the values used to generate the key value, it is not possible to predict what changes have to be made in the key in order to produce another valid 32 bit input binary value. Further, the encoder also allows changes in the characters used to represent the scrambler output. In the preferred embodiment, a serial number is used as part of the input binary value because it can be uniquely assigned and can be easily verified by the system running the application. Even though the serial number is utilized as part of the input binary value, knowing the value of the key and its pattern of change for another system will not be useful in determining what to change to obtain a valid key. The reason is that the serial number value is used in generating the random number values. Thus, the present invention provides the required security notwithstanding publication of associated documentation and source code. Since both the seed and start values are used in generating the random number values, the way in which these values are derived need only be protected. For example, in a simple case, the only value that need be obscured or safeguarded from disclosure is the seed value which is an arbitrary value selectable upon a last minute notice for generating valid key values. The novel features which are believed to be characteristic of the invention both as to its organization and method of operation, together with further objects and advantages, will be better understood from the following description when considered in connection with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1a is a block diagram of the protection mechanism of the present invention. Figure 1b shows in greater detail, a portion of the protection mechanism of Figure 2. Figure 1c is a diagram used in illustrating the operation of the protection mechanism of Figure 1a. Figure 2 is a diagram illustrating user and system environments which utilize the protection mechanism of the present invention. Figures 3a and 3b are flow diagrams used in describing the operation of the protection mechanism of Figure 2. Figures 4a through 4c are flow diagrams used in describing the operation of the systems of Figures 1a and 1b. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT Figure 1a illustrates in block diagram form, the protection mechanism 10 of the present invention. The different elements of Figure 1a are organized to generate a key value from an input binary value as well as perform the reverse operation of generating an input binary value from a user supplied key value. As shown, the mechanism 10 includes an input register 12 for storing a 32 bit binary value. The different bit position outputs are applied as inputs to a scrambler memory switching array 14. The array 14 provides 32 multibit containers 140-0 through 140-31 for storing a sequence of random number values generated by a pseudo random number generator 16, conventional in design. Each container 140 includes multibit storage for a five bit random number value in addition to exclusive or means for performing an exclusive or of the numeric value of bit position of the input binary bit applied as an input from input register 12 with the random number value stored in the container 140. The least significant bit of the result of the exclusive or operation defines if the input binary bit or its complement is to be applied as the output of container 140. As shown, containers 140-0 through 140-31 provide inputs to the different bit positions of a 32 bit output register 18. Each container 140 is able to provide an input to any one of the 32 bit positions of register 18 as a function of the random number value it contains. This arrangement is diagrammatically illustrated in Figure 1b. As shown, the container 140 has a number of sets of outputs, each set consisting of two outputs, a direct non-inverting output 140a and a complement or inverting output 140b denoted by the bubble symbol. The direct or complement output of each container 140 is logically connectable as an input to any one of the 32 bit positions of the output register 18. The particular bit position is selected as a function of the random number value stored in the container. A portion of Figure 1c graphically illustrates the connections dynamically provided by scrambler array 14 for a representative unique sequence of random number values. The connections shown in Figure 1c are defined in the table given below. Scrambler Array Input Output Input Output Input Output Input Output 00 NOT 30 01 NOT 11 02 27 03 NOT 23 04 NOT 14 05 08 06 NOT 04 07 28 08 NOT 22 09 26 10 NOT 24 11 NOT 17 12 01 13 20 14 15 15 NOT 03 16 31 17 NOT 19 18 NOT 18 19 02 20 NOT 12 21 NOT 09 22 NOT 06 23 NOT 21 24 13 25 NOT 25 26 NOT 16 27 00 28 07 29 NOT 29 30 05 31 10 As shown in Figure 1a, the binary contents of the output register 18 are applied as inputs to an alphanumeric encoder 20. The encoder 20 includes four sets of overlapping 5-bit registers 200-la,lb through 200-4a,4b. Each of the sets of registers receive as inputs, a different 8-bit character or byte from output register 18. The 5-bit output of each register is applied as an input to a table 204. The table 204 contains 32 different alphanumeric characters. The contents of each set of registers 200-1a, 1b through 200-4a, 4b are used as indexes into the table 204 for obtaining eight alphanumeric characters which are stored in a user key register 24. In the preferred embodiment of the present invention, table 204 includes the key characters shown below and discussed relative to in Figure 1c: Alphanumeric Encode/Decode Table Index Character Index Character Index Character Index Character 0 A 8 I 16 R 24 Z 1 B 9 J 17 S 25 2 2 C 10 K 18 T 26 3 3 D 11 L 19 U 27 4 4 E 12 M 20 V 28 5 5 F 13 N 21 W 29 6 6 G 14 P 22 X 30 7 7 H 15 Q 23 Y 31 8 The characters "O" and "1" were excluded to avoid problems in distinguishing between ZEROS and the letter "O," ONES and the letter I or L. Figure lc illustrates the manner in which an input binary value (0001....1001) contained in input register 12 is transformed into the string of alphanumeric characters AGFPH3XS. Also, Figure 1c illustrates the reverse operation of transforming the string of alphanumeric characters AGFPH3XS into the input binary value 0001...1001. These operations are illustrated for the unique sequence of random number values indicated in scrambler array table. The sequence corresponds to the random number values 30, 11, 27, 23, 14, 08, 04, 28, 22, 26 ... through 10. In the preferred embodiment, the scrambler and alphanumeric encoder functions are implemented by the use of different program routines. More specifically, the scrambler array operation is carried out by a mix function of Figure 4a. The routine takes a 32-bit value and randomly rearranges the bits to form another 32-bit value. This is accomplished by generating a list of the numbers from 0 to 31 in random order and moving each bit position to a new bit position indicated by that list. As shown in Figure 4a, the value of encode flag parameter is used to control the direction of movement through the scrambler. The mix function makes use of a conventional pseudo random number generator. As shown in Figure 4a, the seed value is applied as an input to the pseudo random number generator. As indicated, this type of generator is normally included as part of a standard C runtime library (SRAND routine which receives the seed value and the RAND function which returns a pseudo random number value). Such runtime libraries are normally provided in operating system which utilize the C programming language. Equivalent generators are available for use with other programming languages. Additionally, a start number value is also applied which results in skipping a designated number of random number sequences. Since both the seed and start values are arbitrary values, they can be selected in a way to ensure security. As seen from Figure 4a, a switch counter is set to zero, and the number of scrambler switches is checked to determine if all 32 switches have been processed. Next, the mix function checks if the random number to be loaded is new (unique). There must be 32 unique numbers stored in containers 140-0 through 140-31. If it is not unique, the function skips to another random number of the sequence. Next, the mix function checks if the mechanism is performing an encoding function or a decoding function. As shown, in either case, the mix function compares the least significant bit of the numeric value of each source bit position and each destination bit position (i.e., the random number value stored in the associated container) to determine if they are equal. This is carried out by exclusively oring of these bits. When they are not equal, the bit being moved is moved to the non-inverting input bit position. When they are equal, the bit being moved is moved to the inverting or complementing bit position. This is followed by incrementing the switch counter by one. The above sequence is repeated until all 32 switches are done. As shown, the mix function returns the result which corresponds to the 32-bit value stored in output register 18 or the 32-bit input binary value stored in input register 12. The source code for the mix function is shown in Appendix I. The alphanumeric encoder function is carried out by a make key function routine and a make value function routine. The make key function routine takes a 32-bit value and converts it into a series of alphanumeric characters. This is accomplished by extracting groups of 5 bits and using that as an index into the table of 32 alphanumeric characters. Each byte is used to form two characters, one from the high order five bits and the other from the low order five bits. A null character is placed at the end of the string of eight characters. A pointer is returned to this static string and copy would normally be made of the string before the make key function is called again. Figure 4b is a flow diagram illustrating the operation of the make key function. The input binary value is viewed as consisting of four bytes designed as bytes 0 through 3. As shown, this function first terminates the stored result string with a null or zero character. Next, the function establishes a counter for storing a byte numerical index value of (i). This value identifies the index for the byte to be converted. Since this is the first pass, the make key function converts the five high order bits of byte (i) into the character obtained from the alphanumeric table and stores the character in result location at index (i*2). Next, the make key function converts five low order bits of byte (i) into the character obtained from the alphanumeric table and stores the character in result location at index (i*2+1). When all four of the bytes have been processed, the function eliminates all trailing zero value characters and then returns a pointer designating the location of the result. The source code of this function is shown in Appendix II. The make value function takes a series of alphanumeric characters and converts them into a 32-bit value. This is accomplished by forming a 5-bit value from the alphanumeric character and combining them to form the 32-bit value. Each character is searched for in the table 204 and its position is used as the value. Figure 4c is a flow diagram illustrating the operation of the make value function. As shown, the make value function first sets the result field to zero and sets a character counter (i) equal to zero. Next, it determines if there is a key character left. Next, it looks up the key character in the "keychars" table. If the key character is found, then the position or index (j) of the located key character is stored in the result field. If the character count is less than 8, the character counter is incremented by one. Also, the key pointer is incremented by one for processing the next key character. When all of the key characters have been processed, the make value function then returns the result. It will be noted that any extraneous characters included as key characters are ignored since they will not be found in the table. The source code of this routine is shown in Appendix III. DESCRIPTION OF OPERATION With reference to Figures 1a through 1c and 2, the utilization of the protection mechanism 10 will now be described relative to the flow diagrams of Figures 3a and 3b. Figure 2 depicts both developer and user environments which utilize the teachings of the present invention. The protection mechanism 10 when utilized in' the application developer system environment 40 includes the encoding routines to compute a valid key. It also may include the decoding routines also utilized in the user environment 50 for verifying that the application is correctly processing the key values using valid and invalid keys. As indicated in Figure 2, all of these routines are stored in a library 400 linked to the applications 1 and 2 being run. Also, the system environment 40 includes storage for the scrambler switching array memory 402 equivalent to array 14 of Figure 2 and an alias table 404 which is equivalent to table 204 of Figure 2. Application 2 is run by the developer for the purpose of generating a valid key. More specifically, the application provides seed and start values generated as a function of certain identification information provided by the developer. For example, the start value is determined by CPU serial number while the seed is selected for a particular product and its value is hidden to the extent possible. The seed and start values are applied as inputs to the pseudo random number generator program included as part of the developer environment 40. Additionally, the application supplies a 32-bit binary value. In accordance with the invention, the application calls mix function routine stored in library 400 and provides as inputs, the seed, start and the 32-bit binary value. The routine produces as an output, another 32-bit value whose bits have been randomly rearranged utilizing scrambler array 402 in the manner previously described. Next, the make key function routine is called as shown in Figure 3a. This routine takes the 32-bit value provided by the mix function routine and converts it to a string or series of alphanumeric characters utilizing alias table 404 in the manner previously described. The routine puts a null character at the end of the string and stores it in a key storage memory 406. As indicated in Figure 2, a key pointer to this static string is returned by the routine to application 2. This completes the encoding sequence. The developer then verifies that the application is correctly processing key values by running application 1. This sequence is shown in Figure 3b. The application first reads the user supplied key which in this case corresponds to a previously generated key or a test value. The key is referenced via the key pointer. Next, the application calls the make value function. This function takes the string of alphanumeric characters and converts them into a 32-bit value by searching alias table 404 in the manner previously described. As described in Figure 3b, next a call is made to the mix function routine of library 400. This routine takes the 32-bit value and rearranges its bits utilizing scrambler array 402 to form another 32-bit value which corresponds to the input binary value. As shown in Figure 2, this number is returned to the application. The values are compared by the application of Figure 3b and if the appropriate parts match identically, the key is deemed valid. From the valid value derived from the user supplied key, certain information can be extracted as explained herein. Such computed valid key value can include the serial number of the system machine, a product code and an encoded value representing the maximum number of users allowed in the system. More specifically, the 32-bit valid key value may contain the following information: 01........19 20........27 28........31 CPU Serial No. PRODUCT CODE MAX USERS. Also, the 32-bit valid key value could contain duplicate data as follows: 0.....6 8.....15 16.....22 23.....31 YEAR-1990 DAY OF YEAR YEAR-1990 DAY OF YEAR. In the case where the valid key value contains the CPU serial number and product code, the application, by accessing such information, can compare these values and, if they match, the application can extract the maximum user field and use that value. In the case where the valid key value contains duplicate data, the key value is validated by comparing the duplicated data. As indicated, Figure 2 also shows user system environment 50. This environment only contains the routines for verifying the key. As shown, the developer normally provides the valid key along with the user environment application packaged in a shrink-wrapped container as is standard in the software industry. The user enters the user key which is furnished to the application. The application performs the sequence of operations of Figure 3b. As previously explained, this involves calling the make value function routine which converts the key to a 33-bit value. This is followed by calling the mix function which rearranges the 32 bits to form the real 32-bit binary value. The information used for validation is extracted from the key value and compared with known values by the application for establishing that the key is valid. If it is, the application can extract additional information such as maximum number of users. Appendices IV and V provide the source code for the functions of Figures 3a and 3b. From the above, it is seen how the protection mechanism of the present invention is able to provide key values associated with software packages that cannot be easily duplicated and which contain information useful in license verification. The protection mechanism details as well as source code need not be protected. Therefore, only a minimal amount of information needs to be hidden or concealed thereby reducing the extent of security measures normally required. Further, since the protection mechanism does not depend upon the formatting or ordering of bits, bytes, etc., it can be used to generate valid keys on any type of machine. It is only required that such machine provide a pseudo random number generator. Another advantage of the protection mechanism is that it requires a minimal amount of code to implement the required functions. It will be obvious to those skilled in the art that many changes may be made to the protection mechanism of the present invention. For example, different user identification information may be used in conjunction with the mechanism. Also, only portions of the protection mechanism may be used. For example, the mix function may be used separately to encrypt an input binary value. Similarly, the alphanumeric encoder/decoder or make key/make value function may be used separately to encode/decode an input binary value into an alphanumeric string of characters.

Claims: Apparatus for protecting software elements in a computer system from unauthorized copying and distribution by generating user keys from input binary values and for transforming user keys vice versa into said input binary values, said apparatus comprising: an input register (12) for storing a first n-bit binary value including a predetermined number of bytes, said first binary value to be converted into a user key; a pseudo random number generator (16) which in response to a seed value generates a repeatable sequence of random numbers and which in response to a start value skips a designated number of random number sequences and wherein said seed and start values are arbitrary values which require safeguarding to prevent duplication of valid keys notwithstanding disclosure of the protection mechanism; a scrambler (14) having n multibit containers (140-0 ... 140-31) for storing n multibit random numbers included in said repeatable sequence; an output register (18) for storing a second n-bit binary value; and rearranging means (140-0 ... 140-31, Fig.1C; Fig.4A) for moving randomly each of said n bits of said first n-bit binary value to a new bit position of said output register as a function of one of said n random numbers stored in a corresponding one of said containers, and said scrambler (14) further comprising means (140-0 ... 140-31; Fig.1C; Fig.4A) for exclusive ORing a numeric value for each bit position of said input register with a random number value of a corresponding one of said containers to produce a least significant bit whose state selects either a complement or a non-complement of a corresponding output of said rearranging means (140-0 ... 140-31; Fig.1C; Fig.4A) for moving to said output register (18); and an alphanumeric encoder (20) operatively coupled to said scrambler (14) for receiving said second n bit binary value to extract overlapping portions (200-1a, 200-1b ... ) of said second binary value corresponding to groups of m bits from each byte of said second binary value wherein m has a value less than the number of bits of a byte and to use said groups of bits as indexes into a table (204) for referencing different ones of alphanumeric characters stored in said table to produce a series of alphanumeric characters representing one of said user keys. Method for protecting software elements in a computer system from unauthorized copying and distribution by generating user keys from input binary values and for transforming user keys vice versa into said binary values, said method comprising the steps of: (a) storing in an input register a first n-bit binary value including a predetermined number of bytes, said first binary value to be converted into a user key; (b) generating a repeatable sequence of random numbers by applying a seed value to a pseudo random number generator which in response to a start value skips a designated number of random number sequences; (c) storing n random numbers in a corresponding number of multibit container locations; (d) scrambling the bits of said first n-bit binary value by moving randomly each of said n bits of said first n-bit binary value to a new bit position of an output register as a function of one of said n random numbers stored in a corresponding one of said container locations; (e) assigning to said first n-bit binary value a corresponding number of bit position values defined by the positions of said input register; (f) exclusive ORing each of said bit position values with a corresponding one of said n multibit random numbers to produce n least significant bits which are used for determining whether a corresponding bit of said first n-bit binary values is to be complemented when moving to said new bit position of said output register; (g) encoding said second binary value into a series of alphanumeric characters usable as one of said user keys by extracting different overlapping portions from said second binary value wherein said different portions correspond to groups of m bits extracted from each byte of said second binary value with m having a value less than the number of bits of a byte and by using said group of bits as indexes into a table for referencing different ones of alphanumeric characters stored in said table to produce said series of alphanumeric characters.

Inventors: HIRSCH THOMAS S, HIRSCH, THOMAS S.
Applicants: BULL HN INFORMATION SYST, BULL HN INFORMATION SYSTEMS INC.
Application year: 1993
Main classification: G06F12
IPC codes: G06F12, H04L9