{"id":454,"date":"2011-07-04T23:00:15","date_gmt":"2011-07-04T22:00:15","guid":{"rendered":"http:\/\/cdblog.cdstealer.com\/?p=454"},"modified":"2011-07-06T06:27:38","modified_gmt":"2011-07-06T05:27:38","slug":"simple-file-system-encryption","status":"publish","type":"post","link":"https:\/\/cdblog.cdstealer.com\/?p=454","title":{"rendered":"Simple File System Encryption"},"content":{"rendered":"<p>It's soooo easy to \"misplace\" your removable drive, so encrypting it is a good way to help protect your data should it be lost :)<\/p>\n<p>In this example, I will be using a USB2 2Gb flash drive.<\/p>\n<p>The first port of call is to ensure you have the DEVICE_MAPPER driver compiled into the kernel.\u00a0 If you're using a binary distro, this almost certainly is already present.<\/p>\n<p>Device Drivers -&gt;<br \/>\nMultiple devices driver support (RAID and LVM) -&gt;<br \/>\nDevice mapper support<br \/>\nCrypt target support<\/p>\n<p>Also ensure you have compiled the required encryption...<\/p>\n<p>Cryptographic API -&gt; (both options below are the default encryption used)<br \/>\nAES cipher algorithms (x86_64)\u00a0 &lt;---- only available on 64bit OS<br \/>\nAES cipher algorithms (AES-NI)<\/p>\n<p>Now insert your drive then run the following commands:<\/p>\n<p>cryptsetup -y luksFormat \/dev\/sdX# (whatever your node is)<br \/>\ncryptsetup luksOpen \/dev\/sdX# &lt;name&gt;\u00a0 &lt;-- this opens the encrypted device ready for mounting.\u00a0 The new device will now exist under \/dev\/mapper\/&lt;name&gt;<br \/>\nmke2fs -j -L &lt;name&gt; \/dev\/mapper\/&lt;name&gt;\u00a0 &lt;-- formats the partition<br \/>\ncryptsetup luksClose \/dev\/mapper\/&lt;name&gt;\u00a0 &lt;-- unmounts the encryption<\/p>\n<p>You can now unmount the drive and test it by re-inserting it.\u00a0 Your GUI <strong>should<\/strong> prompt you for the passphrase if all has worked ok.<\/p>\n<p>If you need to mount from the cli do the following:<\/p>\n<p>cryptsetup luksOpen \/dev\/sdX# &lt;name&gt;<br \/>\nmount \/dev\/mapper\/&lt;name&gt; \/mnt\/usb\/<\/p>\n<p>To unmount from the cli do the following:<\/p>\n<p>cryptsetup luksClose \/dev\/mapper\/&lt;name&gt;<br \/>\numount \/dev\/mapper\/&lt;name&gt;<\/p>\n<p>That's it... simple :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It's soooo easy to \"misplace\" your removable drive, so encrypting it is a good way to help protect your data should it be lost :) In this example, I will be using a USB2 2Gb flash drive. The first port of call is to ensure you have the DEVICE_MAPPER driver compiled into the kernel.\u00a0 If &hellip; <a href=\"https:\/\/cdblog.cdstealer.com\/?p=454\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Simple File System Encryption<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[83,213,18,82],"class_list":["post-454","post","type-post","status-publish","format-standard","hentry","category-gentoo","tag-encryption","tag-gentoo","tag-linux","tag-security"],"_links":{"self":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=454"}],"version-history":[{"count":6,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=\/wp\/v2\/posts\/454\/revisions\/460"}],"wp:attachment":[{"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cdblog.cdstealer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}