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