Blog for August 2007
19/08/2007: TrivialEncoder/0.2
An update to my PHP encryption class. Despite the name, it’s becoming a pretty sophisticated encyption machine. New encryption algorithms added:
- Vigenerè cypher
- One-Time Pad
- Bruce Schneier’s Superencyption
- Various other methods using the MCrypt library
The TrivialEncoderManager class has been obsoleted by TE_Machine, an abstract class with several different child classes for encoding, decoding and analysis. TE_Machine has a greatly improved parser for methods, which has made it a lot easier for me to add additional functionality such as the ability to analyse an encryption technique to see how strong it would be, and to check whether the output would be ASCII-safe. TrivialEncoderManager is still present, but is deprecated and will be removed next release.
19/08/2007: Sequential Video Thumbnails on Linux
So, I was looking for a way to create sequential video thumbnails (like this one) from a video file on Linux. I found that my options were severely limited. On Windows there are a plethora of tools capable of this fairly simple task, including Media Player Classic, but on Linux all I could find was QFrameCatcher. The QFrameCatcher website was inaccessible yesterday; today I managed to download the source code, but couldn’t get it to build.
Anyway, I decided it probably wouldn’t be very difficult to build my own so…
dhyana.pl
dhyana.pl is a small Perl script that co-ordinates mplayer and ImageMagick to create a lovely montage of thumbnails. (Dyhana — roughly pronounced as “jahna” — is the Sanskrit word for a deep meditation.)
16/08/2007: Elvis
Today marks the 30th anniversary of the day Elvis Presley faked his own death.
13/08/2007: Fake Steve is Dead; Long Live Fake Bob!
Now that fake Steve has been outed, I’m sure everyone is looking for the next fake blog.
Well… Fake Bob Keefe
12/08/2007: PHP Debugging with Style -OR- How I Learned to Stop Worrying and Love the Bug
PHP lets you define your own error handler, so I decided to get a bit fancy. MegaErrorHandler (MEH) outputs its errors as specially-formatted HTML comments, with the details of the error encoded using JSON.
A small client-side script, with an associated stylesheet then pulls this data out of the comments and formats it as a nice little interactive bug-viewing console, allowing you to view a stack trace for each bug, inspect superglobals, view the syntax-highlighted source code for the file where the error occurred, check the list of defined constants and other useful things…
02/08/2007: Command Line Interfaces, Again
I posted a couple of years ago that the command line is the interface of the future. Today I stumbled on a couple of articles that seem to agree with me:
Quicksilver blows away both Apple’s Dock and Microsoft Windows’ Taskbar in terms of speed and usability. And what is it? A command-line interface with a bit of eye-candy.
Command-line really is the way to go.
02/08/2007: Open Mobile Alliance DTD Oops!
The Open Mobile Alliance, who are responsible for co-ordinating the web-browsing efforts of mobile phones, seem to have misplaced xhtml-mobile12-model-1.mod. This file is a key part of the DTD for the latest version of their XHTML Mobile Profile standard, which defines how authors should construct web pages intended for the consumption of mobile phones. Now that it’s missing, all pages that reference the XHTML Mobile Profile 1.2 DTD are instantly invalid. Oops!
Oh, and the corresponding files for versions 1.0 and 1.1 of the standard have also gone astray.
01/08/2007: PHP Encryption Class
Here’s a simple PHP library for encoding and decoding text.
Examples:
<?php
$trivialencoder_auto = FALSE;
include 'TrivialEncoder.class.php';
$manager = new TrivialEncoderManager;
$plaintext = 'Hello world';
// Chain together Triple DES, Memfrob and Base64 encoding.
// Note: 3DES encoding is passed an (optional) key "mysecretkey".
$encoding = '3des mysecretkey;memfrob;base64';
$cyphertext = $manager->encode($encoding, $plaintext);
echo $manager->decode($encoding, $cyphertext); // Hello world
?>