Cryptographs and Inverse Functions

advertisement
Cryptographs and Inverse Functions
Introduction
A cryptograph is a coded message. The
ability to code and decode messages is useful because
of the vast amount of information that is transmitted
between computers owned by companies, banks,
governments and private users. As this information
is transmitted it is susceptible to interception by
unintended audiences. Even information that is not
transmitted may be viewed by hackers that attempt to
invade computer systems.
One method of protection from unauthorized
viewers is to encode the information using a
mathematical function. This information can then be
decoded only by those who know the inverse of the
encoding function.
Most mathematical functions operate on
numbers. Therefore letters of the alphabet must be
transformed to numbers before they can be encoded
with a function. Since encoding is usually done with
a computer it is common to transform the letters to a
standard list of numbers understood by most
computers known as Unicode numbers.
When Alice wishes to send a secret message
to Bob, she first converts the text of her message to
Unicode numbers. Once the letters of the text are
changed to Unicode numbers, Alice uses a
mathematical function to encode the Unicode
numbers. Bob uses the inverse of the encoding
function to change these encoded numbers back to
the original Unicode numbers and then converts the
Unicode numbers back to the original text.
Example 1
Message: CODES ARE COOL
Unicode Numbers:
67 79 68 69 83 32 65 82 69 32 67 79 79 76
Encoding Function:
y  3x  11
Encoded Message:
212 248 215 218 260 107 206 257 218 107 212 248
248 239
x  11
y
Decoding Function:
3
Decoded Message:
67 79 68 69 83 32 65 82 69 32 67 79 79 76
Example 2
Sometimes numbers are grouped before they are
encoded.
Message: MATHEMATICS
Unicode Numbers:
77 65 84 72 69 77 65 84 73 67 83 32
(Notice a space was added to make an even sized list.)
Ray Barton, Olympus High School
MMC September 2005
Grouped in pairs:
7765 8472 6977 6584 7367 8332
Encoding Function:
y  4x  215
Encoded Message:
30845 33673 27693 26121 29253 33113
y
Decoding Function:
x  215
4
Decoded Message:
7765 8472 6977 6584 7367 8332
Split the 4-digit numbers to obtain the
2-digit Unicode numbers of the original
message.
Problem 1
Encoding Function:
y  8x  31
Encoded Message:
53321 26233 68625 55425 67801 26113
66153 62969 26281 63849 65825 63857
52577 67753 62921
Decoding Function:
character
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Space
Decoded Message:
Text of Original Message:
Problem 2
Encoding Function:
y  3x 2  6x  15
Encoded Message:
186283212 32235864 191184879 144199479
210170712 138027279 146370687 208316679
Decoding Function:
Hint: complete the square
Decoded Message:
Text of Original Message:
Questions
1.
Why is it important that the encoding
function be one-to-one? In other words,
why must the inverse of the encoding
function be a function?
2.
Sometimes code breakers compare the most
frequently occurring numbers in the encoded
message with the most commonly used
letters in the English language. How does
grouping Unicode numbers in pairs before
encoding the message make this code
breaking technique more difficult?
barton@math.utah.edu
Unicode
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
32
Scrambling the order
The encoding functions described so far
preserve order. That is, if a < b then E(a) < E(b).
This makes the code easier to break. We need
encoding functions that do not preserve order.
Functions that use modular division might work. For
example if p is prime and (p-1) is not divisible by 3,
the function
one else can decode the message since they don’t
have Bob’s private key. Here is an example of a
public-key encoding function and its private
decoding function:
If p and q are prime and (p-1) and
(q-1) are not divisible by 3 then the encoding
function
y  x3 (mod pq)
y  x (mod p)
3
has the inverse
has the inverse
y
2 p1
x 3
yx
2( p 1)( q 1) 1
3
(mod
pq)
mod( p)
The product pq is the public key. The private key is
The modulus for this function should be bigger than
the largest Unicode value in the message.
Example 3
Message: MISSION IMPOSSIBLE
Unicode Numbers: 77 73 83 83 73 79 78 32 73 77 80
79 83 83 73 66 76 69
Encoding Function:
y  x3 (mod 101)
Encoded Message: 13 66 26 26 66 58 54 44 66 13 31
58 26 26 66 50 30 57
Note: The order has not been preserved
2( p  1)( q  1)  1
.
3
Example 4
Message:
Unicode Numbers:
65 80 72
CRYPTOGRAPH
67 82 89 80 84 79 71 82
Encoding Function:
y  x3 (mod 115)
Encoded Message: 38 58 19 20 109 34 31 58 5 20
73
Decoding Function:
y  x67 (mod101)
Decoded Message: 77 73 83 83 73 79 78 32 73 77 80
79 83 83 73 66 76 69
Decoding Function:
y  x59 (mod115)
Decoded Message:
67 82 89 80 84 79 71 82 65 80 72
Public and Private Keys
A practical drawback with each of the
previous encoding functions is that if the encoding
function is known, the decoding function can easily
be determined and vise-versa.
This is called
symmetric-key encryption. If Alice and Bob wish to
communicate with symmetric-key encryption they
must first meet in a secure setting to agree upon the
encoding and decoding functions.
Encryption programs are now available that
allow the user to make the encoding function public
and yet keep the decoding function private. This is
called asymmetric or public-key encryption. The
encoding function typically uses a very large number.
This large number is called a public key. The key is
the product of two large prime numbers. The
decoding function uses a private key that is
calculated from the two prime factors of the public
key. Since it is very difficult to factor a large number,
the user can be confident when publishing the public
key that the private key will not be discovered.
When Alice wishes to send a secret message
to Bob, she looks up Bob’s public key in a directory.
She uses this public key to encode the message. Bob
then uses his private key to decode the message. No
Problem 3
Public Key:
187
Encoded Message:
77 92 137 109 3 43 101 183 137 43 67 107 85 137
Ray Barton, Olympus High School
MMC September 2005
Private Key:
Decoded Message:
Text of Original Message:
Digital Signatures
A digital signature can be attached to a
message. This signature verifies the message is
actually from the person signing the message. To
sign a message, Alice does a computation involving
both her private key and the encoded message. To
verify the signature, Bob does a computation
involving Alices signature and her public key. Here
is an example of a digital signature:
Alice
Bob
Public key
187
115
Private key
107
59
barton@math.utah.edu
Example 5
Message: YOURS TRULY ALICE
Unicode Numbers: 89 79 85 82 83 32 84 82 85 76 89
32 65 76 73 67 69
Alice first encodes the message using Bob’s public
key.
Encoding Function:
f ( x)  x3 (mod115)
Encoded Message: 19 34 25 58 7 108 109 58 25 21
19 108 5 21 87 38 69
She encodes again using her private key:
2nd Encoding Function:
g ( x)  x107 (mod187)
Doubly Encoded Message: 178 34 53 31 116 158 65
31 53 98 178 158 113 98 76 47 86
Note: This is the result of a composite function
g ( f ( x))
Bob decodes the signature using Alice’s public key:
Decoding Function:
g 1( x)  x3 (mod187)
Partially Decoded Message:
19 34 25 58 7
108 109 58 25 21 19 108 5 21 87 38 69
(This is the message before Alice’s signature.)
He decodes again using his private key:
1
2 Decoding Function:
f ( x)  x (mod115)
Decoded message: 89 79 85 82 83 32 84 82 85 76 89
32 65 76 73 67 69
nd
59
Note: This is the result of the composite function
g 1 ( f 1 ( x))
If an imposter signed Alice’s message using a key
other than Alice’s private key, Bob would not be able
to decode completely and the message would be an
obvious forgery.
The RSA Factoring Challenge
Since the security of the private key depends on the
difficulty of factoring large numbers, there is
widespread interest in factoring techniques. RSA
Laboratories has offered a cash prize to the first
person to factor each of several challenge numbers.
Prizes range from $10,000 (US) for a 174 digit
number to $200,000 for a 617 digit number.
Here is your chance to make some money with
mathematics!
Ray Barton, Olympus High School
MMC September 2005
Name:
RSA-576
Prize:
$10000 (already claimed)
Digits:
174
Digit Sum:
785
18819881292060796383869723946165043
98071635633794173827007633564229888
59715234665485319060606504743045317
38801130339671619969232120573403187
9550656996221305168759307650257059
Name:
RSA-640
Prize:
$20000
Digits:
193
Digit Sum:
806
31074182404900437213507500358885679
30037346022842727545720161948823206
44051808150455634682967172328678243
79162728380334154710731085019195485
29007337724822783525742386454014691
736602477652346609
Name:
RSA-704
Prize:
$30000
Digits:
212
Digit Sum:
1009
74037563479561712828046796097429573
14259318888923128908493623263897276
50340282662768919964196251178439958
94330502127585370118968098286733173
27310893090055250511687706329907239
63807867100860969625379346505637963
59
Name:
RSA-768
Prize:
$50000
Digits:
232
Digit Sum:
1018
12301866845301177551304949583849627
20772853569595334792197322452151726
40050726365751874520219978646938995
64749427740638459251925573263034537
31548268507917026122142913461670429
21431160222124047927473779408066535
1419597459856902143413
Name:
RSA-896
Prize:
$75000
Digits:
270
Digit Sum:
1222
41202343698665954385553136533257594
81798116998443279828454556264338764
45565248426198098870423161841879261
42024718886949256093177637503342113
09823974851509449091069102698610318
62704114880866970564902903653658867
43373172081310410519086425479328260
1391257624033946373269391
barton@math.utah.edu
Name:
RSA-1024
Prize:
$100000
Digits:
309
Digit Sum:
1369
13506641086599522334960321627880596
99388814756056670275244851438515265
10604859533833940287150571909441798
20728216447155137368041970396419174
30464965892742562393410208643832021
10372958725762358509643110564073501
50818751067659462920556368552947521
35008528794163773285339061097505443
34999811150056977236890927563
Name:
RSA-1536
Prize:
$150000
Digits:
463
Digit Sum:
2153
18476997032117414743068356202001644
03018549338663410171471785774910651
69671116124985933768430543574458561
60615445717940522297177325246609606
46946071249623720442022269756756687
37842756238950876467844093328515749
65788434150884755282981867264513398
63364931908084671990431874381283363
50279547028265329780293491615581188
10498449083195450098483937752272570
52578591944993870073695755688436933
81277961308923039256969525326162082
36764903160365513714479139323471695
66988069
Name:
RSA-2048
Prize:
$200000
Digits:
617
Digit Sum:
2738
25195908475657893494027183240048398
57142928212620403202777713783604366
20207075955562640185258807844069182
90641249515082189298559149176184502
80848912007284499268739280728777673
59714183472702618963750149718246911
65077613379859095700097330459748808
42840179742910064245869181719511874
61215151726546322822168699875491824
22433637259085141865462043576798423
38718477444792073993423658482382428
11981638150106748104516603773060562
01619676256133844143603833904414952
63443219011465754445417842402092461
65157233507787077498171257724679629
26386356373289912154831438167899885
04044536402352738195137863656439121
2010397122822120720357
Summary
The widespread use of computers to store
and transmit information has created a need for
secure and convenient encryption methods. The
security of these methods hinges on the difficulty of
factoring large numbers. The mathematical concepts
used in these methods by state-of-the-art software can
be understood by high school students. These
concepts include functions and their inverses as well
as modular division.
References:
Hellman ME.
“The mathematics of public-key
cryptography.”
Scientific American, 1979;
241:130-139
Reagan, James. “Get the Message? Cryptographs,
Mathematics, and Computers.” Mathematics
Teacher (October 1986): 547-553.
Rivest RI, Shamir A, Adleman L. “A method for
obtaining digitial signature and public key
cryptosystems.”
Commun Assoc Computing
Machinery. 1978; 21: 120-26
Singh, Simon, “The Code Book”, Anchor Books,
New York, 1999
http://www.newscientist.com/news/news.jsp?id=ns99
995057
www.rsasecurity.com/rsalabs/node.asp?id=2165
For more information visit
www.rsasecurity.com/rsalabs/node.asp?id=2093
Ray Barton, Olympus High School
MMC September 2005
barton@math.utah.edu
Download