Multiple Hashing for Security

September 1, 2009 | No Comments

With all the talk of MD5 and SHA-1 collision attacks it got me wondering the other morning: would storing two different hashes of the same data result in a more secure environment rather than just moving on to the next new hash algorithm?It’s not an easy case to make, but suspend disbelief for me.

The case I’m addressing is one of hashes as signatures, such as software delivery. The collision risk here is that an attacker breaks into a popular source of software (let’s say gnu.org) and replaces the good files with compromised files that share the same size/hash. When a user downloads the file and compares the hashes they find a match and proceed to trust the software. But what if instead of just providing the result of a single hash (let’s say MD5) the provider supplied both SHA-1 and MD5 hashes of the file. Now an attacker has to compose a file that collides on both algorithms. As a general method (regardless of algorithms) this seems like it would mitigate attacks and give longer life to hash implementations.

Consider Debian for a moment. The Debian package lists include a MD5 hash of the package file. If/when they decide to switch to SHA-256 (a reasonable choice right now), it would require a lot of retooling. Since they have to keep the MD5 hashes anyway for backwards compatibility, why not retool to support both hashes. Now an attacker who compromises a package has (what I would imagine to be) an exponentially more difficult task.

My coworker, Will, brought up an interesting question. In the case where the data is secret such as storing the hash of a password, does computing multiple hashes of the secret data provide an opportunity for an attacker to glean information about the secret data? Storing two hashes of a password would slightly decrease the efficacy of brute-force attacks, but also increase the efficacy of attack via rainbow tables. If there’s a potential for information leakage the medicine may be worse than the disease.

Update: Doug found a paper that addresses the first part of the question here. It concludes that concatenation is a hedge, but doesn’t quantify how much value it adds.


Rock Band Choices

August 2, 2009 | No Comments

Channeling xkcd today:

rock-band-risk-vs-reward


Mi Iaia

March 12, 2009 | No Comments

Mi Iaia
My grandmother, Carolina, or Iaia as we called her passed away today of natural causes after 94 years of life. 

She lived and died with grace and dignity and was an example to me and so many other people for how to live a life of adversity and persevere without losing your sense of humor or humility. She played a role in every stage of my life and I am very thankful for the lessons she taught me with her words and with her actions. I am glad to have spent three days earlier this week by her side.

She will be missed by more people than I can list here, but is survived by her daughter Cristina, her son Rodolfo (Yiye), her grandchildren Gaby, Veronica, Roger, and Pablo, and six great-grandchildren including my two girls, Alexis and Anna (whose middle name is Caroline after Iaia).

Ciao, Iaia.
June 16, 1914 - March 12, 2009


Silly Unix Tricks #1: De-crufting Bind9 configuration files

February 18, 2009 | No Comments

I’d like to resume writing occasionally, so the first one will be brief. Trying to debug a DNS problem tonight, I realized my BIND9 configuration file (named.conf) had accumulated too much cruft over the years. Unfortunately, the C/C++ comment style made it difficult to grep the useful bits. cpp to the rescue:

janus:/var/cache/bind/master# wc -l master-zones.conf
100 master-zones.conf
janus:/var/cache/bind/master# cpp master-zones.conf  | wc -l
49

This cleans up the file nicely. Of course, you’ll have to add the useful comments back in.


Loudoun Sheriff’s Day Out

August 7, 2008 | 4 Comments

Here’s a note I just submitted to the Loudoun County Sheriff’s Office. I think a few of the people who pay attention might have something to say about this.

On Wednesday, August 6th, I was driving home on Countryside Blvd. when I encountered what I can only describe as a checkpoint at the intersection with Carrollton Rd. Both directions of Countryside were blocked and all vehicles were being detained, as far as I can tell, without cause. I was asked by an officer to show my driver’s license and upon quick inspection was waved along.

Given the media attention that was received seemingly similar activities in D.C., I was wondering if you could provide some information as to what occurred that day and why. I’m worried this may have been a violation of mine and other citizens’ civil liberties, but would like to reserve judgement until I have more information.

I appreciate your time and considerate attention to this inquiry.
Thank you.

