Advanced networking with QubesOS: VPN proxyVM

According to http://theinvisiblethings.blogspot.co.uk/2011/09/playing-with-qubes-networking-for-fun.html we can setup multiple ways for our AppVMs to reach the Internet.

AppVMs can:

  • have direct access to the Internet
  • be forced to go through a Tor proxy, tunnelling all their traffic through the Tor network
  • be forced to go through a VPN proxy, tunnelling all their traffic through the VPN.

The beauty of this setup is that once we have our proxyVMs setup, we don’t need to worry about the configuration of any network-level data leaks of the AppVMs that use the proxies.

Example: setting up a Tor proxyVM and then assigning this as the netvm of 5 different AppVMs will force all network traffic from all 5 AppVMs through the Tor network, with no configuration/awareness in the AppVMs themselves! This setup is covered quite well already in http://qubes-os.org/trac/wiki/UserDoc/TorVM

Creating the setup

How to setup a “workvpn” proxyVM that allows us to tunnel any “work” related AppVMs we have through work’s (in this case Cisco) VPN gateway as shown here:

QubesOS advanced network setup

  1. From Qubes Manager: VM -> Create AppVM
  2. Name: workvpn. Select the ProxyVM radio button and OK.
  3. In a couple of seconds your new VM is created. Go to the “K” menu and fire up a terminal in your new workvpn VM.
  4. Create the file vpn.conf with the following contents, substituting your VPN provider’s values:
    Xauth username xxxxxxxxxxxxxxxxxxx
    IPSec gateway xxxxxxxxxxxxx.xxxxxxx.xxx
    IPSec ID xxxxxxxxxxxxxxxxxx
    IPSec secret xxxxxxxxxxxxxxxxxxxx
  5. Create the file start_vpn.sh with the following contents:
    #!/bin/bash
    sudo /usr/sbin/vpnc /home/user/vpn.conf
    sleep 2
    sudo /usr/lib/qubes/qubes_setup_dnat_to_ns
  6. Create the file stop_vpn.sh with the following contents:
    #!/bin/bash
    sudo /usr/sbin/vpnc-disconnect
    sleep 2
    sudo /usr/lib/qubes/qubes_setup_dnat_to_ns
  7. Make both scripts executable:
    chmod +x *.sh
  8. Now tell your work-related AppVMs to use workvpn as their network VM. To do this, right-click on the AppVMs in Qubes VM Manager and select “VM Settings”. In the “Basic” tab ensure that “NetVM” is set to “workvpn”
  9. You’re all set.

Using this setup

When you fire up any of your AppVMs that need to use the VPN, workvpn will automatically start. You will then need to fire up a terminal in workvpn and type

./start_vpn.sh

(of course after the first time you can just hit the “up” arrow and the command will be there for you)
This will connect you to your work’s VPN and allow all AppVMs that use this as their netvm to seamlessly talk to internal work systems, while leaving the rest of your QubesOS AppVMs unaffected, reaching the Internet either directly or through Tor.

The Battle for Your Digital Soul

Silent Circle’s CEO takes a rather optimist view on the state of the cryptowars. If only we could reasonably assume that the all-star team of technologists he mentions are incorruptible by the full weight of the nexus of global government/corporate complex, we should see the sunny side of things too.
Yes, learning at least part of the truth due to Snowden is a reason to celebrate – we now know what is done in our name. But what we have learned is so sobering and matches our most dystopian projections so well, at the same time generating so little outrage around the world, that I still cannot be optimistic about a better future.

Silent Circle Blog

There have been so many disclosures, revelations and speculations since Snowden fled and the media trickled out one tantalizing slide after the next- that it’s hard not to get overwhelmed. It’s hard not to get angry.

Now that the sheer scope and massive worldwide surveillance of the NSA has come to light over the last few months, it seems as if a veritable cloud of “Privacy Depression” has set in lately among citizens and the technology community at large. Adding to that hot mess is the willing complicity of the tech giants, backbone providers and hardware manufactures. Fuel to the fire.

Yes, there are some feigning outrage, some with true concern, and others calling for heads-on-a-platter while western intelligence agencies and big technology firms hunker down and hope it all goes away. It won’t. It’s only going to get worse for them and the government.

Through the great work of…

View original post 1,022 more words

How to kill meaningful social change

Ok, so, say you’re a person the US government doesn’t like very much. Say you’re charismatic, and give great speeches, and you have ideas they don’t care for. I dunno, maybe that we shouldn’t be killing people without a trial. You know, one of those weird liberal ideas, that extrajudicial executions are bad. And you’ve got some real political momentum, to the point that you might actually cause dicomfort to the military-industrial complex.

 

So, in years prior, they’d have been kind of hampered in their ability to fight you. No more. Now, they can know every friend you have, and possibly every friend you’ve had since 2001. All your lovers, all your enemies, your social groups, your online groups, and so on.

 

If you’re male, did you ever stick your dick in crazy? Well, guess what, she’s now on CNN, talking about you. Did you ever get into an intemperate argument? Suddenly, that’s national news. If you haven’t been absolutely perfect in all respects, everyone is going to know all about it.

 

But, let’s say you have been perfect. That doesn’t matter. Somewhere in your friends network, and you will have a very large friends network if you have real political influence, there will be people that have been imperfect, maybe very badly imperfect.

 

Everyone that you’ve ever known that has, up until now, gotten away with stuff, is going to suddenly get a visit from the FBI, and they’re going to use their false-recording tactic, where the second agent writes that they said things they never said. Suddenly, they’re in deep shit. And the FBI has them by the balls. They can either go to jail, or they can say really horrible, awful things about you. Like you raped them, maybe. Rape is a really good one.

 

