{"id":17,"date":"2011-07-17T15:27:05","date_gmt":"2011-07-17T13:27:05","guid":{"rendered":"http:\/\/blog.pewo.se\/?p=17"},"modified":"2011-07-17T15:27:05","modified_gmt":"2011-07-17T13:27:05","slug":"howto-add-a-passphrase-to-encrypted-volume-using-luks","status":"publish","type":"post","link":"https:\/\/blog.pewo.nu\/?p=17","title":{"rendered":"Howto add a passphrase to encrypted volume using LUKS"},"content":{"rendered":"<p>Howto add a passphrase to encrypted volume using LUKS<\/p>\n<p>From the manpage CRYPTSETUP(8)<\/p>\n<p><code>LUKS,\u00a0 Linux Unified Key Setup, is a standard for hard disk encryption. It standardizes a partition header, as well as the format of the bulk data. LUKS can manage\u00a0 multiple\u00a0 passwords,\u00a0 that can be revoked effectively and that are protected against dictionary attacks with PBKDF2.<\/code><\/p>\n<p>Find a free slot for your new passphrase<\/p>\n<p><code>root@d410:\/# <strong>cryptsetup luksDump \/dev\/sda5<\/strong><\/code><br \/>\n<code>LUKS header information for \/dev\/sda5<br \/>\nVersion:        1<br \/>\nCipher name:    aes<br \/>\nCipher mode:    cbc-essiv:sha256<br \/>\nHash spec:      sha1<br \/>\nPayload offset: 2056<br \/>\nMK bits:        256<br \/>\nMK digest:      21 d9  81 23 41 ce ed 02 eb b6 6d ab 7b 11 09 14 79<br \/>\nMK salt:        81 67 8f 42 ba 90 73 db 5c 92 e0 d9 b0 e4 f8 75 e0 30 61 49 9f 8a 21 3e 50 28 1f 33 58 1b 87<br \/>\nMK iterations:  18125<br \/>\nUUID:           9b250a8f-3dab-4162-8e1f-5bf7945e9fa0<br \/>\n<\/code><br \/>\n<code>Key Slot 0: ENABLED<br \/>\nIterations:             74344<br \/>\nSalt:                   b4 ab 33 6b 82 31 ee ef 02 hb b6 b0 e4 f8 75 c1<br \/>\nb7 d4 0b 5d 93 11 40 65 7a 2f 18 d6 ee fd b6 d3<br \/>\nKey material offset:    8<br \/>\nAF stripes:             4000<br \/>\nKey Slot 1: ENABLED<br \/>\nIterations:             74751<br \/>\nSalt:                   5c 92 e0 d9 ec f4 3a 21 42 39 fe 4a 47 52 29 19<br \/>\n85 7e 93 c1 c9 dd 9f 8a 2e 3d 54 24 1f 30 2f ea<br \/>\nKey material offset:    264<br \/>\nAF stripes:             4000<br \/>\nKey Slot 2: DISABLED<br \/>\nKey Slot 3: DISABLED<br \/>\nKey Slot 4: DISABLED<br \/>\nKey Slot 5: DISABLED<br \/>\nKey Slot 6: DISABLED<br \/>\nKey Slot 7: DISABLED<\/code><\/p>\n<p>Key Slot 2 is available<\/p>\n<p><code>root@d410# <strong>cryptsetup -y luksAddKey \/dev\/sda5 --key-slot=2<\/strong><br \/>\nEnter any passphrase: <strong>&lt;enter an existing passphrase<\/strong>&gt;<br \/>\nVerify passphrase: &lt;<strong>enter the same passphrase as above<\/strong>&gt;<br \/>\nEnter new passphrase for key slot: <strong>&lt;enter a new passphrase<\/strong>&gt;<br \/>\nVerify passphrase: <strong>&lt;repeat the new passphrase&gt;<\/strong><\/code><\/p>\n<p>Check with cryptsetup<br \/>\n<code>root@d410:\/# <strong>cryptsetup luksDump \/dev\/sda5<\/strong><\/code><br \/>\n<code><em>&lt;snip&gt;<\/em><br \/>\nKey Slot 2: ENABLED<br \/>\nIterations:             73322<br \/>\nSalt:                   6b e2 3c 31 19 f3 ad 74 43 52 11 91 f4 68 dd f2<br \/>\n49 7f 65 32 54 40 a7 71 1c 1a 4c fe 15 25 56 cb<br \/>\nKey material offset:    520<br \/>\nAF stripes:             4000<br \/>\n<em> &lt;\/snip&gt;<\/em><\/code><\/p>\n<p>To delete a passphrase use the luksKillSlot<\/p>\n<p>Deleting the newly added key (Key Slot 2)<\/p>\n<p><code>root@d410:\/# <strong>cryptsetup luksKillSlot \/dev\/sda5 2<\/strong><br \/>\nEnter any remaining LUKS passphrase: <strong>&lt;enter an existing passphrase<\/strong>&gt;<br \/>\n<\/code><\/p>\n<p>Check with cryptsetup<br \/>\n<code>root@d410:\/# <strong>cryptsetup luksDump \/dev\/sda5<\/strong><\/code><br \/>\n<em> &lt;snip&gt;<\/em><br \/>\nKey Slot 2: DISABLED<br \/>\n<em> &lt;\/snip&gt;<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Howto add a passphrase to encrypted volume using LUKS From the manpage CRYPTSETUP(8) LUKS,\u00a0 Linux Unified Key Setup, is a standard for hard disk encryption. It standardizes a partition header, as well as the format of the bulk data. LUKS &hellip; <a href=\"https:\/\/blog.pewo.nu\/?p=17\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[7,6,8],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-unixlinux","tag-cryptsetup","tag-encryption","tag-passphrase"],"_links":{"self":[{"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":22,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pewo.nu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}