It didn’t occur to me to question the basis for asking for ID and it didn’t really anger me until after I left the checkpoint. I went back out with a camera to document what was going on. To their credit, the police didn’t seem to mind me taking pictures. At 6:45pm, just as I was about to drive through the roadblock again and this time refuse to show ID, they all simultaneously and unceremoniously packed up and went home.

Not even sure what to make of it. Someone’s already suggested I’m overreacting, and that may be so, but I nevertheless was left with an uneasy feeling. Some pictures below.

Northbound CountrysideNorthbound Countryside DetailSouthbound CountrysideMobile Command Unit on Southbound Countryside

Update: I received a quick and helpful response from the Sheriff’s Office with this information:

Mr. Averbuj, for several years the Loudoun Sheriff’s Office have conducted Driver’s License Checkpoints throughout the county as a continuing crackdown on unlicensed drivers. We have conducted three such checkpoints this Summer.  The location for the checkpoints are selected based on deputies who report a number of unlicensed drivers during their daily traffic stops.

During the checkpoint on Wednesday nine motorists were cited with driving without  a license and two for driving on a suspended license. Those were among the 42 citations issued during the 3 hour checkpoint.

I found a page on the very recent overruling of similar roadblocks in South Carolina, and the SCOTUS decisions that govern such activity.


OSX:Changing the “Web Receipts” Folder

April 14, 2008 | 5 Comments

One of my favorite features in Leopard is the “Save to Web Receipts”. Judging by the posts on the web I’m not sure whether this is a new feature or not. Either way, I really like it… except… Saving important web pages (receipts, confirmations, reservations, etc) is something I’ve been doing for a long time now without this feature, it was just a pain. In fact I did it on Windows for years before even switching to Mac, except all by hand. The function in OSX saves me the trouble of naming the file and choosing the directory which is great, except I don’t like the way it does either.

The first problem is that in general the date of the receipt is the most importat sorting factor, and having it in the “date modified” column is mildly dangerous, like if I make changes or notes on it for example. The second problem is at work when I’m saving receipts it doesn’t help me get them to the unified receipts folder at home.

I decided to solve both problems today and luck you, I’ll share. Reading the web the way this was implemented changed at some point. It used to be an Automator script but apparently that was rather limiting (which is pretty bad if you’re Apple and your own Automator doesn’t cut it). So they re-implemented in Python. This is a shame because having opened up Automator for the first time it looks really cool and relatively user friendly, unlike what you’re about to repeat below.

  1. In Finder, go to /Library/PDF Services/
  2. Duplicate the “Save PDF to Web Receipts Folder” and rename it to something else but keep the .pdfworkflow extension, in my case, “Save to DropBox Receipts.pdfworkflow”
  3. Right-click and select “Show Package Contents”
  4. Naviage into the “Contents” folder
  5. Delete the “Resources” folder
  6. Open “Info.plist” in a text editor and rename the “CFBundleName” string to something helpful, probably something that strongly resembles the filename you created in Step 2, then save and close that file
  7. Open the “tool” file in a text editor
  8. If you want to change the target folder:
    1. around line 24 you’ll see something the line that sets the value of destDirectory to “~/Documents/Web Receipts/”, change that.
  9. If you want to add a date at the beginning of the filename
    1. at the top of the file (around like 9) insert a new line with:
      from datetime import date
    2. around the previously mentioned line 24 add:
      title = "%s - %s" % (date.today(), title)
  10. Save and exit

That will end up giving you filed names like “2008-04-13 - American Express Online.pdf” saved in the directory of you’re choosing. To test just go to any app, bring up the print dialog and confirm that your new entry shows up. Also, if you have any problems, just trash the duplicate you created and edited.

EDIT (2008/08/26) - Fixed the missing close parenthesis at the end of item 9.2 pointed out by James. Thanks!


Making RSS feeds for Truveo

March 31, 2008 | No Comments