In a world with ubiquitous government surveillance, there cannot be meaningful social change, because the conservatives in the government will use their unlimited power to stifle and suppress all dissent. Leaders will not be able to develop, because they will be discredited as soon as they start to form. And major social change without central leadership is very rare.

 

If the US had had these powers in the 1960s, the Civil Rights movement would not have been successful, and everyone important in Martin Luther King’s terrorist network would be in prison, or perhaps in unmarked graves.

Shamelessly copied from malor’s comment on What the NSA can do with “big data”.

Using GnuPG with QubesOS

So Alice and Bob want to exchange private emails and files.

They realise that secure endpoint operating systems are an absolute requirement for any real privacy. What’s the point of protecting data in transit with PGP, when the spooks can remotely take over your machine and grab your stuff from the source? So they’ve taken the time to learn how to use Qubes OS – a security-by-separation operating system based on Xen and Fedora GNU/Linux.

Alice and Bob will use the non-networked “vault” AppVM to create and store their master cryptographic keys. They will then create a “daily use” keypair which will be available to their “personal” AppVM to send emails to each other.

Note: OpenPGP key management is complicated. To protect you from mistakes, this tutorial sets the expiry date of keys to one week after their creation. Once you are comfortable with this process you can always extend the life of your keys.

Create a new keypair

[user@vault ~]$ gpg --gen-key
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: directory `/home/alice/.gnupg' created
gpg: new configuration file `/home/alice/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/alice/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/alice/.gnupg/secring.gpg' created
gpg: keyring `/home/alice/.gnupg/pubring.gpg' created
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
<n>  = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 1w
Key expires at Thu Aug 22 18:38:49 2013 BST
Is this correct? (y/N) y

You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"

Real name: Alice
Email address: alice@domain.com
Comment:
You selected this USER-ID:
"Alice <alice@domain.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

Enter passphrase: <Alice's long passphrase>
Repeat passphrase: <Alice's long passphrase>
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 246 more bytes)
..............+++++
gpg: /home/alice/.gnupg/trustdb.gpg: trustdb created
gpg: key 32D49659 marked as ultimately trusted
public and secret key created and signed.

gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2013-08-22
pub   4096R/32D49659 2013-08-15 [expires: 2013-08-22]
Key fingerprint = 0346 5C7A 6412 A70B ED13  0196 9652 5380 32D4 9659
uid                  Alice <alice@domain.com>
sub   4096R/E19F81C0 2013-08-15 [expires: 2013-08-22]

[user@vault ~]$

Set strong cipher preferences

[user@vault ~]$ gpg --edit-key alice
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC
trust: ultimate      validity: ultimate
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E
[ultimate] (1). Alice <alice@domain.com>

gpg> setpref SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP
Set preference list to:
Cipher: AES256, AES192, AES, CAST5, 3DES
Digest: SHA512, SHA384, SHA256, SHA224, SHA1
Compression: ZLIB, BZIP2, ZIP, Uncompressed
Features: MDC, Keyserver no-modify
Really update the preferences? (y/N) y

You need a passphrase to unlock the secret key for
user: "Alice <alice@domain.com>"
4096-bit RSA key, ID 32D49659, created 2013-08-15

Enter passphrase: <Alice's long passphrase>
pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC
trust: ultimate      validity: ultimate
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E
[ultimate] (1). Alice <alice@domain.com>

gpg> save
[user@vault ~]$

Add a signing subkey

[user@vault ~]$ gpg --edit-key alice
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC
trust: ultimate      validity: ultimate
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E
[ultimate] (1). Alice <alice@domain.com>

gpg> addkey
Key is protected.

You need a passphrase to unlock the secret key for
user: "Alice <alice@domain.com>"
4096-bit RSA key, ID 32D49659, created 2013-08-15

Enter passphrase: <Alice's long passphrase>
Please select what kind of key you want:
(3) DSA (sign only)
(4) RSA (sign only)
(5) Elgamal (encrypt only)
(6) RSA (encrypt only)
Your selection? 4
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
<n>  = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 1w
Key expires at Thu Aug 22 18:53:32 2013 BST
Is this correct? (y/N) y
Really create? (y/N) y
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

Not enough random bytes available.  Please do some other work to give
the OS a chance to collect more entropy! (Need 269 more bytes)
.+++++
...........................+++++

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC
trust: ultimate      validity: ultimate
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E
sub  4096R/29E78F35  created: 2013-08-15  expires: 2013-08-22  usage: S
[ultimate] (1). Alice <alice@domain.com>

gpg> save
[user@vault ~]$

Generate a revocation certificate

A general-purpose revocation certificate that specifies no reason why you are revoking your keys:

[user@vault ~]$ gpg --output revocation.cert --gen-revoke alice

sec  4096R/32D49659 2013-08-15 Alice <alice@domain.com>

Create a revocation certificate for this key? (y/N) y
Please select the reason for the revocation:
0 = No reason specified
1 = Key has been compromised
2 = Key is superseded
3 = Key is no longer used
Q = Cancel
(Probably you want to select 1 here)
Your decision? 0
Enter an optional description; end it with an empty line:
>
Reason for revocation: No reason specified
(No description given)
Is this okay? (y/N) y

You need a passphrase to unlock the secret key for
user: "Alice <alice@domain.com>"
4096-bit RSA key, ID 32D49659, created 2013-08-15

Enter passphrase: <Alice's long passphrase>
ASCII armored output forced.
Revocation certificate created.

Please move it to a medium which you can hide away; if Mallory gets
access to this certificate he can use it to make your key unusable.
It is smart to print this certificate and store it away, just in case
your media become unreadable.  But have some caution:  The print system of
your machine might store the data and make it available to others!
[user@vault ~]$

Backup your precious master keys and revocation certificate

Create a backup of Alice’s private key:

[user@vault ~]$ gpg --export-secret-keys --armor alice > alice_gpg_private.key

Create a backup of Alice’s public key:

[user@vault ~]$ gpg --export --armor alice > alice_gpg_public.key

Keep these files safe!

[user@vault ~]$ tar -cf gpg_master_keys.tar alice_gpg*.key revocation.cert

The file gpg_master_keys.tar contains everything one needs to fully impersonate Alice or invalidate her keys, except for her passphrase.

Shred the files we backed up – now everything is in the tar file:

[user@vault ~]$ shred -u alice_gpg*.key revocation.cert

Create a daily-use keyring

This keyring will *not* include your master signing key. It will be a restricted, lesser keyring, which you can expose to untrusted environments (like your smartphone, or your networked AppVMs).

Export all subkeys to a temporary file:

[user@vault ~]$ gpg --export-secret-subkeys alice@domain.com > subkeys

Delete your master signing key from your keyring:

[user@vault ~]$ gpg --delete-secret-key alice@domain.com
 gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
sec 4096R/32D49659 2013-08-15 Alice <alice@domain.com>
Delete this key from the keyring? (y/N) y
 This is a secret key! - really delete? (y/N) y
 [user@vault ~]$

Re-import the subkeys we exported earlier.

[user@vault ~]$ gpg --import subkeys
 gpg: key 32D49659: secret key imported
 gpg: key 32D49659: "Alice <alice@domain.com>" 1 new signature
 gpg: Total number processed: 1
 gpg: new signatures: 1
 gpg: secret keys read: 1
 gpg: secret keys imported: 1
 [user@vault ~]$

Get rid of the temporary file:

[user@vault ~]$ shred -u subkeys

Verify that the master signing key is missing:

[user@vault ~]$ gpg -K
 /home/alice/.gnupg/secring.gpg
 -----------------------------
 sec# 4096R/32D49659 2013-08-15 [expires: 2013-08-22]
 uid Alice <alice@domain.com>
 ssb 4096R/E19F81C0 2013-08-15
 ssb 4096R/29E78F35 2013-08-15
[user@vault ~]$

See that “#”? That means that the master signing key is not there. Congratulations – this is your daily-use, lower-risk keyring! It only contains Alice’s encryption and signing subkeys, but no master (certification) signing key.

Move the daily-use keyring to Alice’s “personal” AppVM

Alice runs her email client and exchanges email with Bob using her “personal” AppVM. She therefore needs to have her daily-use keyring there.

Export Alice’s “lesser” private key:

[user@vault ~]$ gpg --export-secret-keys --armor alice > alice_gpg_private_lesser.key

Export Alice’s “lesser” public key:

[user@vault ~]$ gpg --export --armor alice > alice_gpg_public_lesser.key

Copy these out of the vault and into Alice’s networked “personal” AppVM:

[user@vault ~]$ qvm-copy-to-vm personal alice_gpg_p*_lesser.key
sent 14/15 KB
[user@vault ~]$

You will be prompted by Qubes if you want to allow this transfer. Click “Yes” to allow your “vault” AppVM to write to your “personal” AppVM.

Install Alice’s daily-use keyring in the “personal” AppVM

First, Alice needs to import the keys into her keyring:

[user@personal ~]$ cd QubesIncoming/vault/
[user@personal vault]$ gpg --import alice_gpg_p*_lesser.key
gpg: directory `/home/user/.gnupg' created
gpg: new configuration file `/home/user/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/user/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/user/.gnupg/secring.gpg' created
gpg: keyring `/home/user/.gnupg/pubring.gpg' created
gpg: key 46205B22: secret key imported
gpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key 46205B22: public key "Alice <alice@domain.com>" imported
gpg: key 46205B22: "Alice <alice@domain.com>" 1 new signature
gpg: Total number processed: 2
gpg:               imported: 1  (RSA: 1)
gpg:         new signatures: 1
gpg:       secret keys read: 1
gpg:   secret keys imported: 1
[user@personal vault]$

