發信人: cschang@bbs.ee.ntu.edu.tw (我怕貓!), 信區: Linux
標 題: [News] 十六歲女孩發明新密碼演算法
發信站: 台大電機 Maxwell BBS (Wed Jan 13 23:13:36 1999)
轉信站: cmc!news.cmc!ccnews.nchu!ctu-gate!news.nctu!news.ntu!bbs.ee.ntu!Maxwell 來自BBC的消息,
http://news.bbc.co.uk/hi/english/sci/tech/newsid_254000/254236.stm
一個名叫Sarah Flannery的十六歲小女孩發明了Cayley-Purser這種密碼, 並可證明
至少跟RSA一樣安全, 不同的是, RSA將一篇文章編碼需時30分鐘, Cayley-Purser
碼卻只要1分鐘. 更好的是, 這位慷慨的Flannery小姐打算把這種編碼法送給大家
自由使用.... (原文如下) Making your email secret is now 30 times faster, but the innovation
has come not from a multinational computer computer but a schoolgirl
from Blarney, Ireland. Sarah Flannery, 16, has developed a brand new mathematical procedure
for encrypting internet communication. "The algorithm is based on matrices," her father told BBC News Online.
Dr David Flannery is a mathematics lecturer at Cork Institute of
Technology, Ireland. "Sarah has a very good understanding of the mathematical principles
involved, but to call her a genius or a prodigy is overstated and she
doesn't want that herself. Encryption technology codes internet messages to keep email and online
commerce secure"She's a normal young girl, who likes basketball and
going out with her friends." International job offers But her number-crunching feat is undoubtedly remarkable and won her
the top prize at the Irish Young Scientists and Technology Exhibition.
International job and scholarship offers have flooded in, said Dr
Flannery. Last year, Ms Flannery's cryptography skill took her to Fort
Worth, Texas, as the winner of an Intel prize. Even when high security levels are required, her code can encrypt a
letter in just one minute - a widely used encryption standard called
RSA would take 30 minutes. "But she has also proven that her code is
as secure as RSA," says Dr Flannery. "It wouldn't be worth a hat of
straw if it was not." Ms Flannery currently has a bad cold and has not had time to consider
the advice of the judges to patent the code. "She wouldn't mind being
rich but she wants to stress the great joy that the project has given
her," says Dr Flannery. She may publish the work to make it freely
available to all. Her code is called Cayley-Purser after Arthur Cayley, a 19th century
Cambridge expert on matrices, and Michael Purser, a cryptographer from
Trinity College, Dublin, who provided inspiration for Ms Flannery.
--
※ Origin: 臺大電機 Maxwell 站 ◆ From: pc5336.ee.ntu.edu.tw -------------------------------------------------------------------------------- 參考網址
http://www.inet-one.com/cypherpunks/dir.1999.03.15-1999.03.21/msg00092.html
********************************************************************** http://cryptome.org/flannery-cp.htm <HTML>
<HEAD>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1">
<META NAME="generator" CONTENT="GoLive CyberStudio">
<!-- Created with AOLpress/2.0 -->
<TITLE>Sarah Flannery on Cayley-Purser: An Investigation of a New Algorithm
vs. the RSA</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF"> 12 June 2000: Add link to
Sarah Flannery's
Web site with the original of her Cayley-Purser paper. Thanks to J-JQ. 22 November 1999: Sarah Flannery writes today the good news that she will
put her paper online soon, free of any errors which may remain in this version.
URL when it's available. 17 November 1999. Many thanks to Erick Wong for countless(!) typos corrected.
Add
William Whyte message on the successful attack on
Cayley-Purser. 13 November 1999. Add transcription of
Mathematica code of the RSA
and C-P algorithms, which completes the HTML conversion of the full document. 12 November 1999: Add transcriptions of "The Cayley-Purser Algorithm," "Wherein
lies the security of the Cayley-Purser Algorithm?," "Empirical Run-time
Analysis," Post Script attack and Bibliography. Joe Author provided a PDF
version of the 18 TIF images in a smaller package:
http://cryptome.org/flannery-cp.pdf
(603KB). 11 November 1999
Source: TIF images provided by Jean-Jacques Quisquater of 18-page hardcopy
provided by Jean-François Misarsky. Set of 18 images
http://cryptome.org/flannery-cp.zip
(1.2MB) See press release:
http://europa.eu.int/comm/dg12/press/1999/pr2509en.html See related January 1999 report:
http://jya.com/flannery.htm In equations single letters are substituted for Greek characters. Double
check all equations with original images. Errata welcome; send to
jy@jya.com [Document undated; apparently September 1999. Excerpts.]
Cryptography:
An Investigation of a New Algorithm vs. the RSA
Sarah Flannery, Blarney, Co. Cork, Ireland
Contents
-- Mathematica Code for RSA Algorithm
-- Mathematica Code for Cayley-Purser Algorithm
Cryptography:
An Investigation of a New Algorithm vs. the RSA
Introduction As long as there are creatures endowed with language there will be the desire
for confidential communication -- messages intended for a limited audience.
Governments, companies and individuals have a need to send or store information
in such a way that on the intended recipient is able to read it. Generals
send orders, banks send fund transfers and individuals make purchases using
credit cards. Cryptography is the study of methods to 'disguise' information
so that only the intended receipient can obtain knowledge of its content.
Public-Key Cryptography was first suggested in 1976 by Diffie and Hellman
and a public-key cryptosystem is one which has the property that someone
who knows only how [to] encipher ('disguise') a piece of information CANNOT
use the enciphering key to find the deciphering key without a prohibitively
lengthy computation. This means that the information necessary to send private
or secret messages, the enciphering algorithm along with the enciphering
key, can be made public-knowledge by submitting them to a public directory.
The first public-key cryptosystem, the RSA Algorithm, was developed by Ronald
Rivest, Adi Shamir and Leonard Adleman at MIT in 1977. This system, described
below, has stood the test of time and is today recognised as a standard of
encryption worldwide.
Aim This project investigates a possible new public-key algorithm, entitled the
Cayley-Purser (CP) Algorithm and compares it to the celebrated RSA public-key
algorithm. It is hoped that the CP Algorithm is
-
As secure as the RSA Algorithm and
-
FASTER than the RSA Algorithm
Firstly both algorithms are presented and why they both work is illustrated.
A mathematical investigation into the security of the Cayley-Purser algorithm
is discussed in the main body of the report. Some differences between the
RSA and the CP algorithms are then set out. Both algorithms are programmed
using the mathematical package
Mathematica and the results of an empirical
run-time analysis are presented to illustrate the relative speed of the CP
Algorithm.
RSA Public Key Cryptosystem
The RSA scheme works as follows:
Start Up: [This need be done only once.]
-
Generate at random two prime numbers p and q of 100
digits or more.
-
Calculate n = pq phi(n) =
(p-1)(q-1) = n - (p q) 1.
-
Generate at random a number e < phi(n) such that
(e, phi(n)) = 1.
-
Calculate the multiplicative inverse, d, of e (mod
phi(n)) using the Euclidean algorithm.
Publish: Make public the enciphering key,
KE = (n, e)
Keep Secret: Conceal the deciphering key,
KD = (n, d)
Enciphering: The enciphering transformation is,
C = f(P) = Pe (mod n)
Deciphering: The deciphering transformation is,
P = f--1(C) = Cd
(mod n)
Why the deciphering works:- The correctness of the deciphering algorithm
is based on the following result due to Euler, which is a generalization
of what is known as Fermat's little theorem. This result states that,
aphi(n) = 1 (mod n)
whenever (
a,
n) = 1, where
phi(
n),
Euler's-
phi function, is the number of positive integers less than
n which are relatively prime to
n. When
n =
p, a prime,
phi(
n) =
p - 1, and
we have Fermat's theorem:
ap-1 = 1 (mod p) ; (a,
p) = 1
If
p|
a then
ap = a
= 0 (mod
p), so that for any
a,
ap = a (mod p)
Now since
d is the multiplicative inverse of
e, we have
ed = 1 (mod phi(n)) => ed = 1 k
phi(n), k in Z
Now
f--1(f(P)) =
(Pe)d = Ped
(mod n)
and
Ped = P1 k
phi(n) (mod n) (for some integer
k)
Now for
P with (
P,
p) = 1, we have
Pp-1 = 1 (mod p) => Pk
phi(n) 1 = P (mod p) as
p - 1|phi(n)
This is trivially true when P
= 0 (mod
p), so that
for all
P, we have
Ped = P1 k
phi(n) = P (mod p)
Arguing similarly for
q, we have for all
P,
Ped = P1 k
phi(n) = P (mod q)
Since
p and
q are relatively prime, together these equations
imply that for all
P,
Ped = P1 k
phi(n) = P (mod n).
The Cayley-Purser Algorithm
Introduction Since this algorithm uses 2 x 2 matrices and ideas due to Purser it is called
the Cayley-Purser Algorithm. The matrices used are chosen from the multiplicative
group
G =
GL(2, Z
n). The modulus
n
=
pq, where
p and
q are both primes of 100 digits or
more, is made public along with certain other parameters which will be described
presently. Since
|GL(2, Zn)| = n
phi(n)2(p 1)(q 1)
we note that the order of
G cannot be determined from a knowledge
of
n alone. Plaintext message blocks are assigned numerical equivalents as in the RSA
and placed four at a time in the four positions (ordered on the first index)
of a 2 x 2 matrix. This message matrix is then transformed into a cipher
matrix by the algorithm and the corresponding ciphertext is then extracted
by reversing the assignment procedures used in the encipherment. Because this algorithm uses nothing more than matrix multiplication (modulo
n) and not modular exponentiation as required by the RSA it might
be expected to encipher and decipher considerably faster than the RSA. This
question was investigated, using the mathematical package
Mathematica,
by applying both algorithms to large bodies of text (see Tables I-IX) and
it was found that the Cayley-Purser algorithm was approximately twenty-two
times faster than the RSA with respect to a 200-
digit modulus. Needless to say if it could be shown that this algorithm is as secure as
the RSA then it would recommend itself on speed grounds alone. The question
of security of this algorithm is discussed after we have described it and
explained why it works.
The CP Algorithm
Start Up: procedure to be followed by B (the receiver):
[Cryptome note: Here "in" is used for the element inclusion
symbol.]
-
Generate two large primes p and q.
-
Calculate the modulus n = pq.
-
Determine x and a in GL(2,
Zn) such that xa-1 /= ax.
-
Calculate g = xr ; r in N.
Publish: The modulus
n and the parameters
a,
b,
and
g Start Up Procedure to be followed by A (the sender): In order to encipher the matrix
µ corresponding to a plaintext
unit for sending to B, Person A must consult the parameters made public by
B and do the following:
Enciphering Procedure When the above parameters are
calculated, A enciphers
µ via
µ' = kµk
and sends
µ' and
e to B
Deciphering Procedure When A receives
µ'
and
e (s)he does the following: Calculates
l = x-1ex
and deciphers
µ' via
µ = lµ'l
Why the deciphering works. The deciphering works since
l = x-1ex
=
x-1(s-1as)x
=
s-1(x-1ax)s
: (s. being a power of x. commutes with
x)
=
s-1(x-1a-1x)-1s
= s-1b-1s
: (recall that b =
x-1a-1x)
= (s-1bs)-1
= k-1
: ( B's enciphering key )
so that
lµ'l = l(k µ k)l
=
(k-1k)µ(kk-1)
= µ.
Wherein
lies the security of the Cayley-Purser Algorithm?
To find the secret matrix
x, known to B alone, one might attempt to
solve either the equation
b = x-1a-1x
or
g = xr
In the first of these equations the matrix
b is public and the matrix
a-1 can be computed since both the matrix
a and
the modulus
n are public. In the second equation only the matrix
g is known and it is required
to solve for both the exponent
r and the base matrix
x. Assuming
that one knew
r, solving this equation would involve extracting the
rth - roots of a matrix modulo the composite integer
n. Even in the simplest case, where
r = 2, extracting the square
root of a 2 x 2 matrix modulo
n requires that one be able to solve
the ordinary
quadratic conruence
[as written]
x2 = a (mod n)
when
n =
pq. It is known that the ability to solve this 'square
root' problem is equivalent to being able to factor
n. Thus we may
regard an attack on
x via the public parameter
g as being
computationally prohibitive. Solving the equation
b = x-1a-1x
would appear the easier option for an attack on the private matrix
x
as it only involves solving the set of linear equations given by
xb = a-1x
However the number of possible solutions to this equation is given by the
order of
C(
a), the centraliser of
a in
GL(2,
Z
n). By ensuring that the order of this group is extremely
large one can make it computationally prohibitive to search for
x. To see why this is the case suppose that
b = x-1a-1x
and b =
x1-1a-1x1
Then
x-1a-1x =
x1-1a-1x1
If and only if
a-1xx1-1 =
xx1-1a-1
If and only if
xx1-1 in
C(a-1)
If and only if
x in
C(a-1)x1
Thus the number of distinct solutions of the equation is given by
|
C(
a)| as
C(
a-1) =
C(
a). Now
C(
a) will have a large order if the matrix element
a
has a large order. By choosing our primes
p and
q to be of the form
p = 2p1 1
and
q = 2q1 1,
where
p1 and
q1 are themselves prime,
we can show that it is almost certainly the case that an element
a chosen at random from
GL(2, Z
n) has a large
order. To see why, we begin by considering the homomorphism
p of
GL(2,
Z
n) onto Z
n defined by sending a matrix
into its determinant. The order of a matrix in
GL(2,
Z
n) is at least that of the order of its image in
Z
n since ... If
r is the order of
A in
GL(2,
Z
n) and
p(
A) =
u then
Ar =
I with
1 = p(I) = p(Ar) =
p(A)r = ur
shows that
m divides
r where
m is the order of
u
in Z
n. Thus the order of
A in
GL(2, Z
n) is at least
m. In fact
p(Am) =
p(A)m = um = 1
shows that
Am lies in
SL (2,
Z
n) so the matrix
A will have order
µ
iff
Am =
I in
SL (2,
Z
n). We note also that since the maximum achievable order of an element in
Z
n is
[p - 1, q - 1]
|
<
|
(p - 1)(q - 1)
__________
|
= |
phi(n)
___
|
2
|
2
|
(as (
p - 1,
q - 1)
> 2) and since the order of
SL (2, Z
n) is
n phi(
n)(
p
1)(
q 1) the maximum achievable order of a matrix in
GL(2,
Z
n) is
[p - 1, q - 1] n phi(n)(p 1)(q
1) < n phi(n)2(p 1)(q
1)/2 = |GL(2, Zn)|/2.
Thus if we can show that the probability of an element having a small order
in Z
n is negligibly small then we will have shown that
the order of an element chosen at random from
GL(2,
Z
n) is almost certainly of 'high order.' If
p = 2p1 1
and
q = 2q1 1
then
phi(n) = phi(pq) = (p - 1)(q -
1) = 2p12q1 =
4p1q1
with
[p - 1, q - 1] = [2p1 ·
2q1 ] =
2p1q1 = phi(n)/2
Now the possible orders of the elements in Z
n are divisors
of
phi(
n)/2 =
2
p1q1 and so are
1, 2, p1 · q1 ·
2p1, 2q1 ·
p1q1 ·
2p1q1
and all of these orders are achieved by some elements. In fact by counting
exactly how many elements correspond to each order we show that the probability
of finding a unit in Z
n of order less than
p1q1 is negligibly small. Recall that if
a in Z
p has order
k and
b in Z
q has order
l then the order of
c in Z
n where
c = a (mod p)
and
c = b (mod q)
is [
k,
l], the least common multiple of
k and
l. Now the possible orders of
a and
b in Z
p
and Z
q are divisors of
p - 1 = 2p1 ; q - 1 =
2q1
respectively. The following table lists the possible orders along with the number of elements
of each order.
Z*p
|
Z*q |
Possible
Orders
|
No. of elements
of that order |
Possible
Orders
|
No. of elements
of that order |
1
|
1
|
1
|
1
|
2
|
1
|
2
|
1
|
p1
|
p1 - 1
|
q1
|
q1 - 1
|
2p1
|
p1 - 1
|
2q1
|
q1 - 1
|
By lifting elements in pairs via the CRT we obtain the elements corresponding
to the different orders in Z
n along with number of elements
of each order.
Order
|
Number
|
Reason
|
1
|
1
|
[1, 1] = 1
|
2
|
3
|
[1, 2] = [2, 1] = [2, 2] = 2
|
p1
|
p1 - 1
|
[p1, 1] = p1
|
q1
|
q1 - 1
|
[1, q1] = q1
|
2p1
|
3p1 - 3
|
[2p1, 1] = [p1, 2]
= [2p1, 2] = 2p1
|
2q1
|
3q1 - 3
|
[1, 2q1] = [2, q1] = [2,
2q1] = 2q1
|
p1q1
|
p1q1 - p1 -
q1 1
|
[p1, q1] =
p1q1
|
2p1q1
|
3p1q1 - 3p1 -
3q1 3
|
[2p1, q1] =
[p1, 2q1] =
[2p1, 2q1] =
2p1q1
|
Note that if we sum all the individual counts we get exactly
4
p1q1 which is the number of elements
of Z
n.
Explanation: To see how the number of elements corresponding to an
order is obtained consider the last entry in the above array: An element
of order 2
p1q1 in
Z
n can be obtained in 3 different ways by lifting pairs
of elements from Z
p and Z
q: One way is
lifting the pair (
a,
b) where
a has an order
2
p1 and
b has order
q1; another
by lifting the pair (
a,
b) where
a has an order
p1 and
b has order 2
q1 and another
by lifting the pair (
a,
b) where
a has an order
2
p1 and
b has order 2
q1. Regarding elements of order less than
p1q1 as elements of 'low order'
we obtain the probability of choosing an element of order less than
p1q1 to be
4p1 4q1 - 4
___________ |
4p1q1
|
This is equivalent to
1/p1 1/q1 -
1/p1q1
In the case where
p and
q are both of order of magnitude
10
100 this probability is approximately
2.10-100
which, by any standards, is negligibly small.
Some
differences between the RSA and Cayley-Purser Algorithms