Linear Maps
When working modulo it suffices to work with integers in the range .
Let be the linear map -> from into itself.
Recall that a function is said to be linear if for all and .
For example, for the linear map with (on the left) is not invertible, but the linear map with (on the right) is invertible.
map for m=4 and a=2 | map for m=4 and a=3 |
---|---|
0 -> 0 | 0 -> 0 |
1 -> 2 | 1 -> 3 |
2 -> 0 | 2 -> 2 |
3 -> 2 | 3 -> 1 |
Why are we interested in inverting the map? Because the map scambles the elements of and we may be interested in unscrambling them (think in cryptographic terms).
So, what is the inverse map?
It turns out that the inverse map if it exists, is also linear.
More specifically, the inverse map of is , where is the modular inverse of . Indeed, if then .
Since the modular inverse of modulo only exists when the linear map is invertible if and only if .
Keep in mind that we wish to devise a way to encrypt information by providing public data to do so (in this case it would be and ).
Alas, this way of scrambling information is very easy to unscramble, so useless from a cryptography point of view.
Modular multiplication scrambles the information but it is easy to undo if we know and . What about modular exponentiation?
A Failed Cryptosystem
The Merklw-Hellman knapsack cryptosystem keeps the following information secret:
a set of positive integers, such that is a super-increasing sequence. i.e: for .
a modulus such that
a scrambling integer such that .
and publishes the following information: set , where , for .
It is much better to publish a random permutation of . To send a message composed by the bits , compute and send.
This is a hard knapsack problem (in this case a subset sum problem). To decipher transform it into a trivial knapsack problem by computing , which is equal to and so can be solved by a greedy algorithm.
Merkle-Hellman Knapsack Example
The following example shows the Merklw-Hellman cryptosystem in action.
Secret data: and .
Public data: .
Unencrypted message to be sent:
Encrypted message sent:
To decrypt compute and then reason as follows [greedy algorithm for the easy subset sum problem]:
must be used to form the sum because . Hence . The rest of the sum is .
cannot be used to form the sum because . Hence .
must be used to form the sum because . Hence . The rest of the sum is .
As so on. In this particular case, the next iteration finishes the deciphering process.
Last updated