Variable-key cryptography system5619576Abstract Binary data is encrypted or decrypted using a final key. The final key is formed by manipulating one or more user keys, a base key and a block of data, and combining the manipulated keys and data using an exclusive-OR operation. The data to be encrypted or decrypted are combined with the final key using a circular exclusive-OR operation. A new final key is formed for each block of data. The user and base keys are binary sequences having any number of bits. The user key may be input to the present invention directly in binary form or in any other suitable form that the present invention can interpret as a binary sequence, such as a string of ASCII-encoded alphanumeric characters. Manipulating the user key includes the steps of shuffling or permuting segments of the user key, such as bytes, circularly shifting the permuted user key by a number of bit positions, and filling a location with one or more copies of the permuted and shifted key such that the result has a length equal to that of the base key. The ordering of the segments of the user key in the permutation step and the number of bit positions by which the user key is shifted in the shifting step are determined in response to the value and position of the segments of the user key itself. Manipulating the base key includes the step of circularly shifting the base key by a number of bit positions that is determined in response to the value and position of segments of the user key. Claims I claim: Description BACKGROUND OF THE INVENTION
______________________________________
"0100 1001 0100 0001 0100 0010 0110 1110 0110 0111
0100 1001",
______________________________________
where the 41st bit is underlined for emphasis. Shifted 41 places to the left, the key becomes:
______________________________________
"0100 1001 0100 1001 0100 0001 0100 0010 0110 1110
0110 0111".
______________________________________
At step 56 processor 18 circularly shifts the bits of the base key in a direction from the less significant bits toward the more significant bits (leftward in the drawing). The number of places by which the base key is shifted is equal to the shift factor S modulo the length of the base key expressed in units of bits, plus one. The base key is a digital word of any suitable length. It is preferred that the base key be accessible by processor 18 but not readable or changeable by a user. The base key is preferably used in a manner similar to a serial number and thus set to a fixed value. It may be hard-wired into the system as a software or firmware constant. As described above with respect to the user key, the base key need not be encoded using ASCII or any other encoding scheme, but may be so encoded for convenience. It may be convenient to use an alphanumeric character string that has been ASCII-encoded as a base key if, for example, it is desired for users or other personnel to change the base key from time to time. A base key could, for example, be expressed by the ASCII-encoded character string "ImportantInformation". The length of this base key is 20 bytes or 160 bits. Although this base key is sufficient for illustrative purposes, a base key having a length of at least 256 bytes is preferred. A shift factor of 125704 modulo 160, plus one, equals 105. The 105th bit thus becomes the first or most significant bit. Before shifting, the base key "ImportantInformation" can be expressed in hexadecimal as: "49 6D 70 6F 72 74 61 6E 74 49 6E 66 6F 72 6D 61 74 69 6F 6E" or in binary as:
______________________________________
"0100 1001 0110 1101 0111 0000 0110
1111 0111 0010 0111
0100 0110 0001 0110 1110 0111 0100
0100 1001 0110 1110
0110 0110 0110 1111 0111 0010 0110
1101 0110 0001 0111
0100 0110 1001 0110 1111 0110 1110",
______________________________________
where the 105th bit is underlined for emphasis. Shifted 105 places to the left, the key becomes:
______________________________________
"0111 0010 0110 1101 0110 0001 0111
0100 0110 1001 0110
1111 0110 1110 0100 1001 0110 1101
0111 0000 0110 1111
0111 0010 0111 0100 0110 0001 0110
1110 0111 0100 0100
1001 0110 1110 0110 0110 0110 1111".
______________________________________
At step 58 processor 18 circularly fills the permuted and shifted actual user key. This filling step extends the length of the actual user key to equal that of the base key if the base key is longer than the actual user key. (The filling is circular because, if the base key is longer than the user key, the user key is duplicated and the copies are appended to one another.) If the length of the base key is not an even multiple of the length of the user key, the less significant bits of the user key may be truncated. For example, if the base key has a length of 160 bits, a user key having a length of 48 bits must be duplicated three times. The three copies and the original are appended together and the result is truncated to 160 bits. Using the permuted and shifted actual user key from the example above, the filled user key becomes:
______________________________________
"0100 1001 0100 1001 0100 0001 0100
0010 0110 1110 0110
0111 0100 1001 0100 1001 0100 0001
0100 0010 0110 1110
0110 0111 0100 1001 0100 1001 0100
0001 0100 0010 0110
1110 0110 0111 0100 1001 0100 1001".
______________________________________
At step 60 processor 18 forms the exclusive-OR of this key and the shifted base key. Using the keys from the example above, the results of the exclusive-OR operation (.sym.) are:
______________________________________
"0100 1001 0100 1001 0100 0001 0100
0010 0110 1110 0110
.sym.
"0100 1001 0110 1101 0111 0000 0110
1111 0111 0010 0111
0000 0000 0010 0100 0011 0001 0010
1101 0001 1100 0001
0111 0100 1001 0100 1001 0100 0001
0100 0010 0110 1110
.sym.
0100 0110 0001 0110 1110 0111 0100
0100 1001 0110 1110
0011 0010 1000 0010 0111 0011 0101
0000 1011 0000 0000
0110 0111 0100 1001 0100 1001 0100
0001 0100 0010 0110
.sym.
0110 0110 0110 1111 0111 0010 0110
1101 0110 0001 0111
0000 0001 0010 0110 0011 1011 0010
1100 0010 0011 0001
1110 0110 0111 0100 1001 0100 1001"
(user key)
.sym.
0100 0110 1001 0110 1111 0110 1110"
(base key)
1010 0000 1110 0010 0110 0010 0111
(resulting key)
______________________________________
The resulting key, however, is preferably not the final key that is used to encrypt or decrypt data. Rather, an additional randomization may be performed at step 62. At step 62 processor 18 forms the final key by combining this semifinal key with the shift factor S that was calculated above at step 52. To combine the semifinal key with the shift factor S, processor 18 calculates the circular exclusive-OR of the shift factor S, expressed as a four byte word, and the semifinal key. (The exclusive-OR operation is circular because, if the length of the shift factor is less than that of the semifinal key, the shift factor is duplicated and the copies are appended to one another to extend the length of the shift factor to equal that of the semifinal key.) The shift factor from the above example, 125704, can be expressed in binary as:
______________________________________
"0000 0000 0000 0001 1110 1011 0000 1000".
______________________________________
The result of the exclusive-OR operation (.sym.) between this shift factor, circularly extended to 160 bits, and the semifinal key is:
______________________________________
"0000 0000 0010 0100 0011 0001 0010
1101 0001 1100 0001
.sym.
"0000 0000 0000 0001 1110 1011 0000
1000 0000 0000 0000
0000 0000 0010 0101 1101 1010 0010
0101 0001 1100 0001
0011 0010 1000 0010 0111 0011 0101
0000 1011 0000 0000
.sym.
0001 1110 1011 0000 1000 0000 0000
0000 0001 1110 1011
0010 1100 0011 0010 1111 0011 0101
0000 1010 1110 1011
0000 0001 0010 0110 0011 1011 0010
1100 0010 0011 0001
.sym.
0000 1000 0000 0000 0000 0001 1110
1011 0000 1000 0000
0000 1001 0010 0110 0011 1010 1100
1111 0010 1011 0001
1010 0000 1110 0010 0110 0010 0111"
(semifinal key)
.sym.
0000 0000 0001 1110 1011 0000 1000"
(shift factor)
1010 0000 1111 1100 1101 0010 1111
(final key)
______________________________________
Key manipulation is essentially complete after processor 18 performs step 62. However, processor 18 may mask one or more bits of each byte of the final key if the data to be encrypted or decrypted is more conveniently expressed in words having a length less than one byte. Processor 18 loads the final key into mask memory 14. At step 64 exclusive-OR circuit 10 receives a byte of data to be encrypted or decrypted from the external device 13 The via interface 12. Control logic 22 receives an indication that the data byte has been transferred. If the external device 13 to which interface 12 is connected is a computer, this indication may be the activation of the WRITE line of the computer. The first byte of the final key appears at the output of mask memory 14 in response to the address present at the output of address counter 16. At step 66 exclusive-OR circuit 10 performs an exclusive-OR operation on the data byte and the byte of the final key that appears at the output of mask memory 14. External device 13 may receive the result of this operation, which is the encrypted or decrypted data byte, via interface 12. If the external device 13 to which interface 12 is connected is a computer, address counter 16 may increment its address in response to the activation of the READ line of the computer. If processor 18 receives an indication at step 68 via interface 12 that no more data bytes are to be encrypted or decrypted, the process ends and processor 18 awaits an indication that will cause it to begin processing again at step 24. If processor 18 receives no such indication, exclusive-OR circuit 10 waits to receive another data byte to be encrypted or decrypted at step 64. The exclusive-OR operation is circular because address counter 16 returns to the address of the first byte of the final key in mask memory 14 immediately after the address of the last byte of the final key. The data to be encrypted could, for example, be expressed by the ASCII-encoded string "Secret Message". This data can be expressed in hexadecimal as: "53 65 63 72 65 74 20 4D 65 73 73 61 67 65" or in binary as:
______________________________________
"0101 0011 0110 0101 0110 0011 0111 0010 0110 0101
0111 0100 0010 0000 0100 1101 0110 0101 0111 0011
0111 0011 0110 0001 0110 0111 0110 0101".
______________________________________
At step 66 processor 18 forms the circular exclusive-OR of this data and the final key. Using the final key from the example above, the results of this exclusive-OR operation (.sym.) are:
______________________________________
"S e c r e
"0101 0011 0110 0101 0110 0011 0111
0010 0110 0101 0111
.sym.
"0000 0000 0010 0101 1101 1010 0010
0101 0001 1100 0001
"0101 0011 0100 0000 1011 1001 0101
0111 0111 1001 0110
t -- M e s s
0100 0010 0000 0100 1101 0110 0101
0111 0011 0111 0011
.sym.
0010 1100 0011 0010 1111 0011 0101
0000 1010 1110 1011
0110 1110 0011 0110 0010 0101 0000
0111 1001 1001 1000
a g e" (data -
alphanumeric)
0110 0001 0110 0111 0110 0101"
(data -
ASCII encoded)
.sym.
1010 0000 1111 1100 1101 0010"
(final key)
1100 0001 1001 1011 1011 0111"
(encrypted data)
______________________________________
Although the exclusive-OR is circular, the final key is not duplicated in this example because the length of the data to be encrypted is less than that of the final key. The encrypted data can be expressed in hexadecimal as: "52 40 B9 57 79 66 E3 62 50 79 98 C1 9B B7" or as the ASCII-encoded character string: "R@9WyfSbPy<CAN>A<ESC>7" The encrypted character string not only bears no resemblance to the original string "Secret Message", but the encrypted data differs greatly from the original data even when the two strings are expressed in binary or other notations. More importantly, if the user key or base key used in the above-described example were to be changed even by as little as a single bit, the encrypted data would differ greatly from the encrypted data shown above. Conversely, if a user key closely resembling the user key "IBAInc" but differing by as little as a single bit were used to decrypt this string, the decrypted data would not resemble the original data, regardless of whether the data are compared as strings of ASCII characters or bits. An alternative algorithm for encrypting and decrypting data is illustrated in FIG. 3. This algorithm includes additional steps that provide additional security. The additional steps form the final key not only in response to the user and base keys but also in response to the data itself. Steps 70-104 of the algorithm of this embodiment correspond exactly to steps 24-58 of the algorithm of the embodiment described above. Processor 18 performs steps 70-104 of this algorithm in a manner identical to that in which it performs steps 24-58 of the algorithm illustrated in FIG. 2. Therefore, only the steps that differ from those in the above-described embodiment, steps 106-124, will be described in detail with respect to this embodiment. At step 106 processor 18 permutes the circularly-shifted base key. The permutation is performed in a pseudorandom manner similar to that in which the input user key is permuted at step 36 of the first embodiment (and at corresponding step 82 of this embodiment). In the permutation at step 106, however, the bytes of the base key are not only shuffled in response to the value and positional weight of its own bytes but also in response to the value and positional weight of the circularly-shifted and filled actual user key bytes. The permutation step can be expressed as follows, where the circularly-shifted base key is represented by the variable KEYB, the ith byte of KEYB is represented by KEYB.sub.i, the circularly-shifted and filled actual user key is represented by the variable KEYA, the ith byte of KEYA is represented by KEYA.sub.i, and N is the length of keys KEYA and KEYB in bytes: L=((KEYA.sub.i-1 +KEYA.sub.i +KEYA.sub.i+1 +KEYB.sub.i-1 +KEYB.sub.i +KEYB.sub.i+1 +i)modulo N)+1. For i=2, 3, 4, . . . N-1, swap KEYB.sub.i with KEYB.sub.L. Using the base key and user key from the example described above with respect to the first embodiment, the circularly-shifted base key that is produced at step 56 of that embodiment (KEYB) may be expressed in decimal notation as: "114 109 97 116 105 111 110 73 109 112 111 114 116 97 108 116 73 110 102 111". Similarly, the circularly-shifted and filled actual user key that is produced at step 58 of that embodiment (KEYA) may be expressed in decimal notation as: "73 73 65 66 110 103 73 73 65 66 110 103 73 73 65 66 110 103 73 73". To permute the base key, processor 18 performs the following 18 swaps in accordance with the above method:
______________________________________
i L bytes swapped
______________________________________
2 16 2nd and 16th
3 10 3rd and 10th
4 4 4th and 4th
5 17 5th and 17th
6 19 6th and 19th
7 11 7th and 11th
8 12 8th and 12th
9 8 9th and 8th
10 4 10th and 4th
11 8 11th and 8th
12 20 12th and 20th
13 7 13th and 7th
14 1 14th and 1st
15 15 15th and 15th
16 16 16th and 16th
17 10 17th and 10th
18 12 18th and 12th
______________________________________
The permuted base key is thus (in decimal):
______________________________________
"108 116 112 97 73 102 97 110 114 110 109 111 116
111 109 105 114 116 111 73".
______________________________________
At step 108 processor 18 forms the exclusive-OR of this permuted base key and the circularly-shifted and filled actual user key. The exclusive-OR operation (.sym.) between these two keys, showing the resulting semifinal key, is (in hexadecimal notation):
______________________________________
"6C 74 70 61
49 66 61
6E 72 6E 6D 6F 74
6F 6D
.sym.
"49 49 41 42 6E 67 49 49 41 42 6E 67 49 49
41
"25 3D 21 23 27 01 28 27 33 2C 03 08 3D 26
2C
69 72 74 6F
49" (base key)
.sym.
42 6E 67 49
49" (user key)
2B 1C 13 26
00" (semifinal key)
______________________________________
At step 110 processor 18 determines invariant bits. Invariant bits are bits of the data to be encrypted or decrypted that remain unchanged after the algorithm is applied, i.e., after unencrypted data is encrypted or after encrypted data is decrypted. The number of invariant bits is N, where N is the length of the semifinal key in bytes. To determine the invariant bits, processor 18 generates a set of invariant bit position indices in a pseudorandom manner in response to the values and positional weights of the semifinal key bytes. A first index, X.sub.i, indicates the byte of the semifinal key in which the ith invariant bit is positioned, and a second index, Y.sub.i, indicates the bit position within that byte of the ith invariant bit. Two indices are preferred over a single index because it facilitates memory addressing by processor 18. Typically, a processor cannot address individual bits within a, for example, 200 byte word using a single number. If, however, the processor or other computational means is capable of addressing individual bits within an N-byte semifinal key using a single number, that number would be a suitable index. The first bit of the first byte and the last bit of the last byte of the semifinal key are always invariant in the illustrated embodiment. The corresponding invariant bit position indices are: X.sub.1 =1, Y.sub.1 =1, X.sub.N =N, and Y.sub.N =8. The remaining invariant bit position indices are calculated as follows: For i=2, 3, 4, . . . N-1: PI=(KEYA.sub.i-1 +KEYA.sub.i +KEYA.sub.i+1 +255+i)*KEYA.sub.i. IND=(PI modulo (N*8))+1; X.sub.i =INT((IND-1)/8)+1; and Y.sub.i =((IND-1) modulo 8)+1. where IND is a single-number invariant bit position index, and INT is a function that returns the integer portion of its argument. Using the semifinal key in the above example:
______________________________________
i PI (decimal)
IND X.sub.i, Y.sub.i
______________________________________
1 -- 1 X.sub.1 = 1, Y.sub.1 = 1
2 23688 9 X.sub.2 = 2, Y.sub.2 = 1
3 12771 132 X.sub.3 = 17, Y.sub.3 = 4
4 12810 11 X.sub.4 = 2, Y.sub.4 = 3
5 13065 106 X.sub.5 = 14, Y.sub.5 = 2
6 341 22 X.sub.6 = 3, Y.sub.6 = 6
7 13680 81 X.sub.7 = 11, Y.sub.7 = 1
8 14703 144 X.sub.8 = 18, Y.sub.8 = 8
9 13370 91 X.sub.9 = 12, Y.sub.9 = 3
10 15268 69 X.sub.10 = 9, Y.sub.10 = 5
11 963 4 X.sub.11 = 1, Y.sub.11 = 4
12 2712 153 X.sub.12 = 20, Y.sub.12 = 1
13 22875 156 X.sub.13 = 20, Y.sub.13 = 4
14 15656 137 X.sub.14 = 18, Y.sub.14 = 1
15 17380 101 X.sub.15 = 13, Y.sub.15 = 5
16 16598 119 X.sub.16 = 15, Y.sub.16 = 7
17 10136 57 X.sub.17 = 8, Y.sub.17 = 1
18 6802 83 X.sub.18 = 11, Y.sub.18 = 3
19 12578 99 X.sub.19 = 13, Y.sub.19 = 3
20 -- 160 X.sub.20 = 20, Y.sub.20 = 8
______________________________________
At step 112 processor 18 uses the invariant bit indices to generate an invariant bit mask. The invariant bit mask has a length equal to that of the semifinal key and has a "0" in the invariant bit positions and a "1" in all other bit positions. An invariant bit mask variable, IV.sub.j, represents the jth byte of the invariant bit mask. To form the invariant bit mask variables, IV.sub.1 through IV.sub.N, processor 18 performs the following calculation: Initialize IV.sub.1 through IV.sub.N to "11111111"; For j=X.sub.1 . . . X.sub.N : For i=1, 2, 3 . . . N, IV.sub.j =IV.sub.j AND (NOT MASK.sub.i); where MASK.sub.1 ="10000000"; MASK.sub.2 ="01000000"; MASK.sub.3 ="00100000"; MASK.sub.4 ="00010000"; MASK.sub.5 ="00001000"; MASK.sub.6 ="00000100"; MASK.sub.7 ="00000010"; and MASK.sub.8 ="00000001". Using the byte and bit indices X.sub.i and Y.sub.i from the example above, the resulting invariant bit mask bytes are:
______________________________________
j IV.sub.j
______________________________________
1 01101111
2 01011111
3 11111011
4 11111111
5 11111111
6 11111111
7 11111111
8 01111111
9 11110111
10 11111111
11 01011111
12 11011111
13 11010111
14 10111111
15 11111101
16 11111111
17 11101111
18 01111110
19 11111111
20 01101110
______________________________________
At step 114 processor 18 reads a block of digital data in any suitable manner. Unlike the embodiment described above with respect to FIG. 2, in the present embodiment, further randomization is performed using the input data itself as a basis. Processor 18 processes the data sequentially in blocks, each block having a length equal to that of the semifinal key. At step 116 processor 18 picks up or extracts the bits from the data block that are in the invariant bit positions and appends the successively copied bits to one another to form an invariant key. The invariant bit mask is used to append the bits together. The invariant key is calculated as follows, where KEYC.sub.i represents the ith byte of the invariant key and DATA.sub.j represents the jth byte of the data block received: Initialize KEYC.sub.1 through KEYC.sub.N to zero; For i=1, 2, 3 . . . N: U=INT((i-1)/8)+1; V=((i-1) modulo 8)+1; j=X.sub.i ; k=Y.sub.i ; If (DATA.sub.j AND MASK.sub.k) is not equal to zero, then KEYC.sub.U =KEYC.sub.U OR (MASK.sub.V). The following invariant key byte are obtained using the invariant bit indices from the example above and the data (the character string "Secret Message") provided in the example described with respect to the embodiment of FIG. 3: KEYC.sub.1 =00011000 KEYC.sub.2 =10100000 KEYC.sub.3 =01100000 In the above example, the first invariant bit position is the first bit of the first byte, as indicated by X.sub.1 =1 and Y.sub.1 =1. The first byte of data is "01010011", which represents the ASCII-encoded character "S", and the first bit of that byte is "0". This bit forms the first bit of the invariant key. The second invariant bit position is the first bit of the second byte, as indicated by X.sub.2 =2 and Y.sub.2 =1. The second byte of data is "01100101", which represents the character "e", and the first bit of that byte is "0". This bit forms the second bit of the invariant key. The procedure continues in this fashion until all 20 invariant bit indices have been examined. The resulting invariant key has 20 bits, which are expressed above as three bytes, with the last byte having zeros in bit positions five through eight. At step 118, processor 18 circularly fills the invariant key with the first INT(N/8) bytes of the invariant key. If N is not evenly divisible by eight, however, processor 18 circularly fills the invariant key with the first INT(N/8)+1 bytes of the invariant key. In the example above, N has a value of 20, which is not evenly divisible by eight. Therefore, the first three bytes are used to fill the invariant key. Using the invariant key bytes KEYC.sub.1, KEYC.sub.2 and KEYC.sub.3 from the example above, the filled invariant key is: KEYC.sub.1 =00011000 KEYC.sub.2 =10100000 KEYC.sub.3 =01100000 KEYC.sub.4 =00011000 KEYC.sub.5 =10100000 KEYC.sub.6 =01100000 KEYC.sub.7 =00011000 KEYC.sub.8 =10100000 KEYC.sub.9 =01100000 KEYC.sub.10 =00011000 KEYC.sub.11 =10100000 KEYC.sub.12 =01100000 KEYC.sub.13 =00011000 KEYC.sub.14 =10100000 KEYC.sub.15 =01100000 KEYC.sub.16 =00011000 KEYC.sub.17 =10100000 KEYC.sub.18 =01100000 KEYC.sub.19 =00011000 KEYC.sub.20 =10100000 At step 120 processor 18 calculates the final key. The final key is the exclusive-OR of the semifinal key and the invariant key, masked by the invariant bit mask: For i=1, 2, 3 . . . N, FINALKEY.sub.i =(KEYA.sub.i XOR KEYC.sub.i) AND IV.sub.i. Using the values in the example above, the results of this calculation are:
______________________________________
(semfinal "0010 0101 0011 1101 0010 0001 0010 0011
key)
(invar. key)
.sym. "0001 1000 1010 0000 0110 0000 0001 1000
"0011 1101 1001 1101 0101 0001 0011 1011
(invar. mask)
& "0110 1111 0101 1111 1111 1011 1111 1111
(final key) "0010 1101 0001 1101 1101 0001 0011 1011
0010 0111 0000 0001 0010 1000 0010 0111
.sym. 1010 0000 0110 0000 0001 1000 1010 0000
1000 0111 0110 0001 0011 0000 1000 0111
& 1111 1111 1111 1111 1111 1111 0111 1111
1000 0111 0110 0001 0011 0000 0000 0111
0011 0011 0010 1100 0000 0011 0000 1000
.sym. 0110 0000 0001 1000 1010 0000 0110 0000
0101 0011 0011 0100 1010 0011 0110 1000
& 1111 0111 1111 1111 0101 1111 1101 1111
0101 0011 0011 0100 0000 0011 0100 1000
0011 1101 0010 0110 0010 1100 0010 1011
.sym. 0001 1000 1010 0000 0110 0000 0001 1000
0010 0101 1000 0110 0100 1100 0011 0011
& 1101 0111 1011 1111 1111 1101 1111 1111
0000 0100 1000 0110 0100 1100 0011 0011
0001 1100 0001 0011 0010 0110 0000 0000"
.sym. 1010 0000 0110 0000 0001 1000 1010 0000"
1011 1100 0111 0011 0011 1110 1010 0000"
& 1110 1111 0111 1110 1111 1111 0110 1110"
1010 1100 0111 0010 0011 1110 0010 0000"
______________________________________
At step 122 processor 18 forms the circular exclusive OR of this final key and the data block. Using the values from the example above (the data "Secret Message") the results of this exclusive-OR operation (.sym.) are:
______________________________________
(data, alphanumeric)
"S e c r
(data, ASCII) "0101 0011 0110 0101 0110 0011 0111 0010
(final key)
.sym. "0010 1101 0001 1101 1101 0001 0011 1011
(encrypted 0111 1110 1111 1000 1011 0010 0100 1001
e t -- M
0110 0101 0111 0100 0010 0000 0100 1101
.sym.
1000 0111 0110 0001 0011 0000 0000 0111
1110 0010 0001 0101 0001 0000 0100 1010
e s s a
0110 0101 0111 0011 0111 0011 0110 0001
.sym.
0101 0011 0011 0100 0000 0011 0100 1000
0011 0110 0100 0111 0111 0000 0010 1001
g e"
0110 0111 0110 0101"
.sym.
0000 0100 1000 0110"
0110 0011 1100 0011"
______________________________________
At step 124 processor 18 determines whether another data block is to be encrypted or decrypted. If so, processor 18 repeats steps 116-120 to form a new final key using the new data block and, at step 122, forms the exclusive-OR of the new final key and the new data block. From the above example, it can be seen that the invariant bit mask indicates bits of the data block that remain unaltered by encryption or decryption. Each data bit in a position corresponding to a "0" bit of the invariant bit mask remains unchanged or invariant. This alternative algorithm provides additional security because the keys cannot be determined by combining unecrypted data with encrypted data and working in reverse through the algorithm. Although the hardware and software described above with respect to FIGS. 1-3 may be particularly suitable for encrypting and decrypting text strings received from a computer, it should be noted that the data to be encrypted or decrypted can be any digital data. The data need not be expressible as a text string and could, for example, represent a digital voice, facsimile (FAX), still image, or television signal. In summary, processor 18 manipulates one or more input user keys and a base key to form a final key, which is used to encrypt or decrypt data. Processor 18 manipulates the input user keys to form an actual user key at steps 24-40 and performs further manipulation on the actual user key at steps 42-54 and 58. Processor 18 manipulates the base key at step 56 in the first embodiment described above, or at steps 102 and 106 in the second embodiment. Processor 18 combines the manipulated base and user keys at step 60 to form a semifinal key in the first embodiment or at step 108 in the second embodiment. To provide additional security, in the first embodiment, processor 18 may then combine the semifinal key with a value derived from the actual user key, such as the shift factor, to form a. final key at step 62. At steps 64-68 the final key is combined with data to be encrypted or decrypted. Alternatively, to provide additional security, in the second embodiment, processor 18 may use the semifinal key as a basis for selecting invariant bit positions at steps 110 and 112. When processor 18 receives the input data to be encrypted or decrypted, it copies the bits of input data in the invariant positions and appends them together to form an invariant key at steps 116 and 118. At steps 120 and 122, the invariant key is used to form a final key, which is combined with the data to be encrypted or decrypted. It should be noted that the above-described methods can be used for either encryption or decryption. Processor 18 may be used only for manipulating the keys and need not differentiate between encryption and decryption. Obviously, other embodiments and modifications of the present invention will occur readily to those of ordinary skill in the art in view of these teachings. Therefore, this invention is to be limited only by the following claims, which include all such other embodiments and modifications when viewed in conjunction with the above specification and accompanying drawings.
|
Same subclass Same class Consider this |
||||||||||
