]> git.friedersdorff.com Git - max/notes.git/blob - content/colemak_cryptsetup_passphrases.rst
Make articles drafts by default
[max/notes.git] / content / colemak_cryptsetup_passphrases.rst
1 Achieving a Colemak Layout for Typing LUKS Passphrases in Early Boot
2 ====================================================================
3
4 :date: 2019-03-26 14:02
5 :category: System Administration
6 :tags: cryptsetup, system administration, full disk encryption
7 :authors: Maximilian Friedersdorff
8 :summary: Having to type passphrases with an unfamiliar keyboard layout is slow and frustrating. 
9 :status: published
10
11 I use full disk encryption using `LVM on LUKS`_ on all of my desktops and
12 laptops. I trust my memory more than I do any USB device and so I rely on
13 typing in a passphrase during the boot process. Doing so is tedious, because in
14 general my prefered keyboard layout (Colemak) is not available before the root
15 partition has been mounted. The correct solution is to include the Colemak
16 keyboard layout as part of the initramfs.
17
18 Instead I propose the following hack:  Add a passphrase to the LUKS container
19 such that it is correct when one types the normal passphrase on the unfamiliar
20 keyboard layout, in my case those layouts are Colemak and QWERTY. First let's
21 define some terms:
22
23 - Layout1-Layout2 Conjugate: The Layout1-Layout2 Conjugate of the string `s` is
24   the string that would result from typing `s` as if one is using a Layout1
25   keyboard, but while actually typing on a Layout2 keyboard.  The Colemak-QWERTY
26   Conjugate of the string 'correct' is 'c;sskcf'.  Similarly, the
27   QWERTY-Colemak Conjugate of the string 'correct' is 'cyppfcg'.  Importantly
28   the inverse operation of the Layout1-Layout2 Conjugate is the Layout2-Layout1
29   Conjugate.  For example, the QWERTY-Colemak Conjugate of 'c;sskcf' is
30   'correct'.
31
32 In my case, I have to type my passphrase on a QWERTY keyboard during the early
33 boot process, but I want to type it as if I am typing on a Colemak keyboard.
34 This will result in the Colemak-QWERTY Conjugate as defined above.  If my
35 passphrase is 'correct horse battery staple', I will produce the string
36 'c;sskcf h;sdk baffkso dfaruk' in this manner.  In order for this to correctly
37 unlock my LUKS container, I should set this as an additional passphrase.
38
39
40 .. _LVM on LUKS: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_Entire_System#LVM_on_LUKS
41