You Suck at Photoshop on TruveoYou’ve probably seen or heard of the unconventional “You Suck at Photoshop” tutorials. Maybe you weren’t offended, maybe you even like them. Maybe you want to track new releases via RSS. I was just like you a few minutes ago. I checked the MyDamnChannel.com website and couldn’t within my attention span find a feed that was just for YSaP videos. I’d seen them on YouTube so my first instinct was to go to YouTube and build an RSS feed from a search. Oops you can’t (at least not a very specific one).

Then I remember: Wait, I work with a search engine that does this EVERY DAY. Truveo makes this trivial. I went to Truveo.com and searched for:

“You Suck at Photoshop” channel:youtube

This returned the right set plus other spoofs and knock-offs. It needs to be restricted to the official user that posts them:

“You Suck at Photoshop” channel:youtube author:mydamnchannel

Perfect! Now click the “most recent” button to get the newest episodes first, and towards the bottom left hand corner you’ll see the traditional RSS icon. Copy and paste that link into your RSS reader and you’re done! (Click the thumbnail for a larger view of the page I’m referring to.)


Alexis Victoria Averbuj

February 20, 2008 | 23 Comments

Alexis Victoria born 2/20 around 3:15pm at 7 lb 5 oz and 19.5 inches long. Pictures later tonight. Mom and baby are healthy, happy, and hungry!

Update (2/21, 9:30am): Pictures of Alexis are now available.


Dilbert Widget leaks data

January 22, 2008 | No Comments

Scott Adams blogged about the new Dilbert comic widget which is great and I’m pleased with. The problem is (assuming United Media cares about not pre-releasing comics) that the comics are named predictably in sequence and are available on the server ahead of time. For example here is the comic for Sunday February 3. Oops! Now I don’t have to wait. I imagine they’ll solve this problem pretty quickly when they find out. While I’m on the subject of people who have solved this differently, Penny Arcade has an interesting system where http://www.penny-arcade.com/comic/ always points to the latest comic and there are absolute paths to get to a specific date. They have a particularly odd problem where the absolte URL doesn’t work, but /comic/ does. I get bitten by that problem fairly frequently since their RSS points to the absolute location. Another comic strip solves this problem in a decidedly low-tech way. Something Positive names each comic strip (image) with a descriptive title of the strip. Also, he releases comics unpredictably, and near as I can tell, maintains no buffer unlike Dilbert.

Back on the Dilbert side, interestingly at 400 it loops back to 2005, althought comic 1 is Jan 1 2007. It makes me curious about how the numbering sequence progresses, but invariably it will be deterministic. The easy way to solve this problem is to put something on the server side that prevents images from being served before their publish date. The wrong way to try to fix this is to try authenticating the widget (which, by the way, is now possible with FMSv3, but that’s for another day).

Update (Jan 23, 12pm): Just checked this today and the hole has been fixed. Now the actual gif seems to be an hash of some data, although apparently not the comic strip itself. Good turn around time!


Encoding and streaming to the XBox 360

December 19, 2007 | No Comments

Some very kind friends of mine availed me of an XBox 360 and Halo 3, an act for which I continue to thank them every time I see them. Having owned the original XBox (thanks to Vlad, are you sensing a pattern?), I was interested to see the next iteration, which I hadn’t to date. It’s a very solid product and I’m pretty happy with it.

I was pleased that it automatically detected my Twonkymedia server but it wasn’t playing my videos properly. The playback worked for a few seconds but then would subsequently deteriorate the further into the video it got. I don’t think it was a bandwidth issue because the original XBox with XBMC had no troubles playing the video. I concluded it was just some wonkiness between how I had encoded and what the XBox was capable of. I tried downloading some movie trailers and they played fine from the same device. My next task was to figure out what encoding settings to use.

I’d ripped all of Anna’s DVDs with Handbrake to h264/avi and those were having trouble playing. I searched the web hoping to find an XBox 360 preset for Handbrake but all I found was other people looking for the same. I finally remembered that Andrew had mentioned that he was playing videos across the network, so I consulted him. He suggested using the Apple TV preset, and that still wouldn’t work for me, until I figured out that Twonkymedia was keying off of the file extension. Changing the extension from mp4 to avi fixed Twonkymedia. Once I realized that things started working perfectly.