Verify that the keys are there, but not the master certification key:

[user@personal vault]$ gpg -K
/home/user/.gnupg/secring.gpg
-----------------------------
sec#  4096R/46205B22 2013-10-04 [expires: 2013-10-11]
uid                  Alice <alice@domain.com>
ssb   4096R/DB739DBC 2013-10-04
ssb   4096R/E58DA355 2013-10-04
[user@personal vault]$

Good. That “#” means the certification key is not there.

Alice can now get rid of the exported key files:

[user@personal vault]$ shred -u alice_gpg_p*_lesser.key

At this point, Alice’s setup is done.

Here is what Alice has achieved:

  1. Alice has generated new OpenPGP keys in a secure environment (the vault)
  2. Alice created a “lesser” version of her keyring that excludes the all-important certification key. This “lesser” version will be used for daily use to communicate with Bob and anyone else using OpenPGP. If this “lesser” version of her keys is stolen (e.g. because the attacker compromises Alice’s “personal” AppVM), the attacker will not be able to create more keys in Alice’s name, or assign Alice’s trust to other keys. Alice only has to revoke her key and the attacker is left with nothing.
  3. Alice created a backup of her full certification keyring in a secure environment, the vault.

Publishing your public key on a keyserver for others to find

She should publish her key on the keyservers so that her friend Bob can easily find it: (note that the key to be sent must be selected with its key ID:

[user@personal ~]$ gpg --list-keys
/home/user/.gnupg/pubring.gpg
-----------------------------
pub   4096R/32D49659 2013-08-15 [expires: 2013-08-22]
uid                  Alice <alice@domain.com>
sub   4096R/E19F81C0 2013-08-15 [expires: 2013-08-22]
sub   4096R/29E78F35 2013-08-15 [expires: 2013-08-22]

[user@personal ~]$

So, let’s send key ID 32D49659 to the keyservers:

[user@personal ~]$ gpg --keyserver sks.keyservers.net --send-keys 32D49659
 gpg: sending key 32D49659 to hkp server sks.keyservers.net
 [user@personal ~]$

By knowing her public key’s fingerprint…

[user@personal ~]$ gpg --fingerprint alice@domain.com
 pub 4096R/32D49659 2013-08-15 [expires: 2013-08-22]
 Key fingerprint = 0346 5C7A 6412 A70B ED13 0196 9652 5380 32D4 9659
 uid Alice <alice@domain.com>
 sub 4096R/E19F81C0 2013-08-15 [expires: 2013-08-22]
 sub 4096R/29E78F35 2013-08-15 [expires: 2013-08-22]
[user@personal ~]$

…Alice can verify her key has been successfully published. All she needs to do is visit http://sks.keyservers.net/ and search for her email or name, then verify that the fingerprint shown matches the one of her local key.

In the meantime, Bob has been busy doing these exact same steps on his computer, for his name and email address. His key, tied to his email address bob@domain.com has also been published to the keyservers. He has also taken a proactive security precaution and only exposed a “lesser” version of his keyring to his networked AppVMs, with his certification key safely stored in the vault.

Communicating

Alice and Bob want to send private emails to each others. Emails about apple pie and silly gossip and deep meaningful conversations. It doesn’t matter. They just want to keep their conversations private. If they’ve both followed the steps above, this is what they need to do to email each other in private.

Importing Bob’s key

Alice needs to import Bob’s (public) key from the keyservers. She asks the keyserver to find Bob’s key:

[user@personal ~]$ gpg --keyserver sks.keyservers.net --search-keys bob@domain.com
gpg: searching for "bob@domain.com" from hkp server sks.keyservers.net
(1)	Robert <bob@domain.com>
	  4096 bit RSA key F19F159D, created: 2013-08-15, expires: 2013-08-22
(2)	Waldemar Retzlaff (Schlüssel zur domain.) <bob@eu-wedding.com>
	  1024 bit DSA key 96268EF6, created: 2003-12-16
Keys 1-2 of 2 for "bob@domain.com".  Enter number(s), N)ext, or Q)uit > 1
gpg: requesting key F19F159D from hkp server sks.keyservers.net
gpg: key F19F159D: public key "Robert <bob@domain.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
[user@personal ~]$

