An Enhanced Hill Cipher and Its Application in Software ... · enhanced Hill cipher. Our algorithm...

9
An Enhanced Hill Cipher and Its Application in Software Copy Protection Ning Huang Center of Modern Educational Technology, Gannan Normal University, Ganzhou 341000, China Email: [email protected] Abstract—To protect software from unauthorized use, reg- istration key is frequently used in the field of permission control. For the security of such a system, the key issue is to design a robust algorithm. We propose an enhanced scheme of Hill cipher based on variable modulus and algebraic alphabet to protect software copy, which uses tridiagonal matrix. Since the modulus is not a fixed number and the algebraic alphabet depends on a variety of choices, the cipher is hard for an adversary to break. All of the choices of the modulus, the algebraic alphabet and the key matrix depend on the machine fingerprint of the buyer. Experimental results show both usefulness and security of the proposed scheme. Index Terms—Copy, Hill Cipher, Protection, Software I. I NTRODUCTION Copy protection for computer software started a long cat-and-mouse struggle between publishers and crackers. These were ( and are ) programmers who would defeat copy protection on software as a hobby, add their alias to the title screen, and then distribute the ”cracked” product to the network BBSes or Internet sites that specialized in distributing unauthorized copies of software . To protect from unauthorized use, many computer programs use registration keys. The software will refuse to run if the registration key is not typed in correctly [1]. In general, a registration key is created by a certain encryption. Conversely, it is verified by the corresponding decryption. We propose a scheme of copy protection based on an enhanced Hill cipher. Our algorithm mainly deals with multi-table Hill cipher, tridiagonal matrix and its inverse, expression of the message in plain text and cipher text and the use of machine fingerprint. The Hill cipher was invented in 1929 and used in cipher apparatus in 1931 by Lester S. Hill [2], [3]. It is a famous polygram and classical ciphering algorithm based on matrix transformation [10]. It is a block cipher that has several advantages such as disguising letter frequencies of the plain text, its simplicity because of using matrix multiplication and inversion for encryption and decryption, and its high speed and high throughput [8], but it is vulnerable to the known-plaintext attack [6]. Recent efforts to improve the Hill cipher are mainly as follows: In 2000, Shahrokh Saeednia proposed a scheme that makes use of ”random” permutations of columns and rows of a matrix to form a ”different” key for each data encryption [4]. In 2004, to overcome the drawbacks of Saeednias scheme, a more secure cryptosystem with a one-way hash function was proposed by Lin et al. [7]. In 2005, Overbey et al. analyzed the effects of change in dimension and modulus on the order of the keyspace [5]. Ismail et al. proposed a scheme for encrypting grayscale images in an alphabet of 256 symbols [8]. In 2008, Rangel-Romero et al. claimed that previous method still has severe security flaws whose weaknesses are essentially the same as that already found in the original Hill cipher scheme [9]. In 2011, Toorani and Falahati tried to introduce a secure cryptosystem that is a variant of the affine Hill cipher, which overcomes all of its security drawbacks [10]. In 2013, Liam and Anthony discovered the flaw of the Toorani-Falahati version [11]. Yet, in 2012, Krishna and Madhuravani proposed a modified Hill cipher using randomized approach [12], which has been still secure. Tridiagonal matrices are useful in many different the- oretical fields, especially in applicative fields such as numerical analysis, orthogonal polynomials, engineering, telecommunication system analysis, system identification, signal processing, special functions, partial differential equations and naturally linear algebra. In many of these areas, inversions of tridiagonal matrices are necessary. There are several recent research works to compute the inverses of such matrices. The common idea of these pa- pers is to determine the LU factorization of a tridiagonal matrix T and the explicit formulae to compute the inverse of L and that of U , in which L is lower triangular and U is upper triangular [13]–[16]. For example, in the research of [15], a tridiagonal matrix T = t 11 t 12 0 ··· 0 t 21 t 22 t 23 . . . . . . 0 . . . . . . . . . 0 . . . . . . . . . . . . t n-1,n 0 ··· 0 t n,n-1 t nn can be denoted by T = L 1 U 1 = L 2 U 2 , where 2582 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014 © 2014 ACADEMY PUBLISHER doi:10.4304/jnw.9.10.2582-2590

Transcript of An Enhanced Hill Cipher and Its Application in Software ... · enhanced Hill cipher. Our algorithm...

An Enhanced Hill Cipher and Its Application inSoftware Copy Protection

Ning HuangCenter of Modern Educational Technology, Gannan Normal University, Ganzhou 341000, China

Email: [email protected]

Abstract— To protect software from unauthorized use, reg-istration key is frequently used in the field of permissioncontrol. For the security of such a system, the key issue is todesign a robust algorithm. We propose an enhanced schemeof Hill cipher based on variable modulus and algebraicalphabet to protect software copy, which uses tridiagonalmatrix. Since the modulus is not a fixed number andthe algebraic alphabet depends on a variety of choices,the cipher is hard for an adversary to break. All of thechoices of the modulus, the algebraic alphabet and the keymatrix depend on the machine fingerprint of the buyer.Experimental results show both usefulness and security ofthe proposed scheme.

