Team Dick

Japanese Comedians or Investigative Reporters?

Posted by @ 11:17 AM on May 27, 2014

RocketNews24 has a cool story about how a Japanese variety show stumbled into an expose on Freemasonry.

The show, You ha Nani Shi ni Nihon e? asks foreigners as they arrive at a Japanese airport why they came to Japan. They then follow these people for a little while learning more about them and what they’re doing. One of the people they approached came to Tokyo to take part in the initiation ceremony of a new Grand Master in Tokyo. The film crew were invited inside the Grand Lodge in Tokyo and got a peek at something few outside of Freemasonry ever get to see.

I like the idea of the show itself, and I love how something so simple can turn into something quite interesting.

Comments Off on Japanese Comedians or Investigative Reporters?

Suberanai Hanashi 7

Posted by @ 12:34 AM on May 3, 2014

Suberanai Hanashi is a show hosted by Hitoshi Matsumoto. In the show a group of comedians sit around a table taking turns telling funny stories. Who goes next is determined by a roll of a dice.

The title of the show basically means “Stories That Don’t Suck”.

Unlike a lot of Japanese television, this is one where a lack of understanding of the language means you’re not going to get anything out of it. Lucky for us GodzillaRadio has created subtitles for us. It’s an hour long and worth checking out and laughing your ass off.

Comments Off on Suberanai Hanashi 7

Hashing My Way to the Top

Posted by @ 12:22 AM on May 3, 2014

I saw a video on the internet not too long ago. In it, on a screen in the background, for just a few seconds, displayed a string of text I immediately recognized as being base64 encoded data. I paused the video, typed the text into my base64 decoder ring, and found it was a URL. I put the URL into my browser and found out that I’d stumbled upon a little contest that would begin sometime in the future and that I should keep checking back to see if the contest has started.

Well I forgot about all of that and only went back this evening to check and sure enough the contest had begun. It ends on May 10th.

The contest is fairly straightforward computer geek stuff. An MD5 hash value was provided and the contest was to find strings that, when similarly hashed, shared X number of the 128 bits in the hash on the page. There’s a form asking for a name and e-mail address to register. Once registered, you can submit strings you find that meet the criteria. When the contest is over, the person with the most number of found hashes wins a new, very cool computer.

There’s only 10 people on the leader board and only 2 of them have over 10 found hashes, but those two currently have over 100. The number of bits you need to match can be changed as the contest operators sees fit. It’s currently set at 107 bits. With nothing to do on a Friday night and a desire to take a little Java refresher, I dug in.

Here is the source code for the program I’ve written.

It’s multi-threaded to maximize all the cores in my CPU (4). Thread priority is set to minimum, so I can keep doing whatever I want on my computer and it won’t slow down. I’m averaging about 900,000 hashes a second and after an hour I haven’t found a match. This may take some time. The program can be set at the command line to use more or less threads and change the difficulty to. Try it at difficulty of 90 and you’ll see a few start popping up immediately.

I’m not providing a URL to the contest and the hash in the source isn’t the real hash the contest wants you to use. Maybe I’ll mention it after the contest finishes. For now I just want to find my first hash with the program I wrote. My electric company will love me.

— Update 2 Days Later —

It started out at about 900,000 hashes a second. I found some ways to speed things up such as avoiding string manipulation wherever possible and using bit operations instead of Java objects like BitSet and I found a slightly faster RNG than the native java.util.Random. That got me up to 3.5 million hashes a second. I then realized I was running a 32-bit JVM (for browser compatibility). I installed a 64-bit JVM and now I’m up to 5.5 million hashes a second.

The source linked above has been updated to my latest.

I probably have about 36 hours running this thing so far and I haven’t found a match yet. I modified the code to keep track of the highest number of bits matched against so I can get some sense of progress. The highest I’ve matched is 103 bits. So close, but so exponentially far away.

I’ve got six days left.

— Update 3 Days Later —
I’ve removed the use of String objects from the search loop (except when outputting a match, that doesn’t mean much from a performance standpoint) by writing my own code to generate the hexadecimal values instead of using Long.toHexString(). I have also removed the calls to the random number generator in the loop. Now I seed the loop with a random value, but then keep hashing the previous results. This is, in a way, how RNGs work and for my purposes (i.e. this is not a security application) it gets the job done without the overhead of generating new values with every iteration.

This has boosted performance up to 10 million hashes a second. 5 days left to go and no matches yet. Still trying to squeeze out every last drop I can from this code (“SO USE ASM or C!” Yeah, I know, but I want to stick with Java as this is a Java learning experience.)

Comments Off on Hashing My Way to the Top