Whoops – found multiple keys – but once she selected Bob’s key, it was automatically imported into Alice’s keyring.

Verifying Bob’s key

Alice can already use this key to send Bob private email messages or files, but she wants to be really really certain that is Bob’s key, and not some impostor’s! Alice either meets or calls Bob on the phone and asks him to read out to her his key’s fingerprint. She verifies it matches the fingerprint of the key she imported from the keyservers:

[user@personal ~]$ gpg --fingerprint bob@domain.com
pub   4096R/F19F159D 2013-08-15 [expires: 2013-08-22]
      Key fingerprint = FF24 73AF 8658 5280 85A4  C2BD 4440 516C F19F 159D
uid                  Robert <bob@domain.com>
sub   4096R/E12896F5 2013-08-15 [expires: 2013-08-22]
sub   4096R/734A2C3B 2013-08-15 [expires: 2013-08-22]

[user@personal ~]$

While they’re on the phone, Bob quickly imports Alice’s key from the keyserver and asks her to confirm her key’s fingerprint as well. Alice reads out her key’s fingerprint:

[user@personal ~]$ gpg --fingerprint alice@domain.com
pub   4096R/32D49659 2013-08-15 [expires: 2013-08-22]
      Key fingerprint = 0346 5C7A 6412 A70B ED13  0196 9652 5380 32D4 9659
uid                  Alice <alice@domain.com>
sub   4096R/E19F81C0 2013-08-15 [expires: 2013-08-22]
sub   4096R/29E78F35 2013-08-15 [expires: 2013-08-22]

[user@personal ~]$

Fingerprints of public keys are public information. So Alice and Bob don’t need to worry about other people listening in. Their fingerprints are not secret.

Great! So far Alice and Bob have generated and successfully exchanged keys. Now all they need to do is use an application like Thunderbird with the Enigmail plugin (on Windows/Mac/Linux) or K9 with the APG app (on Android) to exchange encrypted and signed emails and files, being pretty certain that nobody can read or alter the contents of their messages.

When disaster strikes

Oh no! Alice’s smartphone has been stolen! Or one of her AppVMs might have opened an infected PDF, or ran some suspicious Java applet that might have installed a trojan on her personal AppVM. Nothing in that AppVM can be trusted any longer. This includes the GnuPG keys she was using on a daily basis.

Luckily Alice is prepared.

Revoking compromised keys

Alice needs to use her safe environment (the vault) to revoke the compromised subkeys (she only exposed subkeys to her networked AppVMs and devices, remember?) and optionally issue new ones.

The beauty of this is that she does not have to throw away the whole key. Alice can carry on using the same master key, which may, over the years, have accumulated a lot of trust from other Web Of Trust members. She just needs to revoke the compromised subkeys and issue new ones.

Working with our master key

Alice fires up her vault and imports the master keyring she had backed up when she created her keys:

[user@vault ~]$ tar xvf gpg_master_keys.tar
alice_gpg_private.key
alice_gpg_public.key
revocation.cert
[user@vault ~]$ 