Index Terms— Copy, Hill Cipher, Protection, Software

I. INTRODUCTION

Copy protection for computer software started a longcat-and-mouse struggle between publishers and crackers.These were ( and are ) programmers who would defeatcopy protection on software as a hobby, add their alias tothe title screen, and then distribute the ”cracked” productto the network BBSes or Internet sites that specialized indistributing unauthorized copies of software . To protectfrom unauthorized use, many computer programs useregistration keys. The software will refuse to run if theregistration key is not typed in correctly [1]. In general,a registration key is created by a certain encryption.Conversely, it is verified by the corresponding decryption.We propose a scheme of copy protection based on anenhanced Hill cipher. Our algorithm mainly deals withmulti-table Hill cipher, tridiagonal matrix and its inverse,expression of the message in plain text and cipher textand the use of machine fingerprint.

The Hill cipher was invented in 1929 and used incipher apparatus in 1931 by Lester S. Hill [2], [3]. Itis a famous polygram and classical ciphering algorithmbased on matrix transformation [10]. It is a block cipherthat has several advantages such as disguising letterfrequencies of the plain text, its simplicity because ofusing matrix multiplication and inversion for encryptionand decryption, and its high speed and high throughput[8], but it is vulnerable to the known-plaintext attack [6].

Recent efforts to improve the Hill cipher are mainly asfollows:

In 2000, Shahrokh Saeednia proposed a scheme thatmakes use of ”random” permutations of columns and

rows of a matrix to form a ”different” key for each dataencryption [4].

In 2004, to overcome the drawbacks of Saeedniasscheme, a more secure cryptosystem with a one-way hashfunction was proposed by Lin et al. [7].

In 2005, Overbey et al. analyzed the effects of changein dimension and modulus on the order of the keyspace[5].

Ismail et al. proposed a scheme for encryptinggrayscale images in an alphabet of 256 symbols [8].

In 2008, Rangel-Romero et al. claimed that previousmethod still has severe security flaws whose weaknessesare essentially the same as that already found in theoriginal Hill cipher scheme [9].

In 2011, Toorani and Falahati tried to introduce a securecryptosystem that is a variant of the affine Hill cipher,which overcomes all of its security drawbacks [10].

In 2013, Liam and Anthony discovered the flaw of theToorani-Falahati version [11].

Yet, in 2012, Krishna and Madhuravani proposed amodified Hill cipher using randomized approach [12],which has been still secure.

Tridiagonal matrices are useful in many different the-oretical fields, especially in applicative fields such asnumerical analysis, orthogonal polynomials, engineering,telecommunication system analysis, system identification,signal processing, special functions, partial differentialequations and naturally linear algebra. In many of theseareas, inversions of tridiagonal matrices are necessary.There are several recent research works to compute theinverses of such matrices. The common idea of these pa-pers is to determine the LU factorization of a tridiagonalmatrix T and the explicit formulae to compute the inverseof L and that of U , in which L is lower triangular and Uis upper triangular [13]–[16]. For example, in the researchof [15], a tridiagonal matrix

T =

t11 t12 0 · · · 0

t21 t22 t23. . .

...

0. . . . . . . . . 0

.... . . . . . . . . tn−1,n

0 · · · 0 tn,n−1 tnn

can be denoted by T = L1U1 = L2U2, where

2582 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014

© 2014 ACADEMY PUBLISHERdoi:10.4304/jnw.9.10.2582-2590

L1 =

1 0 · · · · · · 0

l21 1. . .

...

0 l23 1. . .

......

. . . . . . . . . 00 · · · 0 ln,n−1 1

,

U1 =

u11 u12 0 · · · 0

0 u22 u23. . .

......

. . . . . . . . . 0...

. . . . . . un−1,n0 · · · · · · 0 unn

and

L2 =

l11 0 · · · · · · 0

l21 l22. . .

...

0 l32 l33. . .

......

. . . . . . . . . 00 · · · 0 ln,n−1 ln,n

,

U2 =

1 u12 0 · · · 0

0 1 u23. . .

......

. . . . . . . . . 0...

. . . . . . un−1,n0 · · · · · · 0 1

are possible.

In our work, we do it in a opposite direction: We buildinvertible L and U from machine fingprint to get L−1 ,U−1 easily. Moreover,it is easy to obtain T from L andU , T−1 from L−1 and U−1. We use these property inour cryptography.

