Securing your bitcoins in offline storage

December 08, 2013

There are various levels of security that you can apply to your bitcoins. A specific level of security should be applied depending on the size of the stash.

A mobile or online wallet is often sufficient for smaller sums that you intend to be using for online trading or online purchases. I would still recommend enabling 2 factor authentication for any online wallets and avoiding rooting or jailbreaking your mobile when using mobile wallet.

However the ultimate security for your bitcoins is a wallet that is completely disconnected from the internet and as such unreachable by hackers.

Such wallets are commonly called offline wallets or cold storage and some concrete examples are paper wallets, other physical media, USB hard drives and upcoming dedicated hardware devices.

I’d like to talk about encrypted paper wallets because they appeal to me the most as a cold storage due to their simplicity and the low cost of creating them.

The common theme when creating offline wallets is that any device used to create them has to be offline and the wallet itself can never be connected to an online device until you plan to spend the bitcoins it contains.

An offline wallet will prevent any money to be spent but you are still able to send bitcoins to it and to view the balance easily. Just import the public key into your favourite wallet client.

(Remember that a bitcoin wallet consists of two parts: the public key is like an account number that you give out for people to send money to and you can also use to check the balance. The private key is like a PIN code that is used to spend the bitcoins. If anyone finds your private key your wallet will be emptied and this is irreversible).

When combined with the very strong encryption standard BIP0038, the paper wallet can even be publicly shared without risk of being compromised (as long as the password is kept secret). They can also be packed up online!
What you need: a live linux cd, source code for bitadress.com, one or more usb drives, a printer.

  • Download the bitaddress.org code to your freshly formatted USB stick
  • Download Tails linux ISO and burn it to a DVD.
  • Boot up your computer using the DVD and load up bitaddress.org html from the USB stick.
  • Generate one or more encrypted paper wallets and scan the public address so that you can send coins to it later.
  • Save the paper wallets as PDF to the USB stick(s)
  • Print multiple copies of the paper wallets or write down the private key manually using pen/paper.
  • You are done

If you find creating and booting from the DVD complicated you can use the online versions of bitaddress.org but be aware that your are then exposed to any man-in-the-middle attacks or if your computer has been compromised an attacker could get hold of all your paper wallets.

Additional steps depend on the sum you are planning to store. Put the paper wallets in waterproof bags. Leave a copy with a friend you can trust. Consider storing a copy in a safe. Split up your stash between multiple wallets to lower the risk and to allow for spending in increments.

A recent version of the Android mobile wallet Mycelium has added import of BIP0038 encrypted private keys. This makes it very easy to scan the encrypted wallet and start spending the bitcoins on it.



Keywords:

How do I get Bitcoins in the UK

November 15, 2013

bitcoinBitCoin is taking the world with storm and with it the price of BitCoin is skyrocketing.

In the last 6 months there have been a flood of new and innovative services that use BitCoin. Enough to justify a long term life for bitcoin and to justify an ever increasing price due to a physical limit on how many bitcoins that can be created.

ATMs that convert cash to bitcoins, online and high street shops that accept bitcoins as payments, high street brokers that convert money to BTC and back, payment gateways and even Subway that accept bitcoins and are just some of the examples.

You may have been interested in getting in on the action; be it for investment purposes or just to experiment.

Unfortunately BitCoin (and all crypto-currencies in general) is a complicated concept and the barrier to entry is quite high.

You have to consider how to get your money, be it USD or GBP or EUR, across to a person that is willing to part with their bitcoins (BTC).

You also have to consider security: how to avoid losing your cash, how to transfer the bitcoins to yourself and how to keep your bitcoins safe.

Bitcoin exchanges are a place where sellers meet buyers and the bitcoin exchange provides a service to match these people up. There are several established bitcoin exchanges but instead of discussing them all I’d like to mention the one that has allowed me to instantly purchase bitcoins (and litecoins, LTC) in the UK on several occasions.

Bitbargain.co.uk is using UK bank transfers, also known as Faster Payments.

This allows for near instant and free transfers between buyers and sellers. I cannot stress enough how much this facilitates bitcoin trading in the UK.

The downside is that the purchase prices on Bitbargain are a bit higher than on an exchange so this favours sellers but not buyers. The markup seems to be 8-10%. However if you want to get in on Bitcoins quickly then this is still the best option.

