Decrypting (android) mobile bitcoin wallet backups

I wanted to move some coins around with the recent Bitcoin Cash hard fork and needed to decrypt my private keys from my android wallet.   After trying to mess around with a command I found online:

openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-08-14 -out bitcoin-wallet-backup-2017-08-14.decrypted
enter aes-256-cbc decryption password:
bad decrypt
140383167771904:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:535:

I finally found the correct command in the source repo for the wallet.  Here’s what you really want to run:

openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup-2017-08-14 -out bitcoin-wallet-backup-2017-08-14.decrypted


Building a new desktop PC

So, I’m building a new desktop and thought I’d drop my shopping list here….


More NFA Fun Data by state

Inspired by this post, NFA Fun Data by state, and feeling that Utah was underrepresented, I crunched some per-capita numbers using the census estimated populations for 2014. Here are the top states for each section (per 10,000 people):

Top state for Machine Guns: Connecticut at 74 per 10k people
Top state for Silencers: Utah at 171 per 10k people
Top state for Destructive Devices: Wyoming at 2,022 per 10k people (D.C. is #2 at 583)
Top state for Short Barreled Rifle: New Hampshire at 21 per 10k people
Top state for Short Barreled Shotguns: Alaska at 16.9 per 10k people (D.C. a close 2nd place at 16.6)
Top state for Any Other Weapons: Wyoming at 5 per 10k people
Top state for FFLs: Wyoming at 15.3 per 10k people (Montana a close 2nd place at 15.2)

20151031_110945Utah made the list!
I must admit that I was initially surprised to see D.C near the top of the lists, but I suspect that it is due to Law Enforcement Agencies. It is interesting to note that D.C. only has 25 FFLs. Also, I have no idea why there are so many destructive devices per person in Wyoming.

Original data source ATF’s Firearms commerce in the USA
My formatted data is here and here

Run a shell script with setuid

Linux has protections in place to prevent you from running shell scripts with root permissions that have the setuid bit set.
But there’s a way to work around that. (yay! but also be careful!)
You’ll need to create a binary with setuid on it…. Here’s how to create the binary:

Create the your C file (somefile.c)

int main()
   setuid( 0 );
   system( "/yourpath/to/yourscript.bash" );
   return 0;

Compile it:
gcc somefile.c -o somefile

Set permissions on it:
chown root:root somefile
chmod 4755 somefile