A machine fingerprint of a computer is a group of datafrom hardware that enables the software to distinguishthe machine from another. Such a fingerprint should beunique and tamperproof. We make use of the fact revealedby Monteiro and Erbacher: The hard disk serial ID thatis hard coded by a manufacturer is the only uniqueparameter than can actually distinguish one system fromanother. The hard drive serial IDs, which are assigned toevery partition on the hard drive, were another parameterthat was considered. However, these IDs can be changedwhen the disk is reformatted. Another parameter that wasconsidered was the CPU ID. A run of an applicationon laboratory systems revealed that all CPU IDs thatbelong to computers ordered in bulk are the same. Themedia access control address of Ethernet adapter was notconsidered as a potential parameter due to the ease bywhich a person with reasonable computer knowledge canchange and even spoof a media access control address ofEthernet adapter. The key used in this case is the hard diskserial ID. This was identified and verified to be unique.Therefore, the hard disk serial ID is the best choice to

make the key of encryption and decryption [17]. The harddisk serial ID can be used as a machine fingerprint.

Our main contributions are: (1) The Hill cipher isenhanced by means of using variable modulus and alge-braic alphabet. (2) The key of the cipher is designed byusing dynamic invertible tridiagonal matrix from machinefingerprint. (3) We use the proposed scheme in the fieldof software copy protection.

The rest of this paper is organized as follows: Section IIbriefly introduces the Hill cipher and some developments.Section III introduces our improvements. A key genera-tion algorithm and a key verification algorithm are shownin Section IV. Experimental results and analysis are givenin Section V and Section VI concludes the paper.

II. HILL CIPHER AND VARIATION

A. The Idea of the Original Hill Cipher

Let A = {a0, a1, · · · , a25} denote any permutation ofthe letters of the English alphabet; and let us associatethe letter ai with the integer i. We define operations ofaddition and multiplication over the alphabet as follows:

ai ⊕ aj = ar , where r = i+ j mod 26 ;

ai � aj = at , where t = ij mod 26 .

As a matter of fact, we define a mapping

σ : A→ Z/26 , ai → [i] ,

where

Z/26 =

{[i]

∣∣∣∣ i ∈ Z, [i] = [j] ⇐⇒ 26|(i− j)}

is the ring of integers mod 26. Then σ is an isomorphismbetween A and Z/26, i.e., σ : A ∼= Z/26. The bi-operational alphabet A is an Abelian ring with zeroletter a0 and unit letter a1. In particular, let ai = i, i =0, 1, · · · , 25 .

Choose an invertible matrix T ∈ An×n over A. Encryptmessages in a block. Suppose Alice and Bob have thesame bi-operational alphabet and matrix T . Alice wantsto send messages x1, x2, · · · , xn to Bob with secure.She puts the messages (plain text) of n letters in ann−demensional vector X ∈ An×1 to encrypt. Computes

Y = TX

then sends Y (cipher text) to Bob. Bob receives Y ,decrypts the cipher text by solving

TX = Y.

As a result, Bob obtains the plain text.

B. Krishna and Madhuravani’s Scheme

The scheme is excerpted from reference [12] as fol-lows:

Consider the plain text, PT such that[KA] * [PT] *[ KB-1] mod n = Cipher text generated.Consider KA, KA-1 as private and public keys of A, KB,

KB-1 as private and public keys of B. and KS as session

JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014 2583

© 2014 ACADEMY PUBLISHER

key to be shared securely among participants A & B. nis a large prime number considered to avoid any cryptoanalytical attacks on it.

Rather transferring the generated Cipher text directly itis converted to multiple Cipher texts. For it, the algorithmuses a Session Key (KS) which is to be shared betweenA & B. To provide for secured sharing of session key KS,it is multiplied with KB-1 to get KSC.| KS| * | KB-1| = KSC.

At B, KSC is multiplied with KB to get backKS| KSC| * | KB| = KS,| KS| * | KB-1| = KSC.At B, KSC is multiplied with KB to get back KS| KSC| * | KB| = KS.A Quinary vector is considered as Global parameter.

The Quinary vector is multiplied with Session key, KS togenerate a sequence. The sequence is divided into basinsequal to number of characters of alphabet considered.For example we are considering 26 characters of Englishlanguage. The sequence is divided into 26 basins, eachcharacters of English language is mapped to random valuefrom corresponding basin values. Thus multiple Ciphertexts will be formed for each output from Hill Cipher.

Methodology to generate Basins:Consider a Quinary vector, a global parameter: Consid-

er a Circulant matrix, KS . Represent the circulant matrixto match with the dimensions of Quinary vector. Multiplythe Quinary vector with circulant matrix and calculatethe modularity of product with 29 and a sequence isgenerated. This sequence is divided into basins of equalvalues equal to the number of characters of alphabetconsidered. Any one value of the basin is consideredrandomly which is mapped with character of Cipher textgenerated from Hill Cipher.

III. PROPOSED SCHEME

Previous schemes belong to singular-table Hill cipher.We are trying to develop a multi-table Hill cipher and useit in our program.

