Pavol Rusnak #hacker #crypto #opensource #openhardware #opendata

NFC Tags in Prague Metro

Prague Metro is full of advertisements, which are posters put in frames like this:

nfc-metro

Have you noticed something interesting in the picture?

How about now?

nfc-metro-detail

Don’t worry, I haven’t notice it either at first, until my friend Sargon pointed that out.

So this white circle looks like a NFC tag (and yes, it is there even when there is a poster over it).

Let’s try it out!

I am using Nexus 5 phone with NFC TagInfo by NXP application installed.

This is how it looks when you approach the tag with this app running:

nfc-metro-a-reader1

nfc-metro-a-reader2

nfc-metro-a-reader3

nfc-metro-a-reader4

The most important thing on the last screen are dots that appear between the sector number and its contents. This means that the area is unlocked and writable (x means locked, . unlocked). Yay!

Why is the tag not locked and anyone can write to it? I can only speculate, but I think that’s because the advertisement company uses the tags to track which frame has which ad and they care only about the tag ID, which cannot be overwrittern.

Let’s try another application called NFC TagWriter by NXP.

nfc-metro-b-writer1

Select Write tags button.

nfc-metro-b-writer2

Select New dataset

nfc-metro-b-writer3

I will be creating a link so I choose Link.

nfc-metro-b-writer4

After filling in the details I click Save.

nfc-metro-b-writer5

Now I can select data from my list.

nfc-metro-b-writer6

Let’s write it by clicking on Write!

nfc-metro-b-writer7

Now we can touch the tag.

nfc-metro-b-writer8

Success!

Now when we approach the tag with the phone, Android will read the tag, interpret the URL and open browser with this address.

The information on the tag can be used to trigger lots of other events too. Call a number, send an email, launch an application, show plain text or send or receive bitcoins (when bitcoin:address URI scheme or Bitcoin private key is used).

When we use the TagInfo application now, it will look like this:

nfc-metro-c-reader1

nfc-metro-c-reader2

nfc-metro-c-reader3

nfc-metro-c-reader4

nfc-metro-c-reader5

When I was experimented with the tags, I haven’t found any which had any data stored in it.

I hope next time I try this, there will be some nice poems (106 chars maximum) or links to some nice pictures. Heck, someone could even create an interesting augmented reality game, capture the flag, check-in (who wants to be a mayor of this train?) or …

The only limit is your imagination. And slow (or none) internet in the metro. :-(

Netflix Content by Country

Beginning of January Netflix expanded to most of the countries all around the world. The domination map looks quite impressive:

netflix_map

Unfortunately, the reality is not as bright as it looks. When I read the announcement, I did not hesitate and subscribed the service. I was very disappointed to see that most of my favorite shows were not available in my country and I cancelled the renewal of my subscription.

Later, I stumbled upon a website that maintains the list of Netflix content per country called uNoGS (unofficial Netflix online Global Search). I was very interested to see how my country stands when compared to the others. Sadly there was no visualization of uNoGS data on their site, so I came up with my own using the interactive Google Charts API:

(open map in full screen)

Let's build a Freedom Node

Recently, I decided to support some of the open-source distributed projects such as Tor, IPFS and Bitcoin.

One way of supporting them would be to send some money as a donation, but because I am a hacker with a good Internet connection I decided to build a computer node that will directly contribute to their networks and make them bigger and more robust.

I call it a “Freedom Node”.

Hardware

I evaluated lot of options and ended up buying the following components from my local computer hardware supplier:

item model price
Barebone PC by Gigabyte GB-BXBT-1900 $139.99
8 GB RAM by Kingston KVR16LS11/8 $35.38
240 GB SSD by Crucial CT240BX200SSD1 $64.99

I have decided to go for a solid-state drive option, but you can replace the suggested hard drive with a cheaper rotating disk (option A) or even bigger more expensive solid-state disk (option B):

item model price
A) 750 GB HDD by Western Digital WD7500BPKX $58.99
B) 480 GB SSD by Crucial CT480BX200SSD1 $129.99

The cheapest option is around $235, while the most expensive is around $305.

And this is how it looks! Nice, isn’t it?

bxbt

It is really small and quiet and it fits anywhere in your appartment or office, so you will completely forget about it.

Software

