Generally Pretty Happy's Journal
[Most Recent Entries]
[Calendar View]
[Friends]
Below are the 20 most recent journal entries recorded in
Generally Pretty Happy's LiveJournal:
[ << Previous 20 ]
| Friday, June 26th, 2009 | | 8:33 pm |
| | Thursday, June 25th, 2009 | | 8:26 am |
My grandmother died last night. I bought my mom some plane tickets yesterday, and I'm glad I did, because she was able to see her before she passed. I was going to try to get myself some today. | | Monday, May 11th, 2009 | | 1:32 pm |
LJ as Personal Messaging
Carl! The email address I have for you is old and full of fail. Can you shoot me a line at "me at dj spinmonkey dot com" so we can talk about plans for this Saturday? Thanks! Current Music: Happy Up Here - Röyksopp | | Friday, February 6th, 2009 | | 3:21 pm |
Messiest Sounding Gig Ever
So hey! I'm spinning Dr. Sketchy's Anti-Art School next tuesday for the Valentine's Day Massacre at the East Atlanta IceHouse, which will be the first joint event with Boozer Doodle. The models this month are DevilDoll (aka Brook) and Kellie LaPlegua, and I hear there's going to be a runway battle and a "chocolate wrestling match." I'm not sure what that involves, but it sounds like good times. Musically speaking, at this point I have no idea what kind of stuff I'm going to be playing. I may just go through everything in the library and see what sticks - it'll be wildly eclectic, but hopefully fun. So anyway, yeah, if you're in to figure drawing and also debauchery, you should try to make it out - it promises to be some awesome times. Current Mood: busybusybusyCurrent Music: L'amour et la violence - Sébastien Tellier | | Wednesday, January 21st, 2009 | | 12:19 pm |
Wild and Crazy
I think maybe I complain about things too much. I don't see myself as the sort of person who's bitching and moaning all the time, but if I really pay attention to all the things coming out of my mouth in a given day, a lot of it is negative. I'm going to try to go a full month without complaining about anything and see how that affects my outlook and general happiness. If I find I have to talk about something I'm not happy about, I will try to do so in the most constructive and non-judgemental way possible. If you catch me complaining about anything between now and February 21st, feel free to slap me - it's like a month-long game of Punch Bug except for complaints instead of Volkswagens. | | 12:02 pm |
Tic Toc
My left ear is clicking in time to my heartbeat. It is driving me crazy. (Short drive, I know.) | | Friday, December 26th, 2008 | | 11:17 am |
| | Wednesday, November 5th, 2008 | | 1:00 am |
| | Tuesday, October 28th, 2008 | | 12:53 am |
Wrinkles
I noticed smile lines forming around my eyes today. It made me happy. In other news, still ripping CDs. Finished off both books, now working my way through the big case. Current Music: The Cure - Lovecats | | Saturday, October 25th, 2008 | | 3:24 pm |
Assorted Flavors
Sometimes music is painful because "Oh my god this is that song I locked myself in my bedroom for three days and played on repeat the first time Suzanne broke up with me." And sometimes, as bedivere points out, it's painful because "...why do I have Ace of Base?" Current Music: Spock - Never Trust A Klingon | | 1:49 pm |
"Biographically"
So, I'm spinning at Spring 4th for Halloween, and I decided it was finally time to go through and rip my CD collection. I've grabbed a handful of the highlights over the years and listen to them periodically, but I hadn't realized just how long it had been since I heard most of what's in the old books. It has been a surprisingly wonderful - and occasionally painful - experience. Current Music: New Order - Special | | Tuesday, July 8th, 2008 | | 8:30 pm |
Gig Gig Gig Gig
Hey, so I'ma be spinning this Saturday for the Skin 2 Afterparty at the Spring 4th Center (aka, The Red Door). Or, well, technically I guess I'm spinning Sunday morning - the party runs from 2am to 7am. I'm supplying all the gear, so the is the first time I'll be using my Torq setup with the fly vinyl control system,[1] which is how I've been doing pretty much all of my practicing at home. It's just so much fun! Come on out, and I'll show you all the buttons and knobs. I would have posted this in my djspinmonkey account, but apparently I've forgotten the password for that one. That's what I get for not posting about any of my gigs for the past year, I guess. I love finding new music and playing out at clubs, but I can fall pretty far behind on the whole self-promotion thing sometimes. Maybe I should do a podcast. ----------- [1] Am I allowed to say "fly"? I'm a dj, so... maybe? On the other hand, I'm also an out-of-shape white computer programmer who is no longer in my 20s. So... maybe not? Maybe I would have been, a decade ago when "fly" wasn't a decade out of date? | | Monday, May 19th, 2008 | | 5:25 pm |
Travel Plans
So, I'm off to Portland for my annual site-seeing/family-visiting/technical-co nference-attending trip in a couple days. RailsConf is out there again this year, so my company is paying for the plane ticket and hotel during the conference, and I've taken an extra week from the 21st to the 28th as personal time. If anybody's going to be in the area, let me know and I'll say hello while I'm out there. Current Music: Junkie XL - You Make Me Feel So Good | | Friday, May 9th, 2008 | | 4:51 pm |
Not Grumpy About The Weather...
...for once. For all my bitching and moaning when it gets too warm (stay tuned!), Georgia really is amazingly beautiful for a few weeks in the spring and fall. There are roses in our back yard, and a vine has grown over the gate leading to the shed, forming a natural arch. Every morning for the last few weeks when I've gone to get my bicycle, I've stopped to admire them. There are petals and the scent of roses all through the walkway. It's really nice. Current Music: Tracey Thorn - It's All True | | Friday, November 30th, 2007 | | 1:04 pm |
| | Friday, November 16th, 2007 | | 5:20 pm |
Armchair Cryptography Conversations with a co-worker and recent news got me thinking about writing a peer-to-peer poker program, with no central server. I've already got a rough model for the card game itself written out in Ruby, which I was going to use to practice writing different poker AIs, so "all I need" is an interface, a little networking code, and some crypto to keep things secure.
Cryptography is, of course, Real Hard Stuff (tm), so I'm probably going to mess that part up - smarter people than I have written badly broken crypto algorithms. On the other hand, this is just for fun and noodling around, and I'd like to bone up a little on the math end of security anyway, so I'm going to try to roll my own. Here are my initial noodlings, and if you guys have any thoughts ("OH HAI YOU'RE DOING IT WRONG!"), feedback would be great.
Distributed Random Number Generator
My first thought was that I would need a way for the group of players to agree on random numbers. Ideally, even if all the players but one were in cahoots, as long as at least one player was honest, then no other player or group of players should be able to control or predict the final numbers. (Of course, if nine out of ten players are conspiring against the lone tenth, that guy's screwed anyway, but at least we can make sure his numbers are random!) It turns out I didn't actually need this after all, but it was fun, so I wrote it anyway.
Anyway, my first pass at the RNG is that the number generation occurs in two phases. In the first phase, all players secretly select a number and broadcast a cryptographic hash of that number. Once all the hashes have been broadcast, everybody reveals their secret number, broadcasting those. All the numbers are then XORed against each other, and the result is the random number. Players can verify that hashing the secret number results in the previously broadcast hash.
For hashing, I'm using a base and a large prime that are kept throughout the game (and are, in fact, built in to the algorithm in my implementation). The hash is equal to the base raised to the power of the secret number modulo the prime, or ...
(b ** n) mod p
...where b is the base (5 in this case), n is the secret number, and p is the large prime. This is based on the first part of a Diffie-Hellman key exchange, and in order for the D-H exchange to be secure, this operation must also be secure (in the sense that given the hash, it is difficult to determine the secret number). Since lots of really smart people have not been able to break the D-H exchange, I'm fairly confident in it.
Unfortunately, though, there is a potential problem: if you were able to find a collision in the hashing routine, you would have a hash value with two (or more, I suppose, though that's unlikely) valid secret numbers. This would allow you to submit the "trick hash" in phase 1, then in phase 2 you could wait until everybody had broadcast their secret numbers, and then broadcast whichever of yours resulted in the more favorable random number.
This might be solvable in several ways:
- Choose a different prime each game, since finding collisions is computationally hard and probably not feasible within the context of a single game. How would you choose a random prime before the Random Number Generator had been established, though?
- Find all the "trick hashes" and specifically disallow them. This is probably computationally infeasible for reasonably large primes, though.
- Choose a better hashing algorithm with no collisions, or with inherent random elements like in the first option. This seems like the most promising possibility to me.
I was thinking about better hashing algorithms, and tried out a version where each player did a full D-H exchange with his neighbor to either side, but that was a little slower than I'd like. While pondering the other central problem of an online poker game, I realized I didn't actually need the distributed RNG at all, so I haven't fully solved this problem yet (though I'd still like to!). Any thoughts are welcome, and I should also probably go read up on hashing algorithms. I can show you my Ruby implementation, if you're interested.
Speaking of the other problem with p2p poker...
Face Down Cards
I had initially imagined that any un-dealt cards would simply be in an unordered set, sort of a Schrodinger's Deck, in which the top card would only be determined when somebody actually needed to draw a card. Then, so I thought, you could just keep a public deck of cards and use the RNG to pick a card out of it at random when dealing.
But, that won't work, because players have face down cards - they can see these cards from the moment they get them, but nobody else can know what they are, or draw the same cards later. That means we can't keep an un-encrypted deck. If we did, you could tell what somebody drew just by looking at the deck before and after they drew the card (this seems pretty obvious in retrospect... dur). On the other hand, if you can't see what's in the deck, how do you draw a card from it?
I haven't implemented a solution to this one yet, but I have a general idea that you could assign each card a string (say, "Three of Clubs"), and then pass a list of those strings around the table. Everybody encrypts each card/string with a private key, shuffles the deck/list, and passes it to the next player. At the end of this process, nobody knows what order the deck is in, and each card is encrypted with all ten keys (assuming you have ten players). The deck is now made public. To draw a card, you take one off the deck and pass it to the player in front of the player who's drawing it. The card is then passed around the table, and each player decrypts the card in turn. When the drawing player receives it, the only key left on the card is that player's, so they decrypt it with their key and then have the original text ("Is this your card?"). If a player were voluntarily dropping out of a game, they could just decrypt each card in the deck with their key. New keys would need to be chosen each hand, and the deck would need to be re-shuffled and re-encrypted.
I still need to pick an encryption algorithm. It needs to be commutative, so that the keys can be applied and removed in any order. Also, there's a problem where any player can render a hand unplayable by dropping out of the game without decrypting the deck. That's a fairly serious vulnerability, even if they forfeit the hand by doing so. Several players working together could play very aggressively, safe in the knowledge that one of their compatriots could kill any hand they stood to lose too much on. I'm not sure what the solution to this problem is, yet (which is most of why I haven't coded anything up yet).
Current Mood: thinky Current Music: MIA - Sweet November | | Thursday, October 25th, 2007 | | 4:33 pm |
Well, *I* was excited.
"Hey, guess what? I found a bug in rsync today!" "You found a bug in our sink!?" "Yeah, I know!" Current Mood: Er, wait, no....Current Music: Lali Puna - Clear Cut | | Tuesday, October 23rd, 2007 | | 5:15 pm |
So I found this pen in a parking lot...
It was sort of nice looking, so I picked it up. I like pens. Today, I needed to write something down, so I pulled it out. It was out of ink. I scribbled a little bit and was about to throw it out (I never get around to refilling these things), when I took a closer look and said, " Hunh." Also, I'm going to be spinning tonight at the Spring 4th center for the Experiminimal night. Come on out and say hello! Current Mood: inklessCurrent Music: Trentemoller - Miss You | | Sunday, October 21st, 2007 | | 1:58 am |
I tell you what...
...Kraftwerk was meant to be played on vintage 8-bit video game systems. Current Mood: enlivenedCurrent Music: 8-Bit Operators - Pocket Calculator | | Thursday, October 11th, 2007 | | 3:47 pm |
Overheard In My Kitchen
"John, be careful with those onions and don't cut yourself." "Pfft, I'll be fine. I just have to hold them a little funny when I get to the end. Nothing to- ouch. Oh, hunh, that's a lot of blood." I should probably listen more to Suzanne. |
[ << Previous 20 ]
|