In a computer system, a byte symbol c has an ASCIIvalue ranged from hexadecimal 0 to 0xFF . Let c =0x10 × c1 + c2, both c1 and c2 ranged from 0 to 0xF .AX,AH,AL in assembler language system correspondto the above c, c1, c2. We omit ′0x′ before a hexadecimalnumber for convenience. In this way, information can beexpressed by 16 hexadecimal numbers. For example, wedenote Hello by 48656C6C6F . In other words, computerdata can be denoted by strings. A string can have bothcharacter and hexadecimal styles. Appendix A shows theC functions to convert a string between two styles. Hexizeconverts character to hexadecimal. Conversely, charizedoes the opposite.

Let TB16 = {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F} be theinitial table of 16 elements. Actually, this is an alphabet0f 16 symbols. Next we extend the alphabet:TB17 = TB16 ∪ {z},TB19 = TB17 ∪ {G,H},TB23 = TB19 ∪ {I, J,K,L},

TB29 = TB23 ∪ {M,N,O, P,Q,R},TB31 = TB29 ∪ {S, T, U},TB37 = TB31 ∪ {V,W,X, Y, Z},TB41 = TB37 ∪ {a, b, c, d}.We obtain alphabet of 17,19,23,29,31,37 and 41 suc-

cessively.Next we shuffle each TBp with random permutation

Ppk. In this way, we can define ”as many as we want”different algebraic alphabets of Hill cipher

Ppk(TBp), p = 17, 19, 23, 29, 31, 37, 41;

k = 0, 1, · · · .

Actually, it can reach the maximum 17! + 19! + 23! +29!+31!+37!+41! ≈ 3.35×1049. Moreover, Ppk(TBp)∼= Z/p = Fp ( finite prime fields ).

In practice, an Fp can have multiple choices ofPpk(TBp) and p=43,47,53,59,61 are still available. Thisvariable modulo and algebraic alphabetic scheme is ex-pected to be safe in a registration system of software. Inour system, we make use of dynamic tridiagonal matricesas the core of the enhanced Hill cipher.

Suppose Alice and Bob share the same set ofPpk(TBp)s secretely, Γ is the number of Ppk(TBp)s, theyagree on the same rule to make the choice of Ppk(TBp).Alice wants to send matrix X ∈ TBn×m16 to Bob withsecure. They may do the job as follows:

Step 1: Bob sends a random string s = s0s1 · · · sα,t =t0t1 · · · tβ to Alice;

Step 2: Alice computes

γ =α∑i=0

si mod Γ; (1)

Step 3: Alice locates the γth Ppk(TBp),determines p;Step 4: Alice constructs matrices T,∆ Using s, t.

T = LU ,where

lij =

1, i = j,0, i < j ∨ i > j + 1, (2)a+ b mod p , i = j + 1,

where a = 8

(j−n+i−1∑µ=i

)2

, b =∑

3|(ν−1)tν

if li+1,i = 0,then replaces li+1,i with i+ 1,

uij =

0, i > j ∨ i < j + 1,a+ b mod p , i = j, (3)c+ d+ e mod p , i = j + 1,

where a =

(j−n+i−1∑µ=i

)2

, b =∑3|νtν ,

c = 2

(j−n+i−1∑µ=i

)2

, d = 3j−n+i−1∑µ=i

sµ,

e =∑

3|(ν−2)tν

if uii = 0,then replaces uii with i+ 1,if ui,i+1 = 0,then replaces ui,i+1 with i+ 1,

2584 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014

© 2014 ACADEMY PUBLISHER

Alice computes ∆ = (δij) that has the samesize as X , then she values ∆ by columns fromδ11 to δnm with aλ, where λ = tν mod p,aλ ∈ Ppk(TBp), ν = 0, 1, · · · , β. If ν = β andthere are still δijs to value filled, resets ν = 0,reuses t, then she computes Y = TX + ∆ inthe γth Ppk(TBp);

Step 5: Alice sends Y to Bob;Step 6: Bob computes γ using formula (1), deter-

mines the γth Ppk(TBp) and p;Step 7: Bob computes L,U,∆ in the same way as

Alice does in Step 4;Step 8: Bob computes L−1, U−1 and T−1 =

U−1L−1;Step 9: Bob computes X = T−1(Y −∆).

As a result, Bob obtains the plain text.This scheme can handle all digital information of a

computer system. It is a case sensitive system. A plaintext only uses the 16 letters in TB16, a cipher one mayuse capital letters behide F and lower case letters. If thereare redundant cells in the last column of X , then we fillthem with ′z′s to denote the end of the plain text. becauseplain text only use 0 through F, the redundant tail is easyto be trimmed. Because we use multiple tables in thescheme, we call our scheme a multi-table one.

IV. REGISTRATION SYSTEM

Registration system includes encryption and decryp-tion. The encryption is performed in the seller’s programand the decryption in the buyer’s one.

Both programs agree on the following matters:1) The same Ppk(TBp)s;2) The same rule to choose a Ppk(TBp);3) The same procedure to compute ∆,L,U and T ;4) The same set of preliminary embedded values

which may be ”PROFESSIONAL”,”BASICV ER”,”ENHANCED” and so on.Such values are used by a string ps to control thepermission. These values are totally unknown tothe buyer;