Once you have your bitcoins, you have to consider security. Bitbargain charge a small fee to leave your bitcoins with them which is an incentive to move them away. This is a smart move because exchanges with a lot of bitcoins have been target of hackers that have stolen millions worth of bitcoins.

Bitcoin paper WalletTo purchase bitcoins and tucking them away my preferred method is a “paper wallet”. The concept is to print out the cryptographic secret that secures your bitcoins and store the physical paper in a safe place (or multiple places).

You can still use you your wallets public address to send bitcoins to but you (nor anybody else) is able to spend those bitcoins without having access to the printed secret.

To keep smaller amounts I can recommend a mobile bitcoin wallet, for example Bitcoin Wallet for android devices and Blockchain for iOS devices. Keep it to small amounts only!

Good luck, have fun and please avoid purchasing at the top of a cycle!



Keywords:

Clean install of OSX Lion on your Mac but keeping documents and applications

November 26, 2011

lion_logo.png My Macbook Pro ground to a halt after 6 months of heavy usage.

It started to freeze up frequently preventing it to load anything from the hard drive. Things that already were in memory continued working but accessing anything from the hard drive or unlocking the screen saver took up to 2 minutes. Not even "ls -l" worked.

A quick visit to the Genius Bar and after running many hardware diagnostics test it was diagnosed as a software error. They weren't sure whether it was a problem just with the user account or whether it was in the system so the recommendation was to reinstall OSX.

Since OS X Lion (10.7) was out I thought I might as well install that rather then re-installing Snow Leopard (10.6).

Call me old fashioned but I don't trust OS installations over older OS installations. I prefer fresh installs from removable media so I starting looking for a method to install OS X Lion from fresh but it wasn't as easy as it should be!

By installing the OS X Lion on a new partition on the hard drive I was able to keep all my documents and application and move them across when needed.

