December 23, 2005

Hi Pam,


Thanks for the question.

Here is how RSA encryption/decryption works

if c = m^e mod n
then m = c^d mod n

The first line above represents the encryption of a message m with a public key e to produce ciphertext c.

The second line above represents the decryption of a ciphertext c with a private key d to produce message m.

Both the public key e and private key d depend on the public modulus n.

where

m is some message
c is the ciphertext of m
e is a public key, a large integer relatively prime to s
d is a private key, a large integer relatively prime to s
n is a public modulus, the product of p and q
p is a large prime
q is a large prime
s is a secondary (private) modulus equal to the product of (p-1) and (q-1)

we choose s this way so that there is
an easy solution to the euler phi function.
recall if n = p*q and p and q are prime, then
 
phi(n) = phi(pq) = phi(p)*phi(q) = (p-1)*(q-1) = s

we choose e relatively prime to s.
then we know it has an inverse d
and we can use the euclidian algorithm to find it.***


So if Bob wants to get an encrypted message from anyone,
he generates p, q, s, e, d. He publishes e and n,
and keeps d, p, q, s private.

Now if Alice wants to send an encrypted message to Bob,
she simply grabs n and e from some public key server,
then calculates

c = m^e mod n

And sends c to Bob.
When Bob gets the encrypted message c he calculates

m = c^d mod n

and if he can 'recognize it' he accepts it
as a message encrypted only for him.
that is, he is the only one in the world
who can read the encrypted message.


this works because

c^d = (m^e)^d = m^(ed) = m^1 = m


This is not to say that Bob knows the ciphertext c came from Alice. We can cover digital signatures in another post if you like. However, I suspect you can figure out how to do it with the RSA. Pam! Inverse alert! Map!

The security of the RSA relies on the empirical
observation that no one to date has a found a good
way to factor n = p * q when given just n and e
where p and q are very large primes.
that's not to say that nsa or someone
else doesn't know how to do it or won't figure
it out in the future. it's considered extremely unlikely
by crypto geeks, however.

Bill

ps

below is a link to an RSA homework assignment
http://www2.ics.hawaii.edu/~wes/ICS623/Assignments/RSA.html

and some code that goes with it.



*** "How do you calculate d if you know n and s?
d is the inverse of e mod s.
There are two ways.
One way to do that is to use the euclidean algorithm.
You have to choose e relatively prime to s, i. e. GCD(e,s)=1.
Then using the Eudlidean division algorithm,
you can find c and d such that 1 = c*s + d*e.
Then 1 = d*e mod s, and d is the required number.
The other way is to find t = phi(s).
Then since e^t=1 mod s, then d = e^(t-1) is the inverse of e.
To do that you have to be able to factor s,
which in general is very difficult to do." --wes

(See 'unit 10' below for an example of where it's not difficult to factor s.)


/*
* Bill Luoma
* Ics 623
* unit 10 RSA
*
given p, q, a, and b prime
where p = 2a + 1 and q = 2b + 1,

let n = pq

let s = phi(n) = phi(pq) = phi(p)phi(q) = (p-1)(q-1)

= (2a+1-1)(2b+1-1) = 4ab =(2^2)(a)(b) which
is a unique factorization of primes.


Now phi(s) = phi(2^2ab) = phi(2^2)phi(a)phi(b) = 2(a-1)(b-1)


let t = phi(s) and let e and t be integers > 0
and let e be relatively prime to t

then e^t = 1 mod s

and since e^(t-1) * e = e^t = 1 mod s
e^(t-1) = e^(-1) mod s


To decrypt RSA, one needs to solve

m = c^d mod n

where d = e^(-1) mod s


So to decrypt the ciphertext c,
we should set m = c^(e^(t-1) mod s) mod n,
where t = 2(a-1)(b-1) mod s
and s = (p-1)(q-1) mod n
and e, the encryption key, are given.

*/




#include
#include
#include
#include

typedef unsigned long UL;


/* compare a k-word number, little endian */
/* return -1 if a(b, 0 if a=b, and 1 if a)b */
int mcmp(UL *a, UL *b, int k);
void madd(UL *a, UL *b, UL *P);
void msub(UL *a, UL *b, UL *P);
void mshl(UL *a, UL *P);
void mmpy(UL *a, UL *b, UL *c, UL *P);
void mexp(UL *a, UL *b, UL *c, UL *P);
void ddiv(UL *dd, UL *dv);

/* util */
UL rr(UL *b, UL k);
void sput(char *b, UL *a);
void sget(UL *a, char *b);
int read_num_1024(char* filename, UL num_1024[32]);
void gen_random_1021(UL r[32]);
double get_time_diff(struct timeval start, struct timeval finish);

/* Wes Peterson's assembly routines */
/* works with cygwin */
/* ar -rcsv asmath.lib add.obj sub.obj shl.obj */
/* gcc -ou9 luoma_p9.c -L./ -lasmath */
int add(UL *a, UL *b, int c);
int sub(UL *a, UL *b, int c);
int shl(UL *a, int c);

char buf[2048];
char bytes[512];
char nums[512];
UL one[32];
UL two[32];
UL result[32];
UL p[32], q[32], s[32], t[32], n[32];
UL a[32], b[32], c[32], d[32], e[32], m[32];


int main(int argc, char** argv)
{

int i = 0, flag = 0, size = 0;
UL start, stop;
FILE* file;
char* buf_ptr = NULL;
int bytes_read = 0;
struct timeval beg, end;


start = time(0);
printf("start time: %d\n", start);

one[0] = 1;
two[0] = 2;

file = fopen("input.txt", "r");
if (file) {
fread(buf, 1, sizeof(buf), file);
}
else {
printf("couldn't open input.txt\n");
exit(1);
}
//printf("read input: \n%s\n", buf);

buf_ptr = strstr(buf, "n=");
if (buf_ptr != NULL) {
sget(n, buf_ptr+3);
printf("n\n");
sput(nums, n);
printf(nums);
}
buf_ptr = strstr(buf, "p=");
if (buf_ptr != NULL) {
sget(p, buf_ptr+3);
printf("p\n");
sput(nums, p);
printf(nums);
}
buf_ptr = strstr(buf, "q=");
if (buf_ptr != NULL) {
sget(q, buf_ptr+3);
printf("q\n");
sput(nums, q);
printf(nums);
}
buf_ptr = strstr(buf, "a=");
if (buf_ptr != NULL) {
sget(a, buf_ptr+3);
printf("a\n");
sput(nums, a);
printf(nums);
}
buf_ptr = strstr(buf, "b=");
if (buf_ptr != NULL) {
sget(b, buf_ptr+3);
printf("b\n");
sput(nums, b);
printf(nums);
}
buf_ptr = strstr(buf, "c=");
if (buf_ptr != NULL) {
sget(c, buf_ptr+3);
printf("c\n");
sput(nums, c);
printf(nums);
}
buf_ptr = strstr(buf, "e=");
if (buf_ptr != NULL) {
sget(e, buf_ptr+3);
printf("e\n");
sput(nums, e);
printf(nums);
}
gettimeofday(&beg, NULL);

//let s = phi(n) = phi(pq) = phi(p)phi(q) = (p-1)(q-1) mod n

msub(p, one, n);
printf("p-1\n");
sput(nums, p);
printf(nums);

msub(q, one, n);
printf("q-1\n");
sput(nums, q);
printf(nums);

mmpy(p, q, s, n);
printf("s = phi(pq)\n");
sput(nums, s);
printf(nums);

//let t = phi(s) = phi(2^2ab) = phi(2^2)phi(a)phi(b) = 2(a-1)(b-1) mod s

msub(a, one, s);
printf("a-1\n");
sput(nums, a);
printf(nums);

msub(b, one, s);
printf("b-1\n");
sput(nums, b);
printf(nums);

mmpy(a, b, result, s);
printf("(a-1)(b-1)\n");
sput(nums, result);
printf(nums);

mmpy(result, two, t, s);
printf("t = phi(s)\n");
sput(nums, t);
printf(nums);

//d = e^(-1) = e^(t-1) mod s
msub(t, one, s);
printf("t-1\n");
sput(nums, t);
printf(nums);

mexp(e, t, d, s);
printf("e^(t-1)\n");
sput(nums, d);
printf(nums);

//m = c^d mod n
mexp(c, d, m, n);
printf("m:\n");
sput(nums, m);
printf(nums);

memset(buf, 0, sizeof(buf));
buf_ptr = (char*)m;

for (i = 127; i >= 0; i--) {



buf[127 - i] = buf_ptr[i];

}

printf("as string:\n%s\n", buf);



gettimeofday(&end, NULL);
printf("%d: decrypt took: %g s\n", i, get_time_diff(beg, end));



return 0;
}


int read_num_1024(char* filename, UL num_1024[32])
{
int bytes_read = 0;
char bytes[512]={0};
FILE* file = fopen(filename, "r");

if (!file) {
printf("couldn't open file p.txt\n");
exit(1);
}
bytes_read = fread(bytes, 1, sizeof(bytes), file);
fclose(file);
sget(num_1024, bytes);

return bytes_read;

}


int mcmp(UL *a, UL *b, int k)
{
int i;

for(i = k-1; i>=0; i--) {
if(a[i]>b[i]) return 1;
else if(a[i](b[i]) return -1;
}
return 0;
}


void madd(UL *a, UL *b, UL *P)
{
add(a+16, b+16, add(a, b, 0));
if(mcmp(a, P, 32)>=0) sub(a+16, P+16, sub(a, P, 0));
}

void msub(UL *a, UL *b, UL *P)

{
if(sub(a+16, b+16, sub(a, b, 0)))
add(a+16, P+16, add(a, P, 0));

}

void mshl(UL *a, UL* P)
{
shl(a+16, shl(a, 0));
if(mcmp(a, P, 32)>=0) sub(a+16, P+16, sub(a, P, 0));
}

void mmpy(UL *a, UL *b, UL *c, UL *P)
{

//printf ("multiplying %08x * %08x\n", a, b);
UL result[32];
int i, j;

memset(result, 0, sizeof(result));

for (i = 31; i >= 0; i--) {

for (j = 31; j >= 0; j--) {
unsigned long mask = 1UL << j;

mshl(result, P);
if (mask & b[i]) {
madd(result, a, P);
}
}

//printf("i: %d, mask: %08x, c: %08x\n", i , mask, c);

}
//printf("result is: %ld, 0x%08x\n", c, c);

memcpy(c, result, sizeof(result));

}

void mexp(UL *a, UL *b, UL *c, UL *P)
{

//printf ("doing a^b mod(P)\n");
UL result[32];
int i, j;

memset(result, 0, sizeof(result));
result[0] = 1;

for (i = 31; i >= 0; i--) {

for (j = 31; j >= 0; j--) {
unsigned long mask = 1UL << j;

mmpy(result, result, result, P);
if (mask & b[i]) {
mmpy(result, a, result, P);
}
}

//printf("i: %d, mask: %08x, c: %08x\n", i , mask, c);

}
//printf("result is: %ld, 0x%08x\n", c, c);

memcpy(c, result, sizeof(result));

}


/* This assumes that dd points to a 2048-bit */
/* dividend and dv points to a 1048-bit */
/* divisor. The high-order half of *dd must */
/* be smaller than *dd for no divide */
/* overflow. The quotient ends up in the low */
/* half of *dd and the remainder in the high */
/* half. WP--10/98 */
void dshl(UL *a)
{
shl(a+48, shl(a+32, shl(a+16, shl(a, 0))));
}

void ddiv(UL *dd, UL *dv)
{
int i;

if(mcmp(dd+32, dv, 32)>0) {
printf("Divide Overflow\n");
exit(0);
}
for(i = 0; i<1024; i++) {
dshl(dd);
if(mcmp(dd+32, dv, 32)>=0) {
sub(dd+48, dv+16, sub(dd+32, dv, 0));
*dd |= 1; /* one quotient bit */
}
}
}


/* This function calculates b mod k where */
/* b is a 1024--bit (32 word) number and k */
/* is less than 2^15. WP--10/02 */

UL rr(UL *b, UL k)
{
int i;
UL m, ans;

m = ((0xffffffff % k) + 1) % k; /* 2^32 mod k */
ans = 0;

for(i = 31; i >= 0; i--) {
ans = (ans*m) % k;
ans = (ans + b[i]) % k;
}

return ans%k;
}




/* This function expects as its second argument a */

/* (pointer to a) string that contains 32 hex words */

/* separated by spaces and/or new line characters, in */
/* big-endian order and it converts those words to */

/* binary and puts them in the array that a points to, */

/* declared "UL a[32];" in little endian sequence, i. e. */
/* the first word in the string goes into b[31] and the */
/* last word in the string goes into b[0]. */

void sget(UL *a, char *b)
{
sscanf(b, "%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x "
"%x %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x ",
a+31, a+30, a+29, a+28, a+27, a+26, a+25, a+24,
a+23, a+22, a+21, a+20, a+19, a+18, a+17, a+16,
a+15, a+14, a+13, a+12, a+11, a+10, a+9, a+8,
a+7, a+6, a+5, a+4, a+3, a+2, a+1, a);
}

void sput(char *b, UL *a)
{
int len = sprintf(b, "%08x %08x %08x %08x %08x %08x %08x %08x\n",
a[31], a[30], a[29], a[28], a[27], a[26], a[25], a[24]);

len += sprintf(b + len, "%08x %08x %08x %08x %08x %08x %08x %08x\n",
a[23], a[22], a[21], a[20], a[19], a[18], a[17], a[16]);

len += sprintf(b + len, "%08x %08x %08x %08x %08x %08x %08x %08x\n",
a[15], a[14], a[13], a[12], a[11], a[10], a[9], a[8]);

len += sprintf(b + len, "%08x %08x %08x %08x %08x %08x %08x %08x\n",
a[7], a[6], a[5], a[4], a[3], a[2], a[1], a[0]);
}


double get_time_diff(struct timeval start, struct timeval finish)
{
double f, s;
f = (double)finish.tv_sec;
f += ((double)finish.tv_usec)/1000000.0;
s = (double)start.tv_sec;
s += ((double)start.tv_usec)/1000000.0;
return f - s;
}

December 08, 2005

eventually for Poetry Project Newsletter....

Kamau Brathwaite, Born to Slow Horses, Wesleyan U P, 2005.

At the end of Born to Slow Horses, in a note that somewhat resembles a biographical note, Kamau Brathwaite calls this book part of his “postSalt poetry” phase. The “Time of Salt,” as he puts it, were the years 1986-1990, years in which his wife died, his home and archives were destroyed in a hurricane, and he was attacked in Kingston, Jamaica. The “Time of Salt” produced recent books such as The Zea Mexican Diary and Trench Town Rock. PostSalt are Born to Slow Horses and other recent collections such as Words Need Love Too. And as he writes in the third person, these postSalt books survey or make “natural reference to the entire tidalectics, but at the same time marking, even with the most remarkable of his ‘Caribbean’ poems here, a significant transboundary development.”

It is this attention to the “transboundary” that I find so distinctive about Brathwaite’s work. Brathwaite’s work is distinctive for how it charts the connections between the global and the local. His stunning Middle Passages zig zags back and forth across the Atlantic in a series of poems about political resistance and political art. Even his highly personal works, such as Trench Town Rock which is about his attack in Jamaica, often manage to get in a colonial history lesson. I always want to resort to some oxymoronic term or jargon, perhaps a term like transboundaric localism, to describe his work because the words currently in circulation around poetry never feel adequate. His work is always rooted in the Caribbean yet it is never naively isolated, never nostalgic, always interestingly attentive to the difficulties of its colonial histories and migrations. Part of the intense pleasure of reading his work is how it swoops back and forth between detail and big picture.

Because so much of Brathwaite’s book is about the difficulties of colonial histories and migrations, he is the master of the lament. He uses the form frequently and he uses it persuasively. And it is just one more example of how Brathwaite is always challenging genre expectations that he turns so often to a form that is usually gendered female and is also often about an inability to speak for so much of his historical, political poetry.

Born to Slow Horses, Brathwaite’s most recent book and among his strongest, has at least two laments in it although it could probably be argued that most of the book is lament. One of the obvious laments, “Kumina,” is about Brathwaite’s wife’s son who is hit by a car while riding a bike. The poem opens with the telling of the death and then in a mother’s voice tells the story of mourning day by day. This poem has all the marks of the classic Brathwaite lament. It begins by telling about the death of someone, then turns to an intimate chronicling of the pain of someone close to the dead who is still alive using classical tropes (the breaking of bread, the tears, the disorientation and inarticulateness), and then there is a moment when the poem turns individual grief into the larger collective pain of a culture dealing with an impossible history.

The other obvious lament is called “9/11 Hawk” and it has some of the classic Brathwaite lament moments but moves out of them, perhaps even more into this “transboundary” space. “9/11 Hawk” opens with the narrator listening to music and begins with a memory of hearing Coleman Hawkins play “Body and Soul” and a discussion of how music matters. It moves then to an uncle who died in the Twin Towers when they collapsed and a telling of this event. The voice of lament in this poem is not so much the narrator and his uncle but Beth Petrone, the pregnant wife of a firefighter who died in the buildings who is quoted throughout the end of the poem. The images in this poem are productively less sure, more complicated than in “Kumina.” There is “the broken quaver of the water leaking in our one canoe” and “death in the fission of indebtedness” and “the unknown animal that is now yr sibyl sister at the door.”

While Brathwaite has been living in New York City for some time, it has never held the attention of his work the way the Caribbean has. For this reason, it is interesting to see him writing about 9/11. So much of his work laments those dead because of the world’s powers colonial histories it is fascinating to see him writing from within the center of the empire and to have him mourning with it. The poem ends with the narrator wanting to reconnect with his/her beloved. “O let me love you love you love love you” is one among many lines where it is left ambiguous if the beloved is a human or New York City, whether this love is something that is difficult or easy.

The last poem in Born to Slow Horses uses short, mainly three line stanzas, Robert Creeley-style. It is not really lament but could easily be read as comment on lament. Here Brathwaite abandons his classic trope of expansive listing and swooping historical views and turns to tell a story of a dead robin strangled by a string around its neck and is caught on a power line. Most of the poem describes another bird that comes to mourn the dead bird. The poem ends with the a boy cutting the dead robin down and burying it. The still living bird in this poem is clearly lamenting (this bird is gendered male): “the mourn-/ing male bird circle/& sing//at the hope-/less/song-//less/tighten-/ing string.” But it seems telling that the boy comes from outside this relationship between the dead and the mourning and respectfully ends the song through his actions. This ending suggests that there might yet be another, new phase of Brathwaite’s work after this postSalt one.

December 07, 2005

follow up test to find the inverse of k mod q where q is prime.

remember from fermat's little theorem,
we showed that k^(s-1) was an inverse of k
when we defined s = q -1.
so k * k^(s-1) = 1 mod q.
or k * k^(q-1-1) = 1 mod q.
or k * k^(q-2) = 1 mod q.

check it.


q=
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 ef049282 e49accee e5675b4a 7fde735a 9df5f9bb
k=
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 4431b782 3ab50c2a 60b7acd9 10d63af1 000041a7
k^(q-2) mod q
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 7d5f5e08 b46f64ec d41bce75 31795a1b 93efd4dc
k*k^(q-2) mod q = 1?
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
k is 2
2^(q-2) mod q
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 77824941 724d6677 72b3ada5 3fef39ad 4efafcde
2*2^(q-2) mod q = 1?
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
k is 3
3^(q-2) mod q
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 9f5861ac 98673349 ee44e786 ffe9a23c 694ea67d
3*3^(q-2) mod q = 1?
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
k is 17
17^(q-2) mod q
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 707a9f4c a7d06070 6bf46732 1e0e5466 e0ec3949
17*17^(q-2) mod q = 1?
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001
k is 13
13^(q-2) mod q
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 ca3ef21f fc82fc2c 9ab9eac8 e259c411 9959fab2
13*13^(q-2) mod q = 1?
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001

Also, last week, Afflicted Powers: Capital and Spectacle in a New Age of War by Retort group. Good quick read. Puts into very clear prose all those arguments that you feel but haven't had time to spit out right. Made me wonder if people write clearer in groups. The questioning of the blood for oil argument in the chapter of the same name is the strongest and most important (it goes very clearly over the argument that the war with Iraq is not for oil, war disrupts oil extraction after all, but is to feed the US need to sell arms). The last chapter, the solution chapter perhaps, on public space and chosing not to be modern feels the weakest.
Reading up on 'mere steganography' by Bruce Schneier. Guess who employs the most mathematicians in the world?* What is the memorandum of understanding between the director of the national institute of standards and the director of the national security agency?** What is zero-knowledge proof of identity and why did the us army force the us patent office to deny issuing a patent on the algorithm on the grounds that it would compromise national security?***

I love the oiler phi function. Sometimes called the euler totient function. Is that supposed to rhyme with quotient? If n is a prime number, phi(n) = n - 1, which is the count of integers below n and greater than 0 that are not a multiple of n.

The n - 1 part comes from the fact that a prime number has no factors less than n.

1 is better known as 0 in this world where there is a limit to the maximum number you can 'use'. like on a clock, you can only use up to 12 then it goes back to 1. where is zero again? sometimes this set of numbers from 1 to n is called a finite field, or a galois field. in such a field, you use clock arithmetic.

so if n were 7 and since 7 is prime, phi(7) = 7 - 1 = 6.

cryptographers can do some mere steganography with primes and the phi function and also fermat's little theorem, which oiler later generalized. it defines what 1 means in a finite field.

let s = phi(n) and let n be prime.
then s = n - 1.

x^s = 1 mod n

x to the s power is equal to one, mod n (mod n means the max number you can use. it's also called the remainder function. 5 mod 3 is 2--the remainder when of 5 divided by 3. 6 mod 3 is 0--there is no remainder when you divide 6 by 3, it goes in evenly.)

it's kind of astonishing that if you take some astronomical prime n like 982347592873458907234058972340958723945790234871 (probably not prime), then subtract one from it, raise a number x to the n-1 power and have it come out to be 1.

perhaps not, it's just a clock.

public-key cryptography is all about 2-way functions. really a one function and it's inverse.
invertible. we can use the phi function again to help us with calculating inverses.

intutively you know what this is: in addition, it's any number added to another number to give zero. the inverse of 4 is -4. in multiplication, it's any number times another number to give one. the inverse of 4 is 1/4 since 4 * 1/4 = 1.

so say we have a huge prime number x. how do we find it's inverse in a prime finite field?

it's you remember a few tricks about exponents, it's not that difficult. in simple text like this, ^ means raise to the power. when you multiply x^2 * x^3 = x^(2+3) = x^5 because the trick is to add exponents.

the inverse of x is defined as x to the minus 1, x^(-1)

so the question is what do i multiply x by to get 1?
x^(-1) of course since:

x * x^(-1) = x^1 * x^(-1) = x^(1 + -1) = x^0 = 1

now we can do a little trick with phi(n) = n - 1.

let s = n - 1 again.

x * x^(s-1) = x^1 * x(s-1) = x^(s+1-1) = x^s

now from oiler's generalization of fermat's little theorem
we know:

x^s = 1 mod n

so the inverse of x, x^(-1), must be x^(s-1)
since we mulplied it by x and the answer was 1.
that's the definition of an inverse.

i gotta build the fucking . . .
i gotta merge the fucked up . . .
i gotta archive the god damn . . .

later
bill


-----------------
*NSA
**Listen to me. Ok.
***Feige-Fiat-Shamir
blurb for Jules Boykoff's Once Upon a Neoliberal Rocket Badge forthcoming from Edge:

I’ve heard it said that poetry that uses the phrasal fragment can’t have a coherent and strident politics. I’ve never believed it. But if for some reason you have, read Once Upon a Neoliberal Rocket Badge and be shown the way. This collection makes the lyric and socialist realist documentary look helpless in the face of neoliberalism. If there is, as many want to argue now, a poetry of globalization, Jules Boykoff is writing it and those looking for what poetry might look like post-Seattle will find this necessary reading.
eventual review for American Literature.


Mastery’s End: Travel and Postwar American Poetry. By Jeffrey Gray. Athens: Univ. of Georgia Press. 2005. 288 pp. $44.95.

Critical studies of travel literature have been for the most part limited to prose and to pre-twentieth century works. Jeffrey Gray in Mastery’s End, a study of travel and literature interestingly and productively turns to poetry and the second half of the twentieth century and in the process questions a lot of the received wisdom of travel writing. The book begins by suggesting that the Mary Louise Pratt’s pivotal and determining argument that the center is blinded by the ways it is shaped by the periphery does not hold for writers after the 1960s, especially for poets. Much of this work, Gray suggestively argues, questions travel as “mastery, hegemony, acquisition, penetration, pollution, rapine, and centripetal force” and instead suggests that it might be more about “vulnerability, diminution, incoherence, disorientation, and centrifugal force.”

In this book, Gray does detailed single author chapters on Elizabeth Bishop, Robert Lowell, John Ashbery, and Derek Walcott. And in between he looks at the Beats, concentrating on Allen Ginsberg but turning also to Gary Snyder and Robert Creeley, and also more contemporary experimental poets such as Lyn Hejinian and Nathaniel Mackey. Gray shows his smartness in his close and attentive readings of poems. He points to Bishop’s hesitant voice, a Lowell unhinged by travel, the often overlooked trope of travel in Ashbery’s work, the tiredness and frustration of Creeley’s traveler, the Beckett in Mackey.

As his reading of how travel literature might be less colonial mastery and more self questioning and defamiliarization suggests, Gray is at his best when he challenges the received wisdoms of the academy. He is in part able to do this because he refuses to accept as oppositional diverse contemporary poetries. In Mastery’s End he usefully juxtaposes Ashbery and Walcott not to reify the opposition between experimental and multicultural, but rather to explore how both are poets of disengagement who use metaphors of maps and territories but rarely for deterministic reasons. He usefully reads Lyn Hejinian’s Oxota, a crucial book that has received little critical attention as it has been so overshadowed by her My Life, as “an expedition to locate an elusive and estranged identity.” And he ends the book suggestively with an epilogue on Walcott and the Nobel Prize, challenging Raoul Grunquist’s complaint that the Nobel Prize only goes to universalists and suggesting that instead, it is more often awarded to localists.

At moments, the focus on travel feels more as a limit and less as a possibility. The travel part of Gray’s arguments could be helped along by a slightly more quantitative approach at moments. It would be interesting, for instance, to see a little more statistical attention to what countries receive and what ones are spared the attentions of twentieth century poets. And also one might wish for more attention to how related or unrelated this poetic attention is to US foreign policy. The hard questions of travel post-1960s for US citizens, mainly its alliances with globalization, do not come much into question. So some big questions feel unaddressed, such as does the vulnerability and disorientation of poet travelers really let them off the hook of mastery?; if there is a politics to this feeling of disorientation, what is it?; and to what is it opposed? Still, Gray’s generous readings of the individual poems in this work ring true. The close readings in Mastery’s End are so smart and so generous that one finishes the book hoping that Gray turns next to an even wider ranging study of contemporary poetry.
Read Ismael Ait Djafer, Wail of the Arab Beggars of the Casbah as I packed up books in my office for move this weekend. Or avoided packing up books.

"I spit at you, hyenas and jackals."

December 04, 2005

This talk at Berkeley--Alessia Ricciardi, "Politics and Miracles: Empire in the Land of Neorealism"--was totally great because I'm a sucker for anyone who stands up and says we need to have some optimism around political theory in the name of change. I could listen to that over and over. Also Miracle in Milan has for years, ever since I saw it in Hudson Valley in 1987--have intense memory of where and the night and who i went with, etc.--has been my all time favorite movie.

December 01, 2005

Stephanie Young's Telling the Future Off. Stunning "Age of the Mercenary" in the middle of the book.

Blog Archive