5) The same dimension n of matrix T .Only for the buyer’s program:1) The procedure to collect and submit the buyer’s

machine fingerprint and buyer’s name;2) The procedure to decrypt and verify a registra-

tion key;3) The procedure to convert a string from hex-

adecimal style to character one (see charize inAppendix A).

Only for the seller’s program:1) The procedure to compute L−1,U−1 and T−1 =

U−1L−1;2) The procedure to create a registration key;3) The procedure to convert a string from char-

acter style to hexadecimal one (see hexize inAppendix A).

A. Registration Key Generation

The buyer submits the machine fingerprint s and one’sown name t via network or another tunnel. The seller usess, t to create a registration key reg (encryption).

Input:s = s0s1 · · · sα,t = t0t1 · · · tβOutput:reg ( like xxxxxx− xxxxxx− · · · − xxxxxx

)Algorithm (as shown in Figure 1):Step 1: Converts ps from character style to hexadec-

imal one using function hexize;Step 2: Computes r = l mod n, such that 0 ≤ r <

n,m = (l − r)/n,where l is the length of ps inhexadecimal style;

Step 3: If r > 0, then increases m by 1;Step 4: Creates an n×m matrix Y , fills Y by columns

from y11 to ynm using ps of hexadecimal style,if ps meets its end, then fills the remainder cellsof Y with character ′z′s;

Step 5: Chooses Ppk(TBp) according to s and for-mula (1), determines p;

Step 6: Computes matrices L with formula (2), U withformula (3) according to s, t, then L−1 and U−1

;Step 7: Creates an n×m matrix ∆, fills ∆ by columns

from δ11 to δnm with aλ in the same way asmentioned in Step 4 in last section;, where λ =tν mod p, aλ ∈ Ppk(TBp), ν = 0, 1, · · · , β.If ν = β and there are still δijs to value filled,then resets ν = 0, reuses t.

Step 8: Computes X = T−1(Y −∆);Step 9: Creates a registration key reg like xxxxxx−

· · · − xxxxxx from x11 to xnm;Step 10: Sends reg to the buyer.

B. Registration Key Verification

The buyer receives registration key from the seller vianetwork or another tunnel. The verification (decryption)program collects local machine fingerprint s and demandthe buyer to input name t,registration key reg.

Input: s = s0s1 · · · sα,t = t0t1 · · · tβ , reg likexxxxxx− xxxxxx− · · · − xxxxxx

Output:True/FalseAlgorithm (as shown in Figure 2):Step 1: Chooses Ppk(TBp) according to s, determines

p;Step 2: Computes m = (l−r)/n, where l is the length

of reg except ′−′s;Step 3: Takes elements from reg like xxxxxx −

xxxxxx− · · · − xxxxxx except ′−′. Each ele-ment is in the selected Ppk(TBp);

Step 4: Creates an n×m matrix X , fills X by columnsfrom x11 to xnm using reg;

Step 5: Computes matrices L,U according to s, t;Step 6: Creates an n×m matrix ∆, fills ∆ by columns

from δ11 to δnm with aλ in the same way asmentioned in Step 4 in last section, where λ =tν mod p, aλ ∈ Ppk(TBp), ν = 0, 1, · · · , β. If

JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014 2585

© 2014 ACADEMY PUBLISHER

Figure 1. Registration Key Generation

ν = β and there are still δijs to be filled, thenresets ν = 0, reuses t.

Step 7: Computes Y = TX + ∆;Step 8: Takes elements from Y by columns from y11

to ynm to create a string ps′;Step 9: Trims ps′ by ignoring ′z′s at the end.Step 10: Converts ps′ from hexadecimal style to

character one using function charize.Step 11: Compares ps′ with embedded ps.

V. EXPERIMENTAL RESULTS AND ANALYSIS

Let n = 6. Suppose we have 8 Ppk(TBp)s, denotedin C language by

staticchar ∗ alphabet[ ] = {”152B6E3z74FA09CD8”,”BHEz5629748CG0AFD13”,”4F6B1AG2C57D8JKIL930zEH”,”37RN6E5Q4FAKM0D9zBJ821PHICGLO”,”HCNIMO2PRJ1zG9KA5QD80TBS4FE67L3”,”COS16MKbXY0DPQ2cz9BRa8GZN5E43JV7AUFWLTIdH”,”dFNeCEYP6BzRSZIAVacbfOHJU8G097K3LT4M15XD2WQ”,”V4WK6FEefIaTh0LGzjBRSb8NPOZ5JCUD3HgMdA7Q91iY2Xc”} ;In the list above, each character string stands for a finite

field. For example, inP17,0(TB17)=”152B6E3z74FA09CD8”,we have γ=0,p=17,a0=1,a1=5,a2=2,· · · ,a16=8, where 1

is the zero and 5 is the one. While inP31,0(TB31)=”HCNIMO2PRJ1zG9KA5QD80TBS4FE67L3”,we have γ=4,p=31, a0=H,a1=C,a2=N,· · · ,a30=3,