Now for the software part. I am going to use CentOS, because I am used to RPM distributions, but the process should be similar if you use Debian or Ubuntu.

  • Let’s download CentOS from https://www.centos.org/download/ and copy the ISO to a USB flash drive.

  • Follow the installation instructions and install the system.

  • Add EPEL (Extra Packages) repository by running:

yum install epel-release
  • Add Ringing Liberty Bitcoin repository by running:
yum install https://linux.ringingliberty.com/bitcoin/el7/x86_64/bitcoin-release-2-1.noarch.rpm
  • Install Tor, Bitcoin and Go language:
yum install tor bitcoin-server golang

(If you want to use Bitcoin XT instead of Bitcoin Core just use bitcoinxt-server package instead of bitcoin-server in the line above.)

  • Edit the Tor configuration file /etc/tor/torrc and uncomment the following lines (the first line opens the relay port, the second one disables the exit node):
ORPort 9001
ExitPolicy reject *:*

If you are more adventurous you might skip uncommenting the ExitPolicy reject line, but I recommend reading something about running an Exit Node first.

  • Edit the Bitcoin configuration file /etc/bitcoin/bitcoin.conf and change RPC password to something random:
rpcuser=bitcoinrpc
rpcpassword=something_random_like_8aRuH7Dxa0NBegBWLVNTndF_but_longer
  • Add the following files to your ~/.bashrc file and relogin:
export GOPATH=$HOME/.go
  • Install IPFS and make a symlink to /usr/bin:
go get -u github.com/ipfs/go-ipfs/cmd/ipfs
ln -s /root/.go/bin/ipfs /usr/bin/ipfs
  • Initialize IPFS node:
ipfs init
  • Create IPFS systemd service file /usr/lib/systemd/system/ipfs.service and put the following contents in it:
[Unit]
Description=IPFS daemon
After=network.target

[Service]
ExecStart=/usr/bin/ipfs daemon
Restart=on-failure

[Install]
WantedBy=multiuser.target
  • Run and enable start at boot for all three services using the following commands:
systemctl enable bitcoin
systemctl start bitcoin

systemctl enable tor
systemctl start tor

systemctl enable ipfs
systemctl start ipfs
  • Enjoy and big THANK YOU for your important contribution to these networks!

32C3 Highlights

These are my highlights from 32C3 (32nd Chaos Communication Congress):

The exhaust emissions scandal („Dieselgate“)

thumb

How the Great Firewall discovers hidden circumvention servers

thumb

Thunderstrike 2

thumb

PQCHacks

thumb

Rowhammer.js: Root privileges for web apps?

thumb

Let’s Encrypt – What launching a free CA looks like

thumb

Logjam: Diffie-Hellman, discrete logs, the NSA, and you

thumb

Tor onion services: more useful than you think

thumb

Computational Meta-Psychology

thumb

Say hi to your new boss: How algorithms might soon control our lives

thumb

Ten years after ‚We Lost The War‘ [32c3]

thumb

Sin in the time of Technology [32c3]

thumb

LÖVE (Love2D) on Android

Almost two years ago I blogged about my Global Game Jam entry called Hexoboros. This year’s approacing GGJ reminded me that I wanted to port this game to Android. Back then it turned out to be quite hard and results were not very satisfying.

I knew that SDL 2.0 was released in August 2013 bringing Android support out of the box. What I didn’t know was that LÖVE 0.9.0 was released in December as well, building on top of SDL2. I was pretty excited, because I felt that LÖVE on Android will became a real thing soon.

And I was right. Martin Felis is working on love-android-sdl2 repo, which combines all these efforts into one easy to build Android package.

After fixing some minor issues in Martin’s and mine code I ended up with this result:

hexoboros-android

Great! Now I’m convinced that I’ll be using LÖVE again during Global Game Jam this year.

Some notes:

  • love-android-sdl2 loads LÖVE resources from /sdcard/lovegame/ directory (this is useful for debugging)
  • if you zip your LÖVE resources to a file named game.love and add this file to assets directory of Android project, you end up with APK that bundles LÖVE with your game (this is great for deploying final game)
  • never force fixed resolution in your LÖVE code; rather update your code so it works with any given resolution and aspect ratio (i.e. don’t hardcode sizes and positions of rendered objects)
  • you can test you got that right by putting t.window.resizable = true in your conf.lua and using something like this in your main.lua code:
function love.resize(w, h)
  width, height = w, h
  scale = height / 1024
end

function love.load()
  love.resize(love.window.getWidth(), love.window.getHeight())
  ...