Thursday, 24 January 2008

Leopard is unstable

I paid £80 for an OS upgrade that brings more trouble than anything else:


  • Switch off your wireless router while running, Leopard freezes

  • Java implementation sucks

  • Finder crashes

  • If you hibernate your laptop, on wake-up, it does not find your wireless network: you have to reboot (Windows XP does a better job)

  • Safari crashes more than Firefox, better use Firefox



Overall, the only thing great about Leopard or Tiger after owning a Mac for more than 2 years are only iTunes+iPod and iPhoto. Buying the Mac is not worth it.

Saturday, 12 January 2008

DES, String, byte and KeySpec

I was given a small task to extract two secret keys from a String of length 32 in hexadecimal format:

String keydata = "BB3F730E11F4F02CC4EFB8FF18AF37AA";

The two keys were of length 16:

String left = keydata.substring(0, 16);
String right = keydata.substring(16, 32);

Using Apache Codec, extract the byte data:

byte[] leftKey = Hex.decodeHex(left.toCharArray());
byte[] rightKey = Hex.decodeHex(right.toCharArray());

And finally, get the cipher:

Cipher cipher = Cipher.getInstance("DES");
DESKeySpec desKeySpec = new DESKeySpec(leftKey);
SecretKeySpec secretKeySpec = new SecretKeySpec(desKeySpec.getKey(), "DES");

And finally, init the cipher:

cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec);

Thursday, 10 January 2008

Another disgraceful day for London Public Transport

Each time you leave your home to take the tube, you never know what is going to happen. Highly likely, there will be a signal failure somewhere. You are just hopping it will not be on the lines you take.
This morning, both DLR and Jubilee lines were not working, due to “overcrowded platforms”.
Working in Canary Wharf I ended up getting off at Bank, walk towards London Bridge, then Tower Gateway finally to reach the DLR… with at least 200 people doing the same thing.

Not only my monthly fare increased to 93£, but as another passenger put it, “so much for customer service to be treated like a cattle”.

Blog Archive