where H is the zero and C is the one.It seems to bepeculiar, but it is really useful in information security.

Moreover, the possible value of ps is denoted by

staticchar ∗ ps[ ] = {”PROFESSIONAL”,”ENHANCEDVER”,

”BASICVER”,

} ;

we have

ps[0]=”PROFESSIONAL”,ps[1]=”ENHANCEDVER”,ps[2]=”BASICVER”.

Then we do the experiments.

A. Registration Key Generation

Input:s = WD −WCANM3731152,t = Bethoven,ps = PROFESSIONAL

Output:reg=56MMHP-NKKPNO-HLTTS0-O6zS93

Algorithm:

Step 1: Converts ps :PROFESSIONAL

hexsizeGGGGGGGGGGGA50524F46455353494F4E414C

from character style to hexadecimal one usingfunction hexize;

Step 2: Computesr = 24 mod 6 = 0 , m = (24− 0)/6 = 4;

Step 3: ∵ r = 0 ∴ m remains the same;

2586 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014

© 2014 ACADEMY PUBLISHER

Step 4: Creates a 6× 4 matrix Y , fills Y by columnsfrom y11 to ynm using ps of hexadecimal stylesuch that

Y =

5 4 5 40 6 3 E5 4 4 42 5 9 14 5 4 4F 3 F C

Step 5: Chooses P31,0(TB31) according to s = WD−

WCANM3731152, determines p = 31;Step 6: Computes matrices L,U,L−1, U−1 accord-

ing to s = WD − WCANM3731152, t =Bethoven,

L =

C H H H H HC C H H H HH N C H H HH H I C H HH H H M C HH H H H O C

,

U =

C C H H H HH N N H H HH H I I H HH H H M M HH H H H O OH H H H H 2

,

L−1 =

C H H H H H3 C H H H HN L C H H HF 2 7 C H H4 P G 6 C HM 6 N 0 E C

,

U−1 =

C A T S F OH 5 1 R 2 EH H T S F OH H H R 2 EH H H H F OH H H H H E

,

T−1 = U−1L−1

=

K D K S H OD 9 Q R H E7 I K S H OK Q P R H EH H H H H Oz 0 T 4 F E

;

Step 7: Computes matrix ∆ according to t,

∆ =

M R D SR Q F zS M R Dz R Q FD S M RF z R Q

;

Step 8: Computes X = T−1(Y −∆),

X =

5 N H O6 K L 6M K T zM P T SH N S 9P O 0 3

;

Step 9: Obtainsreg=56MMHP-NKKPNO-HLTTS0-O6zS93from X;

Step 10: Sends reg to the buyer.

B. Registration Key Verification

Input: s = WD−WCANM3731152, t = Bethoven,ps = PROFESSIONAL ,reg=56MMHP-NKKPNO-HLTTS0-O6zS93Output: True/FalseAlgorithm:Step 1: Chooses P31,0(TB31) according to s = WD−

WCANM3731152, determines p = 31;Step 2: Computes r = 24 mod 6 = 0 , m = (24 −

0)/6 = 4, where 24 is the length of reg except′−′s;

Step 3: Takes elements from reg except ′−′. Eachelement is in the selected P31,0(TB31);

Step 4: Creates an n×m matrix X , fills X by columnsfrom x11 to xnm using reg,

X =

5 N H O6 K L 6M K T zM P T SH N S 9P O 0 3

;

Step 5: Computes matrices L,U according to

s = WD−WCANM3731152 , t = Bethoven ,

L =

C H H H H HC C H H H HH N C H H HH H I C H HH H H M C HH H H H O C

,

U =

C C H H H HH N N H H HH H I I H HH H H M M HH H H H O OH H H H H 2

,

T =

C C H H H HC I N H H HH M P I H HH H J 9 M HH H H 5 T OH H H H F H

;

JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014 2587

© 2014 ACADEMY PUBLISHER

Figure 2. Registration Key Verification

Step 6: Computes matrix ∆,

∆ =

M R D SR Q F zS M R Dz R Q FD S M RF z R Q

;

Step 7: Computes Y = TX + ∆ according to t,

Y =

5 4 5 40 6 3 E5 4 4 42 5 9 14 5 4 4F 3 F C

Step 8: Takes elements from Y by columns from y11

to ynm to create a string ps′;Step 9: Trims ps′ by ignoring ′z′s at the end. In this

case, there is nothing to trim.Step 10: Converts ps′:

50524F46455353494F4E414C

charizeGGGGGGGGGGGA PROFESSIONAL

from hexadecimal style to character one usingfunction charize;

Step 11: Compares ps′ with embedded ps. In this case,the comparison is successful.

C. Analysis of the Scheme to Protect Software Copy

In section III, Y = TX+ ∆ is the encryption formula,while X = T−1(Y −∆) is the decryption one. However,in the application of software copy protection ( Section IVand V ), the formulae are exchanged in both algorithms

