Leveraging synergy in this championship year
Michael Davies
Local
News
Software
Utility
Powered by PyBlosxom
Copyright © 2003, 2004, 2005, 2006, 2007, 2008 Michael Davies, |
ack and pvThe latest additions to my shell toolbox are ack and pv. Very cool indeed!
Real-world use for MD5 CollisionsPractical implications of weak cryptography - Creating a rogue CA certificate. What does this mean? If this approach is generalised, you can't trust secure websites at all -> every single secure website may not be who you think they are, even if your browser happily presents the "little green tick". So who uses secure websites? ecommerce (Amazon, eBay, your bank), the tax office, many government departments, social networking portals, software update sites, software download sites. Scary, yes, but highlights the need to build seemlessly upgradable cryptographic software solutions - and we need to do this now before public confidence in our virtual world is eroded.
Python 3.0 released!Python 3.0 is released into the wild. Download now...
Mind RotCharles Petzold on Does Visual Studio Rot the Mind?. For some reason I hadn't seen this before (Thanks Kevin for pointing it out). It raises some very important questions about code automation, programming productivity, maintainability, data driven software and the importance of naming things right. It's very interesting as an opinion piece circa-2005 for comparison against where we now are at 3 years later.
Python 2.6 released!Awsome news! Python 2.6 has been released! Here's a list of what's new.
Perl's CGI is broken
use strict;
use warnings;
use CGI;
use Test::More qw( no_plan );
my $cgi = new CGI;
$cgi->param('foobar', 6);
ok( $cgi->param("foobar") eq '6', "6 is a magical number" );
$cgi->param('foobar', 4);
ok( $cgi->param("foobar") eq '4', "And 4 is a favourite" );
my %hash = ( "random_key" => '13' );
$cgi->param('foobar', $hash{'randomKey'} );
ok( $cgi->param("foobar") eq '13',
"but a simple typo in a hash key shouldn't be so hard to find" ); # Fail
ok( $cgi->param("foobar") eq '4',
"so it hasn't changed but there's no complaint" );
$cgi->param('foobar', $hash{'random_key'} );
ok( $cgi->param("foobar") eq '13', "The key is to get the key right :-)" );
What sort of deranged API silently ignores calling a setter with an undef? Surely a warning or exception could have been thrown? Or perhaps setting the value to undef, or to the empty string, or even "You messed up, Idiot!". But quietly swallowing the error and leaving the value unchanged is really bad form. This sort of thing doesn't rate well on Rusty's API design advice: How Do I Make This Hard to Misuse?. Grrr.
Biometric InsecurityA very nice succinct blog about why we should be cautious about biometric authentication schemes. It's a useful read. I've been discussing this with Ken for the last couple of years - security systems are only as secure as the weakest link in the system. If your biometric reader (fingerprint, retinal scan, DNA fingerprint, whatever) just dumps raw data over some data bus, who says you can't do a man-in-the-middle data capture and replay attack? How about your storage of the data? How about the security of that database? And the operating system on which that database sits? How about protection from unauthorised modification? How about that data falling into the hands of unauthorised users? We've already seen databases with the records of millions of citizens "disappear". Given that our judiciary holds biometric data in very high esteem, who will guarantee its integrity? I'm all for improving security, but the illusion of security only harms the innocent. It seems to me that many biometric system proposals are susceptible to the Bribing the Doorkeeper on the Great Wall of China-kind of attack.
pyglet enters public betaEver since Richard Jones introduced pyglet at OSDC 2006, I've been waiting expectingly for it to get to beta. Well, that day has come!. As the webpage says, pyglet is a cross-platform python windowing and multimedia library for Python - something cool to play with. Congratulations to all involved!
Shell redirectionThe standard idiom of redirecting stdout and stderr to /dev/null is of course:
frobnicate 1>/dev/null 2>&1 What is lesser known is that this can be short-cutted to:
frobnicate &>/dev/null
Maven Trick #257The project I'm looking at right now uses Maven to do dependency management - and trust me, the project has so many dependencies it _needs_ Maven :-) So the question begs, when integrating the large working source tree with external-to-maven tools, how do you get the CLASSPATH out of Maven for use elsewhere. Many googles and reading bits of Maven: The Definitive Guide later the solution is a semi-obvious:
Playing with certificatesOne frustrating thing is working with digital certificates that someone else has created and deployed - and you have to pick up where they left off. I mean, with a directory of crt, ket and csr files, how do I verify which ones belong to which? and exactly what was that openssl command-line to check? It's not something I do everyday. That's what I use this blog for - to cover the overflow when my brain is full Reverse encoding the ASCII-armored text is relatively simple:
Of course checking the modulus and public exponent sections manually is error-prone. So make it easy on yourself and check the shorter hash instead:
And once you realise that the private key has been lost, or that the certificate has expired, you'll need to do one or both of the following to regenerate thus:
Moonlight: Silverlight on LinuxMiguel and his team have been busy - 21 days after Microsoft revealed their cross-platform browser-hosted CLR efforts, the free software world have reimplemented a good junk of it.
Besides the cool tech and the flashy demos, what is very impressive by itself is what can be achieved by a small focused team in a small amount of time. Slow viscosity/inertia/velocity (or whatever you want to call it) is the enemy of innovation. Slow development progress begats further slow progress, whereas quick results sky-rockets the motivation of the team. Seriously, the more projects I see, the more I'm convinced that if you can get the obstacles and interruptions out of the way then you have a great chance to get a coherent, innovative, quality software product developed quickly. It's less about process, it's less about documentation, and it's more about focus. The hackfest/sprint is certainly under-utilised as a software development lifecycle today.
Dynamic Support for Scripting LanguagesMicrosoft today announced 1st class support for Dynamic Scripting Languages for the .NET Framework. That is, they're adding first-class support for dynamic languages on top of the Common Language Runtime (CLR) - they've coined it the Dynamic Language Runtime (DLR). Currently the target languages are Python, JavaScript (EcmaScript 3.0), Visual Basic and Ruby. I'm not sure if this is big P Python, or just improving the integration of IronPython. This is important, even though it's just a Microsoft announcement for their Windows platform. The Mono project will no doubt be inspired by Silverlight to raise the bar again. Looks like we're going to get multi-language, cross-platform, client-side immersive web applications - this is AJAX++. Links:
Large Behomeths, Small Startups, and Open SourceSo Paul Graham has come out and said that Microsoft is dead. That's a pretty big claim on a company about to get several million sheep to pay several hundred dollars each to upgrade to the latest offerings of Vista and Office. But it might not be fatal - if they have the will and are willing to use the tens of billions of dollars they have in the bank, it would be possible to change corporate culture - but it would be a monumental change. There are good signs already (and some negative ones), but it's really all small stuff. The issue is that lumbering behomeths have trouble being agile. Innovative software doesn't get written by large companies with long-standing culture practices and heavy-weight processes; but rather by small nimble startups, where hours worked are long, and everything can be challenged. Demotivation is limited because there are no boundaries. One particular instance where there are no boundaries (read this as disruptive technology) is of course an Open Source development model. The keys here are software freedom, distributed development, collaboration, international 24x7x365 involvement with full internationalisation. While I have my own personal biases (blind-spots?), I think the Open-Source Software snowball is rolling down the hill, gaining momentum, and can't be stopped. Jump on board, or be overtaken.
Step 3 - check!After considerable negotiating, arguing, pain (by me) and hard work (by James and Michael) my day-job project finally gets to tick off the Step 3 of the Joel Test - Do you make daily builds?. If our platform had a GNU build system this would have been easy - make, xunit, cron, mail - but this is on Windows, so we have a solution held together by duct-tape and chewing gum (with more and more python getting added :-) But it is holding together. The good news is that I now get an automated command-line daily build on a controlled build-box, straight out of source control, followed by xunit tests run automagically, with the result emailed to me every day (including logs so that failures can be analysed without returning to the build box). Yay!
Trusted Code 2.0So back in .NET 1.1 days we had a problem running C# code off a remote fileserver - Windows trusts, by default, code on the local machine only. Fortunately there is a work around, which we dubbed The Dilbert Zone. Moving our product across to .NET 3.0 means changing the security trust on the local machine for this new environment in a similar fashion. Start the appropriate configurator found at Start|Settings|Control Panel|Administrative Tools|.NET Framework 2.0 Configuration Navigate to Console Root|.NET Framework 2.0 Configuration|My Computer|Runtime security Policy|Machine|Code groups|All_Code|LocalIntranet_Zone and select Add a Child Code Group. Create The Dogbert Zone, with condition type = Zone, Zone = Local Intranet, and Permission set = FullTrust. Select Ok a few times and exit out of this user-unfriendly administrative console. Restart Visual Studio 2005, and voilĂ - it just works as expected.
SHA-1 not considered safeSo I don't know how I missed this: Federal agencies should stop using SHA-1 for digital signatures, digital time stamping and other applications that require collision resistance as soon as practical, and must use the SHA-2 family of hash functions for these applications after 2010 Both MD5 and SHA-1 aren't safe as previously mentioned - but having an advisory indicating that you should stay away from SHA-1-series algorithms is biting. Here's a paper on the implications on S/MIME, TLS and IPSEC. This is something that really should be considered soon.
About AESRussell blogs about choosing encryption algorithms. He comments: The US government (which incidentally employs some of the best cryptologists in the world) recommends encryption methods for data that is important to US interests (US military and banking operations for starters). Why wouldn't you want to follow those recommendations? Do you think that they are putting back-doors in their own systems? This is true, but for an additional reason not mentioned. The current block cipher standard is AES. While it was chosen by the US government as a standard, it wasn't develoed by the US government - making the chance of back-doors even less likely. This is not the case for DES - which was an in-house US Government development effort - meaning that it's open to claims of back-door introducing. There are some questions asked about whether there are inherit weaknesses in AES, but these centre around the "newness" of the mathematics used - the strength of any crypto system is based on solving "hard" mathematical problems, so if someone finds an easy way the "tower of cards" all falls down - and all data is open. But the same could be said for ECC. That's why some people encrypt their encrypted data with a different encryption algorithm - even if one crypto system falls, there's another barrier protecting your data. So, as a recommendation, you need to ask a few things - how important is the data you are wanting to protect? What timeframe does it need to stay secure? If it needs to be protected forever - like who killed JFK :-) - then you need a really strong crypto system. If it's a personal deep dark secret, probably just your lifetime. If it's your travel planes, only a few weeks. If it's your online banking session - it's only minutes. The other thing is identifying your adversary - if it's the government, then nothing really is secure enough - be assured that if it's in their national interest they will break open the data. If it's some local phisher/cracher - then a much weaker system is all that's needed to protect you as they don't have the mathematicians, nor the computing power, to cause you grief in the timeframe that the data is sensitive. The easiest solution though is have nothing to hide :-) Addendum: There's nothing new here - just go read Schneier for more info.
Java to be Open SourcedAs gman says, "Hell has frozen over." Sun will be making an announcement here very soon that Java is about to be released under GPLv2. This is great news, albeit 5 years too late. I hope Java gets some momentum again now as a result. Well done Sun! Long live Java!
Microsoft .NET Framework 3.0 released.NET 3.0 has finally been released. What's is it? Basically it's .NET 2.0 with extra APIs such as Windows Presentation Foundation WPF (was "Avalon"), Windows Communication Foundation (was "Indigo"), workflow stuff etc. What will it let me do? Hopefully do high-level programming for rich clients. Hopefully not having to avoid bugs in the 2.0 release. The most interesting question is how this relates to Mono. Will these new APIs be supported?
SHA-1 partial chosen plaintext attacks successfulSo back in February, we found out that SHA-1 was gone - researchers could generate 2 plaintexts that generated the same hash. But at least the plaintexts were gibberish, meaning that while SHA-1 was broken, the break was of limited use. Now comes a more serious blow - in a similar vein to the previously reported MD5 attacks it's now possible to choose part of the plaintext and still get the same hash. Yikes. Quoting the article:
Using the new method, it is possible, for example, to produce two HTML
documents with a long nonsense part after the closing | ||||||||||||||||||||||||||||||||||||||||||