For anyone that find it useful, the bash script below takes a 0.X json wallet backup and dumps "account name, owner pubkey, owner privkey".
Tested with a 07/2014 backup (0.4.X?)
Tested with a 03/2015 backup (0.8.X?)
Only one "rare" dependecy.
npm install -g json
For the rest it uses standard command line tools (openssl, sha512sum, xxd)
pip install bitcoin (optional to have the privatekey in Wif format)
#!/bin/bash
WALLET_FILE=$1
PASSWORD=$2
SHA512=$(echo -n $PASSWORD | sha512sum -)
KEY=${SHA512:0:64}
IV=${SHA512:64:32}
cat $WALLET_FILE | json -c "this.type == 'account_record_type'" | json -c "this.data.is_my_account == true" | json -a data.name data.owner_key | while read -a line; do
NAME=${line[0]}
PUBKEY=${line[1]}
ENC_PRIVKEY=$(cat $WALLET_FILE | json -c "this.type == 'key_record_type'" | json -c "this.data.public_key == '$PUBKEY'" | json -a data.encrypted_private_key)
PRIVKEY=$(echo -n $ENC_PRIVKEY | xxd -r -p | openssl enc -d -aes-256-cbc -K $KEY -iv $IV | xxd -p | tr -d '\n')
which pybtctool > /dev/null
if [ $? -eq 0 ]; then
PRIVKEY=$(echo -n $PRIVKEY | pybtctool -s encode_privkey wif)
fi
echo $NAME $PUBKEY $PRIVKEY
done