for the sake of security. The procedure for T only needsL and U , but that one for T−1 needs L,U ,L−1 and U−1.Formula Y = TX + ∆ leads to the least necessary inter-mediate results for registration. The protection scheme isreasonable.

In the scheme of ordinary Hill cipher, there is onlyone table and a fixed modulus. In our scheme, Thereare multiple tables and modulus is changeable. Therefore,Hill cipher is enhanced by our method of using variablemodulus and algebraic alphabet. The use of machinefingerprint makes it rather difficult for a unauthorized userwho may obtain a registration key from a registered buyerto use the software. This scheme prevents a legal buyersharing a registration key with an unauthorized person,because machine fingerprint is unique and tamperproofand the verification program gets the hard ID directly fromthe machine.

More experimental results show that the scheme ispractical ( see Appendix B ).

VI. CONCLUSION AND FUTURE WORK

We use dynamic tridiagonal matrix from the machinefingerprint and the buyer’s name in an enhanced Hillcipher. The variable modulus and alphabet makes thecipher more secure. We use this new cipher to protectsoftware copy. Our encryption depends on the matricesdynamically generated from the machine fingerprint andthe buyer’s name. Thus, the encryption key varies ondifferent computers. This prevents any legal buyer sharinga registration key with any unauthorized person. Therelationship between information submitted by the buyerand the registration key is not of plain text and ciphertext. This scheme is deceptive to an adversary who wantsto compute the registration key. Experimental results and

2588 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014

© 2014 ACADEMY PUBLISHER

analysis illustrate that the algorithm is viable and se-cure. We consider combining Krishna and Madhuravani’smethod with our multi-table scheme to obtain a better onein the future.

ACKNOWLEDGMENTS

The author is grateful to the editors and reviewers fortheir valuable comments and suggestions to improve thepresentation of this paper.This work was supported in partby the fund from Natural Science of Jiangxi Provinceof China under Grant No.20114BAB201033. The authorwould like to express thanks to the Committee of the fund.

REFERENCES

[1] Copy protection for computer software,http://en.wikipedia.org/wiki/Copy protection; 2012.

[2] Hill L.S. Cryptography in an algebraic alphabet. Am. Math.Month 1929; 36(6):306 - 312.

[3] Hill L.S. Concerning certain linear transformation appara-tus of cryptography. The American Mathematical Monthly1931; 38:135 - 154.

[4] Saeednia, S. How to make the Hill cipher secure? Cryptolo-gia 2000; 24(4):353 - 360.

[5] Overbey J, Traves W, Wojdylo J. On the Keyspace of theHill Cipher. Cryptologia 2005; 29(1):59 -72.

[6] Stinson DR. Cryptography Theory and Practice. Chapman& Hall/CRC, 2006.

[7] Lin CH, Lee CY, Lee CY. Comments on Saeednia’s im-proved scheme for the Hill cipher. Journal of the Chineseinstitute of engineers 2004; 27: 743-746.

[8] Ismail I.A, Amin M, Diab H. How to repair the Hill cipher.J. Zhejiang Univ. Sci. A 2006; 7(12):2022 - 2030.

[9] Rangel-Romero Y, Vega-Garcıa R,Menchaca-Mendez A,Acoltzi-Cervantes D, Martınez-Ramos L, MecatezambranoM, Montalvo-Lezama F, Barron-vidales J, Cortez-Duarte N,Rodrıguez-Henrıq F. Comments on ”How to repair the Hillcipher”. Zhejiang Univ Sci. A 2008; 9(2):211 - 214.

[10] Toorani M, Falahati A. A Secure Cryptosystem based onAffine Transformation. Journal of Security and Communi-cation Networks, 2011; 4(2): 207 - 215.

[11] Liam Keliher and Anthony Z. Delaney,Cryptanalysis of theToorani-Falahati Hill Ciphers,Computers and Communica-tions (ISCC), 2013 IEEE Symposium on , 436-440. .

[12] Prof. A.V.N.Krishna and K.Madhuravani,A Modified HillCipher using Randomized Approach,I. J. Computer Net-work and Information Security, 2012;5: 56-62.

[13] Ranjan K.M. The inverse of a tridiagonal matrix.LinearAlgebra and its Applications 2001; 325: 109 - 139.

[14] Moawwad E.A, El-Mikkawy. On the inverse of a generaltridiagonal matrix. Applied Mathematics and Computation2004; 150: 669 - 679.

[15] Emrah Kılıc. Explicit formula for the inverse of a tridi-agonal matrix by backward continued fractions. AppliedMathematics and Computation 2008; 197: 345 - 357.

[16] Ahmed D.A.H, Mohamed E. A fast numerical algorithmfor the inverse of a tridiagonal and pentadiagonal ma-trix.Applied Mathematics and Computation 2008; 202:441- 445.

[17] Monteiro S.D.S, Erbacher R.F. Exemplifying Attack I-dentification and Analysis in a Novel Forensically ViableSyslog Model. In: Proceedings of the Third InternationalWorkshop on Systematic Approaches to Digital ForensicEngineering, Washington, USA 2008; 57 - 68.