What you need:
OS X Lion installer (purchased from Apple store)
An empty recordable DVD (it may be possible to install Lion from USB but I haven't tried that)

First you need to create a start-up DVD from the OS X Lion installer. The trick is to find "InstallESD.dmg" inside the Lion installer. You can navigate items inside the installer by choosing "Show package contents".

InstallESD

WARNING: The OS X Lion installer is deleted after you have installed Lion so make a back-up copy of it for future use!

Insert the blank DVD and choose to start Disc utility.

lion disc utility

Drag InstallESD.dmg to left-hand side of the Disc Utility, select the newly added InstallESD.dmg and hit Burn (and Burn again). It will take around 10 minutes to burn and verify the DVD.

Time to restart your Mac. Hold down Alt (Option) when booting to be presented with what media to boot from. The DVD should be visible after a short spin-up of the drive.

You can choose to install OS X Lion over your older version but this will delete all your files and applications. Instead you may want to consider keeping your old installation and install Lion onto a new partition.

Once booted into the Lion installer, don't click continue but rather select Disc Utility from the top bar. Shrink your old partition to minimum possible, create a new partition in the newly created space and continue with the OS X Lion installation into that partition.

The installtion takes a good 30 minutes but once you have re-started and logged into Lion, your old partition is visible and you can copy items from it.

If you were using File Vault to encrypt your documents you have to navigate to /Users/<user name>, show content, double click on "sparsebundle".

You will be asked for your original password and it will be mounted as a new image. You now have access to your old documents and application settings.

Most application you can simply drag from /Applications on the old partition but first copy the application settings (bookmarks, settings, accounts, passwords and etc). There are two places where the old application settings live:

<user home>/Library/Application Support/<application name>
<user home>/.<application name>

You need to show hidden files for this. You can enable hidden files by entering the following in a terminal window:

defaults write com.apple.Finder AppleShowAllFiles YES

Good luck and enjoy a clean install of OS X Lion (10.7)



Keywords:

JSR 303: Combining custom and standard validators

July 12, 2011

We are using the JSR 303 Bean validation API (Hibernate validator as the implementation) on a project and recently faced a problem.

Whenever we were using our own custom validators in combination with standard validators like NotNull and NotEmpty, the standard validators seemed to be ignored.

The result was that we were getting NullPointerExceptions in our custom validators and sometimes we were getting duplicate error messages for the same invalid field.

I haven't poured over all of the JSR 303 documentation in detail so maybe I've missed a recommended best practice but the following code in the default NotBlankValidator gave me a hint.

public boolean isValid(String s,
        ConstraintValidatorContext constraintValidatorContext) {
        if ( s == null ) {
            return true;
        }
...
Why would you ever return true (i.e. valid) for an input that is null? That doesn't make sense until you realise that validation is a *combination* of all constraints.

This means that your validator should only return false for your specific test. If it fails for a chained validation, for example if input is null, it should return true and rely on the NotNull validation to report that error.

You still have to guard for null and empty inputs but return true if they occur rather then returning false.

Hide any required basic validations inside your custom constraint annotation. For example NotBlank does that:

...
@NotNull
public @interface NotBlank {
...


Keywords:

Bali with children

February 02, 2011

children in baliWe just completed what I believe to be our first adventure with our kids; a trip to Bali, Indonesia.

Our children are 4 and 3 years old and we were contemplating whether they would be able to handle the 17+ hours long *day* flight and the culture shock.

I'm glad to report that it all went spectacularly well and our children have memories for a life time.

We started out in Ubud which is a wonderful place busting with culture, music and art craft.

While the Mrs enjoyed browsing the markets and shops the kids were much more keen on excursions. Luckily there are a lot of activities in and around Ubud that are just a short drive away.

monkey forestMonkey Forest is a little pathway in the local forest which is filled with curious and cheeky monkeys.

You can buy a bunch of bananas by the entrance to give to the monkeys but watch out, once they get a whiff of the fact that you are carrying their favourite dish, they will not leave you alone until they have robbed them all.

Out of 50+ friendly monkeys there was one that hissed at our daughter but we just moved on swiftly and didn't have any further problems.

The elephant safari park is just an hour away and while outrageously expensive ($100 for the four of us) the kids loved the elephant ride and feeding the elephants.

To be honest you can give the 20 minute elephant ride a miss and just enjoy the elephant park.

Favourite restaurant: Cafe Lotus and Wayan Cafe
Favourite stay: Kori Ubud

After a few hectic days in Ubud we decided to relax at the beach for the rest of the holiday.

Out of all the various beach locations in Bali like Kuta, Seminyak, Legian, Nusa Dua and Sanur we opted for Sanur. Crowded with retired ex-pats and families with young children, Sanur seemed like the perfect spot.

bali bird parkHalf-way between Ubud and Sanur is the lovely bird park. Walk around the aviary and see that many, many colorful birds up and close.

The kids loved discovering all the different bird species (from tiny to large) but the highlight was when 3 birds were placed on each of them. Great photos in the park btw!

Sanur is a very laid back town with the usual tourist shops, bars and restaurants but no chaos (like in Kuta). You get the occasional guy on the street calling "taxi?" at you but nothing intense.

We had such a great time in Ubud doing daily excursion we decided to continue with the theme.

First day out was a busy day with Uluwatu temple, white beach and water sports at Nusa Dua, Dreamland Beach and food at Jimbaran (no sunset).

Just a sad word about Dreamland Beach; it is totally wrecked. Car parks, sewage like water, hordes of "local" tourists and an abandoned concrete construction. Give it a miss!

tanah lotGoing north turned out to be a much better direction. More rice fields, temples like Tanah Lot and Batukaru, lake Bedugul and hot springs. All in all some of the best sights Bali has to offer.

Waterbom is a water park in Kuta. Again it is a very expensive experience compared to other less touristy activities in Bali but it is a wonderful break in pace for the kids.

We spent a whole day swimming, running around and sliding down various slides. The kids loved it and it's needless to say they fell asleep early and hard.

Favourite place: Tanah Lot
Favourite stay: Tandjung Sari
Favourite restaurant: Tandjung Sari

temple at lake bedugulIn summary Bali turned out to be a great beach and sightseeing holiday with the children. The combination of Balinese culture, nature, people and great value was just unbeatable.

DO IT!

PS Wayan, Made, Nyoman and Ketut are Balinese names where Wayan is the first born, Made the second and so on. If you want to get some laughs and instant acceptance from local people call your kids Wayan and Made and watch their sweet reactions.



Keywords: