Showing posts with label cryptography. Show all posts
Showing posts with label cryptography. Show all posts

30 July 2007

it's the same old thing as yesterday

I recently reread Cryptonomicon so now I'm psyched about encryption again, and thinking about getting PGP for the new desktop PC I'm planning on building. Part of the reason I haven't actually commenced construction is that I'm not entirely sure what its function will be. I do want to be able to play more demanding games, but the majority of the games I play on the PC are older and don't require cutting-edge technology. I am also trying to find entirely new interesting uses that can be accomplished with newer technology.

In other news I spent most of the day figuring out how to build a high voltage test circuit. This will generate a few hundred watts of heat so I decided a case fan would help. While looking at case fans on newegg.com I found this amusing note in a review:

"The reviewer who is concerned about the .4 mm width difference really doesn't have much to worry about as .4 mm is about the width of 3 or 4 human hairs...about 0.015 inches. You should be able to deflect the back plane of your Sonata that much by giving it a dirty look. Then you'll be able to fit all those 88's in there."

Also, I went to Wikipedia at one point to look up resistor technologies, which eventually led me to reading about anamonics, combinations of anagrams and mneumonics that are frequently used in competitive Scrabble. Interesting trick.

05 September 2005

incorporated

I watched The Corporation. I thought it was fairly well done. As for the actual content, I agree with some of their ideas but not all of them.

I tinkered with my RSA demo program a little bit, but the stuff I would like to add involve stuff I've forgotten how to do and would generally be a pain.

Overall I had a slow weekend. I am very excited to go home next weekend, but I still have things to do here before I leave. I wanted to take care of some stuff today, but I forgot it was Labor Day so nothing productive could get done. I did get a small fire safe today though, which makes me feel a lot better about keeping important documents out here. Fortunately, banks and stuff are open again tomorrow so I can start attacking my list of things to do again. My virtual Post-It notes are slowly obstructing more and more of my desktop.

I have usually kept Freeman docked at the desk over the past few weeks, but I have recently been taking advantage of the fact that it's a laptop to do computer stuff on the futon. I like my futon.

I haven't gotten out and about too much recently. It would be nice to go out to the coast again, but I am trying to put off filling up the car if at all possible. I am going up to Portland in a few days anyway (though my exact plans are not yet determined - another important thing to take care of). I will be home in Michigan all next week, but again my plans are not yet determined. I do know that I want to get up to MSU and over to U-M at some point.

I played a bit of Counter-Strike: Source over the past couple of days, and I regained some skill, but frankly I am tired of video games right now. I am more interested in becoming a better Go player than in becoming a better CS:S player.

I want to get a bike so I can explore Corvallis without wasting gasoline, but I don't know where to find a decent bike (for a sane price). One more item on my list of things I haven't gotten around to getting yet.

18 August 2005

93 is not prime

I found the bug. It did not involve a 216-digit number. Part of my problem was some of my inputs. For example, I typed in 93 as a prime without thinking. There were also problems with actual primes though. I had Mathematica double check some of my program's numbers, and I found a disagreement in certain cases. I figured my program might be blowing out variables again and made everything an unsigned long long. I was right - everything works great now. My RSA keygen program can be very slow though, if anyone knows of a good algorithm for e * d = 1 mod phi, solve for d, let me know.

Edit: Never mind, I figured it out. The way I was doing it was horribly inefficient. My keygen is fast now and works most of the time, but I think I'm blowing out variables again. I am not going any further until I find a better data type.

I also remembered, I get paid tomorrow! About damn time.

generator

Today's physics recitations went much better than yesterday's. I used more of my natural teaching style today. Fewer people showed up today, which is a little discouraging, but at least the few people that show up probably want to be there. Small groups are easier to work with anyway. I collected their first homework problem today but I haven't looked through the stack of papers yet.

The math thing I worked out yesterday is used in the actual process of RSA encryption and decryption. Now I'm working on my RSA key generator, which is a mess. After I first coded it, I found there was some kind of nasty bug that made the keys not work. I replaced a chunk of code and checked my prime number generator, but the problem is still there (maybe even worse). If I can work out this bug it would be a good coding day.

I ran across an article today about a company that uses Stirling engines with solar collectors. That's pretty smart. So this morning I was looking at solar power stuff and coding RSA stuff, instead of preparing for my recitations.

15 August 2005

cypherpunk

And so another week begins. I spent most of my weekend in pirate-related activities, either playing my new game or reading my pirate book. Today I have a meeting with the prof I'm TAing for. Since this summer session is only three weeks long, I'll probably be pretty busy for the next couple of weeks.

I found my cryptological mathematics book and I've been flipping through it. Last time I got into this crypto stuff I wrote a couple short C++ programs to do the hard math stuff for the RSA algorithm so I could see how it worked. I looked at them briefly yesterday and I think they can be improved. I used a method from abstract algebra that will actually let the computer calculate things like 4353^53216 mod 13562, but there are always better ways. If you just tried calculating it directly, the number would blow up and wouldn't fit in any variable type. Using the abstract algebra method, it actually works and the processing time goes as 53216 for the above example. Wikipedia's article on modular exponentiation actually has a better way, so I printed the article off and I'm going to see if I can work through it. Wikipedia claims the processing time of this new method goes as log (53216), so I want to try it out.

(The answer to that example is 4059, by the way.)

Edit: After an embarassingly long time trying to calculate processing time (I'm no hardcore coder), I quickly showed that the processing time is indeed directly related to the size of the exponent. I kept adding zeros at the end, and the time went from 4.5ms to 4.5 seconds or 45 seconds. I might try for 450 seconds when I look over new method again, and 4500 seconds when I go to my TA meeting.

Edit 2: I tried for the 450 second run, but it turns out the required exponent was larger than my data type could hold. After blowing out several other data types I'm currently using something called an unsigned long long, which I'd never heard of but is capable of storing values up to about 18.4 quintillion. The unsigned helps with that, and for some reason it also runs faster than a standard variable. So basically I've been doing some data type optimization so I can run some serious benchmarks. Now that that's settled, I'm going to try for 300 and 3000 second runs.