Ning Huang , born in 1958, received hisMaster’s degree in applied mathematics andcomputer science from Jiangxi University, Chi-na in 1991, awarded senior engineer of theIndustrial and Commercial Bank (ICBC) ofChina in 2001. He is now with Center ofModern Educational Technology, Gannan Nor-mal University,Ganzhou, China,as an associateprofessor. His research interests include infor-mation security and digital campus.

JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014 2589

© 2014 ACADEMY PUBLISHER

Appendix A: Conversion between Character andHexadecimal

//Character to Hexadecimalchar ∗ hexize(char ∗ s){

char ∗ t;int i = 0, j;//Doubles the lengtht = (char ∗)malloc(2 ∗ strlen(s));for(∗s; ∗s; s+ +){

//Converts the typeif(∗s < 0x10)

sprintf(t+ 2 ∗ i, ”0%X”, ∗s);else

sprintf(t+ 2 ∗ i, ”%X”, ∗s);i+ +;

}return t;

}// Hexadecimal to Characterchar ∗ charize(char ∗ s){

char ∗ t;int i = 0, j;//Reduces the length by halft = (char ∗)malloc(strlen(s)/2 + 1);for(∗(s+ i); ∗(s+ i); i = i+ 2){

//Fetches in pairssscanf(s+ i, ”%2X”,&j);//Converts the type∗(t+ i/2) = (char)j;

}return t;

}Appendix B: More Numerical Experimental ResultsMore Numerical experimental results are shown as

follows, where ps is the storage of permission string,sis the storage of buyer’s name,t is the storage of machinefingerprint,reg is the storage of registration key.

ps=PROFESSIONALs=Alice,t=97LET9BT,P31,0(TB31),p=31,reg=MJD3Q7-RCNH91-A0TNI0-QC3R2E

ps=PROFESSIONALs=Northwind,t=0000000000268CDC45D639EA,

P47,0(TB47),p=47,reg=EAaf6D-hObaOE-1Tb74D-gUKOce

ps=PROFESSIONALs=Venus,t=0000000000268CDC45D639EB,

P17,0(TB17),p=17,reg=S96A05A-8A8C48-8AE07D-3EAFAz

ps=PROFESSIONALs=Sunlin,t=S07GJ1LYC22164 P29,0(TB29),p=29reg=82AMJ3-RA37PJ-NQRAEN-O0MLHJ

ps=PROFESSIONALs=Tim,t=6RYL53LY, P23,0(TB23),p=23

reg=KBB9AK-DzA6EI-272BE7-08DK0z

ps=PROFESSIONALs=Grace,t=5VP0567Q, P43,0(TB43),p=43reg=bTEDKR-c370eY-Vz72BV-QH0z0I

ps=ENHANCEDVERs=Bob,t=97LET9BT, P31,0(TB31),p=31reg=C8C0RJ-11PDC0-EFEEQH-JzJ332

ps=ENHANCEDVERs=Yellowriver,t=0000000000268CDC45D639EA,

P47,0(TB47),p=47reg=UNDBcJ-FNO0e7-egcDGX-G8fA2U

ps=ENHANCEDVERs=Bethoven,t=0000000000268CDC45D639EB,

P17,0(TB17),p=17reg=D97238-F172AA-582116-76D749

ps=ENHANCEDVERs=Tiger,t=S07GJ1LYC22164, P29,0(TB29),p=29reg=9CQCI7-K4DN6O-R8ANDP-JERKKH

ps=ENHANCEDVERs=Ashier,t=6RYL53LY, P23,0(TB23),p=23reg=DLE7zD-97JGA1-14K96z-EGCBDz

ps=ENHANCEDVERs=Slong,t=5VP0567Q, P43,0(TB43),p=43reg=VOROQM-K8D6J2-YeQCfc-N62UKM

ps=BASICVERs=Catteam,t=97LET9BT, P31,0(TB31),p=31reg=S6zz27-QBJRNR-QID3Nz

ps=BASICVERs=Faith,t=0000000000268CDC45D639EA,

P47,0(TB47),p=47reg=ddRLg3-dIUF6G-5abEIW

ps=BASICVERs=Mecury,t=0000000000268CDC45D639EB,

P17,0(TB17),p=17reg=A36DD8-A35E40-CBD28z

ps=BASICVERs=Belinsky,t=S07GJ1LYC22164, P29,0(TB29),p=29reg=QPA76H-AQ62IM-H22FRE

ps=BASICVERs=Steve,t=6RYL53LY, P23,0(TB23),p=23reg=DE871D-z6K6LH-682G56

ps=BASICVERs=Deck,t=5VP0567Q, P43,0(TB43),p=43reg=GG8dSX-zR8VIW-eYHYRB

2590 JOURNAL OF NETWORKS, VOL. 9, NO. 10, OCTOBER 2014

© 2014 ACADEMY PUBLISHER