Here are the files Alice backed up. Let’s import them to start using them – but first temporarily move .gnupg out of the way to ensure we’re not upsetting any preexisting configuration in the vault:

[user@vault ~]$ mv .gnupg .gnupg-ORIG
[user@vault ~]$ gpg --import alice_gpg_p*.key
gpg: directory `/home/user/.gnupg' created
gpg: new configuration file `/home/user/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/user/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/user/.gnupg/secring.gpg' created
gpg: keyring `/home/user/.gnupg/pubring.gpg' created
gpg: key 32D49659: secret key imported
gpg: /home/user/.gnupg/trustdb.gpg: trustdb created
gpg: key 32D49659: public key "Alice <alice@domain.com>" imported
gpg: key 32D49659: "Alice <alice@domain.com>" 1 new signature
gpg: Total number processed: 2
gpg:               imported: 1  (RSA: 1)
gpg:         new signatures: 1
gpg:       secret keys read: 1
gpg:   secret keys imported: 1
[user@vault ~]$

Verify what we imported:

[user@vault ~]$ gpg --edit-key alice
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: unknown       validity: unknown
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E   
sub  4096R/29E78F35  created: 2013-08-15  expires: 2013-08-22  usage: S   
[ unknown] (1). Alice <alice@domain.com>

gpg>

Yup, there they are.

  • The all-important master key with usage: SC (for “sign & certify”, which means to sign other keys)
  • One subkey with usage: E – for “encrypt”
  • One subkey with usage: S – for “sign”

Revoking compromised subkeys

gpg> list

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: unknown       validity: unknown
sub  4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E   
sub  4096R/29E78F35  created: 2013-08-15  expires: 2013-08-22  usage: S   
[ unknown] (1). Alice <alice@domain.com>

gpg> key 1

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: unknown       validity: unknown
sub* 4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E   
sub  4096R/29E78F35  created: 2013-08-15  expires: 2013-08-22  usage: S   
[ unknown] (1). Alice <alice@domain.com>

gpg> key 2

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: unknown       validity: unknown
sub* 4096R/E19F81C0  created: 2013-08-15  expires: 2013-08-22  usage: E   
sub* 4096R/29E78F35  created: 2013-08-15  expires: 2013-08-22  usage: S   
[ unknown] (1). Alice <alice@domain.com>

gpg> revkey
Do you really want to revoke the selected subkeys? (y/N) y
Please select the reason for the revocation:
  0 = No reason specified
  1 = Key has been compromised
  2 = Key is superseded
  3 = Key is no longer used
  Q = Cancel
Your decision? 1
Enter an optional description; end it with an empty line:
> 
Reason for revocation: Key has been compromised
(No description given)
Is this okay? (y/N) y

You need a passphrase to unlock the secret key for
user: "Alice <alice@domain.com>"
4096-bit RSA key, ID 32D49659, created 2013-08-15

You need a passphrase to unlock the secret key for
user: "Alice <alice@domain.com>"
4096-bit RSA key, ID 32D49659, created 2013-08-15

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: unknown       validity: unknown
This key was revoked on 2013-08-16 by RSA key 32D49659 Alice <alice@domain.com>
sub  4096R/E19F81C0  created: 2013-08-15  revoked: 2013-08-16  usage: E   
This key was revoked on 2013-08-16 by RSA key 32D49659 Alice <alice@domain.com>
sub  4096R/29E78F35  created: 2013-08-15  revoked: 2013-08-16  usage: S   
[ unknown] (1). Alice <alice@domain.com>

gpg> save
[user@vault ~]$

As you can see the all-important certification key has the power to revoke subkeys. Good thing Alice kept it safe in her offline vault all this time!

Export the revoked keys in a ASCII file

[user@vault ~]$ gpg --export -a > revoked_keys.asc

Move the revoked keys in your networked AppVM

[user@vault ~]$ qvm-copy-to-vm personal revoked_keys.asc 
sent 7/8 KB
[user@vault ~]$

From your networked AppVM now, tell the world you have revoked the subkeys

[user@personal ~]$ gpg --import QubesIncoming/vault/revoked_keys.asc 
gpg: key 32D49659: "Alice <alice@domain.com>" 2 new signatures
gpg: Total number processed: 1
gpg:         new signatures: 2

[user@personal ~]$ gpg --edit-key alice
gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Secret key is available.

pub  4096R/32D49659  created: 2013-08-15  expires: 2013-08-22  usage: SC  
                     trust: ultimate      validity: ultimate
This key was revoked on 2013-08-16 by RSA key 32D49659 Alice <alice@domain.com>
sub  4096R/E19F81C0  created: 2013-08-15  revoked: 2013-08-16  usage: E   
This key was revoked on 2013-08-16 by RSA key 32D49659 Alice <alice@domain.com>
sub  4096R/29E78F35  created: 2013-08-15  revoked: 2013-08-16  usage: S   
[ultimate] (1). Alice <alice@domain.com>

gpg> quit

[user@personal ~]$ gpg --keyserver sks.keyservers.net --send-keys E19F81C0
gpg: sending key 32D49659 to hkp server sks.keyservers.net
[user@personal ~]$ gpg --keyserver sks.keyservers.net --send-keys 29E78F35
gpg: sending key 32D49659 to hkp server sks.keyservers.net
[user@personal ~]$ rm QubesIncoming/vault/revoked_keys.asc
[user@personal ~]

That’s it!

You have now revoked the two compromised subkeys and may create new subkeys with your untainted master key that was kept safe in your vault all along. Whoever managed to compromise your keys may be able to read everything encrypted with those keys (if they kept copies of the ciphertext).

Notes

Restricted keys (missing the master signing key, as we created above) can not currently be used by APG on Android. Use Mike Cardwell’s version of APG that works with such keys: download the apk from here.

Bill Binney on the NSA’s domestic surveillance “Stellar Wind” program

Preview of the documentary film “The Program” by Laura Poitras, as covered in the New York Times:

http://archive.org/details/TheNsaDomesticSpyingProgram

If you want a quick under-10-minute summary of what the big deal with the NSA, GCHQ etc hoovering up all of your data, this is a good one to watch. Remember, they are not only hoovering up Americans’ data – they are hoovering up any data they can get their hands on. This means that if you use any of the big American technology services (Google mail, Google search, Youtube, Microsoft Hotmail, Skype, Yahoo! Mail, Dropbox, Apple services, Amazon etc), your data is being collected.

A few good men

Here’s a few people who had both the guts and the skill to improve our world.

Stallman, Assange, Snowden

The guy on the left is Richard Stallman, founder of the Free Software Foundation, intellectual leader of the Free Software movement, who has tirelessly, often in the face of mockery, preached his gospel: Software is knowledge, and knowledge should be free for all.

Here he’s grinning alongside Julian Assange, Wikileaker extraordinaire, persecuted by the world’s most powerful governments, for months now unable to leave the Ecuadorian embassy in London. Assange had the balls to give us knowledge and to not stand down when the powers that be threatened him and came after him.

They are holding a picture of Edward Snowden, the latest NSA whistleblower who had the balls to throw away his comfortable, high-earning, high-status life to give us all some of the raw truth about how our governments operate. About how we have allowed our societies to resemble George Orwell’s 1984 to a worrying degree. He’s also prosecuted by the most powerful governments of this world.

Here’s a well-written biography of Edward Snowden, which captures the issues the world is facing after his brave disclosures succinctly. Highly recommended reading.

Edward Snowden (person) on Everything2

Secrets: A memoir of Vietnam and the Pentagon Papers – by Daniel Ellsberg

Some powerful excerpts from Daniel Ellberg’s book on Vietnam and the leaking of the McNamara study on US decision making in Vietnam that came to be known as The Pentagon Papers (freely available online by the US National Archive)
secrets_cover

Note: Page numbers are from the Penguin edition ISBN 978-0-14-200342-8

p.41: Proof that the US have been capable of global-range drone missions at least as early as the early 1960s:

One morning just before eight o’clock John (ed: McNaughton) came back from McNamara’s office minutes after he’d gotten a call and dashed out. He said to me, “A Blue Springs drone has gone down in China. Bob is seeing the press at eight-thirty. We have ten minutes to write six alternative lies for him.”

It was the only time I remember the actual word “lies” being used. Blue Springs was the code name for an espionage program for reconnaissance photographic flights by unmanned drone planes.

p.213: On the responsibility of people who do not actively oppose wrongdoing:

Nearly all evildoing, she pointed out, like nearly all coercive power, legitimate and illegitimate, depends on the cooperation, on the obedience and support, on the assent or at least passive tolerance of many people. It relies on many more collaborators than are conscious of their roles; these include even many victims, along with passive bystanders, as in effect accomplices.

p.237: Ellsberg’s advice to Henry Kissinger on the psychological and behavioural effects of secret clearances on people:

“Henry, there’s something I would like to tell you, for what it’s worth, something I wish I had been told years ago. You’ve been a consultant for a long time, and you’ve dealt a great deal with top secret information. But you’re about to receive a whole slew of special clearances, maybe fifteen or twenty of them, that are higher than top secret.

“I’ve had a number of these myself, and I’ve known other people who have just acquired them, and I have a pretty good sense of what the effects of receiving these clearances are on a person who didn’t previously know they even existed. (ed: emphasis in original) And the effects of reading the information that they will make available to you.

“First, you’ll be exhilarated by some of this new information, and by having it all – so much! incredible! – suddenly available to you. But second, almost as fast, you will feel like a fool for having studied, written, talked about these subjects, criticized and analyzed decisions made by presidents for years without having known of the existence of all this information, which presidents and others had and you didn’t, and which must have influenced their decisions in ways you couldn’t even guess. In particular, you’ll feel foolish for having literally rubbed shoulders for over a decade with some officials and consultants who did have access to all this information you didn’t know about and didn’t know they had, and you’ll be stunned that they kept that secret from you so well.

“You will feel like a fool, and that will last for about two weeks. Then, after you’ve started reading all this daily intelligence input and become used to using what amounts to whole libraries of hidden information, which is much more closely held than mere top secret data, you will forget there ever was a time when you didn’t have it, and you’ll be aware only of the fact that you have it now and most others don’t… and that all those other (ed: emphasis in original) people are fools.

“Over a longer period of time – not too long, but a matter of two or three years – you’ll eventually become aware of the limitations of this information. There is a great deal that it doesn’t tell you, it’s often inaccurate, and it can lead you astray just as much as the New York Times can. But that takes a while to learn.

“In the meantime it will have become very hard for you to learn (ed: emphasis in original) from anybody who doesn’t have these clearances. Because you’ll be thinking as you listen to them: ‘What could this man be telling me if he knew what I know? Would he be giving me the same advice, or would it totally change his predictions and recommendations?’ And that (ed: emphasis in original) mental exercise is so torturous that after a while you give it up and just stop listening. I’ve seen this with my superiors, my colleagues… and with myself.

“You will deal with a person who doesn’t have those clearances only from the point of view of what you want him to believe and what impression you want him to go away with, since you’ll have to lie carefully to him about what you know. In effect, you will have to manipulate him. You’ll give up trying to assess what he has to say. The danger is, you” become something like a moron. You’ll become incapable of learning from most people in the world, no matter how much experience they may have in their particular areas that may be much greater than yours.”

p.254: On the arrogance of power plaguing the US administration:

There was some realistic basis for the belief that many Vietnamese were naive and misled in their notions of what a Communist-led victory would do for them. But as I now realized, we American officials were no less ignorant or self-deceptive, in turn, about the nature of French rule or of the various Saigon regimes we supported or imposed later or the incentives that would lead people to take up and persist in armed struggle against greatly superior forces – and above all, about the burden of the war on the rural population. In any case, to presume to judge what was best for them, with life and death at stake, was the height of imperial arrogance, the “arrogance of power,” as Senator Fullbright later called it.

p.269 On the difficulty of stepping out of line and doing something you believe in for the first time:

Something very important had happened to me. I felt liberated. I doubt if I could have explained that at the time. But by now I have seen this exhilaration often enough in others, in particular people who have just gone through their first action of civil disobedience, whether or not they have been taken to jail. This simple vigil, my first public action, had freed me from a nearly universal fear whose inhibiting force, I think, is very widely underestimated. I had become free of the fear of appearing absurd, of looking foolish, for stepping out of line.

p.289 On how the Thai Khac Chuyen murder case blew the lid off Ellsberg’s passive tolerance of official lies and helped him decide to do something about it:

I lay in bed that Tuesday morning and thought: This is the system that I have been working for, the system I have been part of, for a dozen years – fifteen, including the Marine Corps. It’s a system that lies automatically, at every level from bottom to top – from sergeant to commander in chief – to conceal murder.

That described, as I had come to realize from my reading that month, what that system had been doing in Vietnam, on an infinitely larger scale, continuously for a third of a century. And it was still going on. I thought: I’m not going to be a part of it anymore. I’m not going to be part of this lying machine, this cover-up, this murder, anymore.

It occurred to me that what I had in my safe at Rand was seven thousand pages of documentary evidence of lying, by four presidents and their administrations over twenty-three years, to conceal plans and actions of mass murder. I decided I would stop concealing that myself. I would get it out somehow.

p. 394 On the surveillance capabilities of the FBI in the 1970s. We can only imagine how much this has changed, in the favour of the government, in our current era of pervasive wholesale surveillance:

The main secret to avoid being found by the FBI (in the 1970s) seemed to be: Don’t use your home or office phone.

[…]

On one occasion, “Mr Boston” went downstairs and across the street to a phone booth on the corner, about fifty yards from the apartment building where were staying that afternoon. He talked for about ten minutes to my friends Lloyd Shearer in Los Angeles, relaying some questions I had for Shearer, who was giving me advice on whom to deal with in the media. We happened to be looking out the front window when he left the booth and came back. Just as he entered the front door, perhaps twelve minutes from the time he placed the call, four police cars converged on the phone booth from two directions. Brakes screeched, and police jumped our with guns drawn, though the booth was now empty. Evidently Shearer’s line was tapped.

p.413 A glimpse into the administration’s psyche and why leaking hard evidence hurts their license to do whatever they want. It’s not so much the content of the leaks – but bringing to light the fact that the administration will sometimes be wrong. That’s why accountability, checks and balances at all levels are important:

H. R. Haldeman to President Nixon, Oval Office tapes, June 14, 1971, on the impact of the Pentagon Papers:
To the ordinary guy, all this is a bunch of gobbledygook. But out of the gobbledygook comes a very clear thing: you can’t trust the government; you can’t believe what they say; and you can’t rely on their judgement. And the implicit infallibility of presidents, which has been an accepted thing in America, is badly hurt by this, because it shows that people do things the president wants to do even though it’s wrong, and the president can be wrong.

p.418 People who have lost touch with reality casually discussing mass murder from their ivory tower – the Oval Office:

Two hours later, at noon, H. R. Haldeman and Ron Ziegler joined Kissinger and Nixon:
President: How many did we kill in Laos?
Ziegler: Maybe ten thousand – fifteen?
Kissinger: In the Laotian thing, we killed about ten, fifteen…
President: See, the attack in the North that we have in mind… power plants, whatever’s left – POL [petroleum], the docks… And, I still think we ought to take the dikes out now. Will that drown people?
Kissinger: About two hundred thousand people.
President: No, no, no… I’d rather use the nuclear bomb. Have you got that, Henry?
Kissinger: That, I think, would just be too much.
President: The nuclear bomb, does that bother you? … I just want you to think big, Henry, for Christsakes.

p.426 The (disgusting) light side of mass murder:

[…] the president was particularly concerned that the bombing of Cambodia in early 1969 and later (code-named Menu, for a series of raids initially code-named Breakfast, Lunch and Dinner) might be about to be revealed.

p.428 How the system of secrecy was used to mislead Congress and to hide entire bombing campaigns:

Moreover, Congress, which had to appropriate the money for these operations, had been given false top secret documentation on what country they were paying to bomb. Hundreds of military staffers in MACV and CINCPAC headquarters were kept busy faking classified flight plans and after-action reports of the bombing raids, falsifying the coordinates of the actual targets to indicate they were in South Vietnam rather than in Cambodia. When in 1970 Nixon ordered secret bombing of the Plain of Jars in Laos (which had no relation to infiltration routes), he used the same system of dual bookkeeping he had used to conceal the bombing of Cambodia.

[…]

A modern president’s practical ability to drop secretly several hundred thousand tons of bombs in a country with which we were not at war was a considerable tribute to the effectiveness of the postwar secrecy system. It gives our presidents a capability to initiate and escalate a war in secret that was scarcely possessed by monarchs of the past.

p. 431 James Madison‘s words on the importance of an informed public:

A popular government, without popular information or the means of acquiring it, is but a prologue to a farce or a tragedy; or, perhaps, both. Knowledge will forever govern ignorance: And a people who mean to be their own governors, must arm themselves with the power knowledge gives.

p.457 Powerful closing remarks of an excellent book:

As Judge Byrne in Los Angeles was issuing his dismissal of our indictment, which had been anticipated all morning in the Oval Office discussions, the president addressed the situation in anguish and perplexity:

For example, on this national security thing, we have the rocky situation where the sonofabitching thief is made a national hero and is going to get off on a mistrial. And the New York Times gets a Pulitzer Prize for stealing documents… They’re trying to get at us with thieves. What in the name of God have we come to?

What we had come back to was a democratic republic – not an elected monarchy – a government under law, with Congress, the courts, and the press functioning to curtail executive abuses, as our Constitution envisioned.

What can I do about PRISM?

Now that the most powerful nation states of the world have been caught performing wholesale surveillance on us, their citizens, and have responded with a “so what?”, the question arises… what are we, the citizens caught in a surveillance society to do?

It seems to me there are five broad strategies:

1. Retreat

Leave the big cities. Stop using credit cards and mobile phones. Live off the land. Read only paper books. Send snail mail. Use cash. Deny your children education in and enjoyment of modern technology.

2. Ignore

Carry on your life as if PRISM did not exist. Suppress the inconvenient knowledge that you have acquired. Hope it’ll all be okay, since you will always toe the line of whatever establishment you happen to operate under. Leave your children uninformed about what’s going on, or just tell them “that’s normal, that’s how it’s always been”. Carry on using Facebook, surf the web while being logged into Yahoo!, Google or Hotmail, carry on syncing all your Apple iThings content to “the cloud”. Chat with your loved ones over Skype/Google Talk/FaceTime/WhatsApp/MSN/Facebook and all the other “freebie” services that are surveillance chambers. Have photos of your kids online.

3. Hide (with technical means)

Use Tor for surfing the web, PGP to encrypt your email, ZRTP to encrypt your voice/video calls, OTR to encrypt your chats, learn how to manage your keys securely, use secure operating systems like Qubes OS. This approach is inconvenient, difficult to do properly even for experts, network effects penalise you because others will not communicate with you in compatible (private) ways and therefore it will be difficult to communicate with them. Loathing by others because you’re visibly putting barriers between them and you. A losing battle, but buys you and (if you manage to convert them to your cause and if they are capable of following) your loved ones some privacy and decency, even though what you are practically doing is hiding.

4. Fight (within the system)

Become a member and donate as much as you can to organisations like the Electronic Frontier Foundation (EFF, US-focused), the Open Rights Group (UK-based), EDRI (Europe-focused) etc. Write to your politicians. Write to newspapers. Publish articles on your blog. Talk to your friends to raise awareness. Join demonstrations. Vote accordingly whenever you’re given the chance.

5. Fight (with all you’ve got – also known as civil disobedience)

“Cast your whole vote, not a strip of paper merely, but your whole influence.” Subvert the system in any (non-violent) way possible. Stop obeying the rules of a system that is immoral. Become as vocal as possible and follow your words with actions. No matter what the consequences to you personally, it’s worth it if we all fight together. Remember that “A minority is powerless while it conforms to the majority; it is not even a minority then; but it is irresistible when it clogs by its whole weight.”

Most people will want to do a combination of different elements of the above – although a clear strategy that balances pain to you with protection for your family is difficult to describe.

Disable Java in your browsers now

Java is a computer language for getting things done. If you have Java installed on your computer, you have enabled your computer to “talk” this language, which is a good thing.

Problem is, nowadays Java is used primarily to remotely take control of your computer by criminals and use your resources and information to make money. This is a bad thing.

Therefore, I will echo the advice of most computer security experts and suggest that you disable Java for your browsers (Firefox, Internet Explorer, Chrome etc) now.

Windows users are the ones most at risk – there are known exploit kits out there that actively exploit Java to take control of your computer. First, check if you have Java installed on your computer – is there a “Java” icon in Windows’ Control Panel? If not, you have nothing to worry about as you don’t have Java on your computer.

If, as most people, you do have Java installed, don’t worry, it’s easy to secure it: Two steps:

  1. Update your installation of Java to the latest version released by Oracle here: http://java.com/en/download/manual.jsp – After downloading and installing it, you will have the latest and more secure Java for your computer to use.
  2. Disable the use of Java in your browsers, by going to Control Panel, then “Java”, and then in the “Security” tab un-ticking the box before “Enable Java content in the browser“.Disabling Java for browsers

That’s all you need to do.

Note: GNU/Linux and Mac users, you are not out of danger – the same vulnerability can be used to exploit your systems too, so it’s recommended that you disable Java in your browsers as well. See my advice from 2011 about “How much Java do you need?” and Brian Krebs’ recent FAQ for more.

Hiyashi's Blog

Too often the discourse around media convergence is about utilising cutting-edge, networked computing technologies to deliver, produce and consume media content. We are constantly being reminded that we will be prosuming media on connected multiple platforms, sharing and remixing content and information, interacting with authors and celebrities on the social web, being recommended / directed / given access to quality media content that meets our tastes and preferences. These seemingly rosy pictures, however, are accompanied by some socio-technical, legal and ethical challenges. A technology-determined view sometimes over-celebrates what technologies can do and ignores other crucial elements that make media convergence possible (or difficult).

My STS background constantly guides me to think critically when approaching the phenomenon of media convergence. Despite my continuing effort of engaging with technologies actively myself, I would also like to bring that critical thinking into the teaching, and indeed everyday practice of ‘media convergence’.

I was…

View original post 731 more words