Tuesday, March 31, 2015

GnuPG notes

Some notes for GnuPG

# usually we can replace <key ID> with <user ID>
# keygen
gpg --full-gen-key (choose DSA & Elgamal here)

# editing
gpg --edit-key <key ID>

# key listing
gpg -k [ <user ID> or <key ID> ]
gpg -K [ <user ID> or <key ID> ]

-k: --list-public-keys / --list-keys
-k: --list-secret-keys

# fingerprint
gpg --fingerprint [ <key ID> ]

# import and export (backup & restore)
gpg --import filename

gpg --export <key id>
gpg --export-secret-keys <key id>

# --armor (-a): ASCII text format
gpg -a --export <key id>
gpg -a --export-secret-subkeys <key id>

gpg --enarmor filename.gpg
gpg --dearmor filename.asc

# keyserver
gpg --keyserver pgp.mit.edu --send-keys <key ID>
gpg --keyserver pgp.mit.edu --recv-keys <key ID>
gpg --keyserver pgp.mit.edu --search-key <key ID>

# encryption and decryption
gpg -e filename
gpg -r <key ID> -e filename
gpg -o filename -d filename.gpg

-e: --encrypt
-d: --decrypt
-o: --output
-r: --recipient

# signature
(in place signature)
gpg --sign filename
gpg --clearsign filename
gpg --verify filename.gpg

(saperated key)
gpg --detach-sign filename
gpg -a --detach-sign filename
gpg --verify filename.sig filename

# sign-key
gpg --sign-key <user id>

Tuesday, March 24, 2015

OpenVPN with VPN Gate

VPN Gate is a project by University of Tsukuba, Japan.

Basically there're thousands of relay servers hosted by volunteers around the world.

As a Linux user, the easiest way to connect to VPN Gate servers is OpenVPN.

Just install openvpn from the official repositories.

sudo pacman -S openvpn

and randomly grab a configuration file like this: vpngate_vpn197292320.opengw.net_udp_1786.ovpn


Then use openvpn client to read the config file and connect to the free internet:

sudo openvpn vpngate_vpn197292320.opengw.net_udp_1786.ovpn

I wrote simple Perl script to get OpenVPN configs from VPN Gate


That will show you a list of available VPNs and save the config file for you.



Note for shadowsocks

Shadowsocks is a popular open sourced tunneling tool in China.


(both server and client)
sudo pacman -S shadowsocks

Salsa20 & Chacha20 support
sudo pacman -S libsodium python2-numpy python2-salsa20


sudo ssserver -c /etc/shadowsocks/config.json --user nobody

run as daemon
sudo ssserver -c /etc/shadowsocks/config.json --user nobody -d start
sudo ssserver -d stop

sslocal -c /etc/shadowsocks/config.json

run as daemon
sudo sslocal -c /etc/shadowsocks/config.json -d start
sudo sslocal -c /etc/shadowsocks/config.json -d stop

Chromium: use Proxy SwitchyOmega and connect to a local socks5 proxy

Android Client

QR code for Android client
sudo pacman -S python2-qrcode
echo -n "ss://"`echo -n aes-256-cfb:password@ | base64` | qr



Wednesday, March 4, 2015

Moving back to Taichung

I just moved back to Taichung. Leaving from freaking HsinChu is really a pleasing thing for me.

I finished 137/128 credits plus a security program in the past seven semesters but my average score is under 80 points, so I can't apply for leaving the school a semester ahead.

I looked up the rules for graduation and found an exception: I am able to take only one course (2 credits) in the coming semester and don't need to continue wasting my time in the campus with stupid people.

I withdrew my dorm and put all my stuffs in the van with my parents and headed to my lovely home.

Hi, I'm back.

So, from now on, I'm going to focus on my personal plans.
Basically there are three points:

1. continue my intern project (keep coding)
2. spend more time on foreign languages (now preparing for GRE and JLPT)
3. read more books (hope that I can finish all of my books on the shelf)

Anyway, I'm now back home. Welcome home to myself. ;)