{"id":105,"date":"2005-03-07T04:57:53","date_gmt":"2005-03-07T01:57:53","guid":{"rendered":"http:\/\/void.gr\/kargig\/blog\/?p=105"},"modified":"2005-03-31T16:34:50","modified_gmt":"2005-03-31T13:34:50","slug":"encrypting-the-swap-partition","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2005\/03\/07\/encrypting-the-swap-partition\/","title":{"rendered":"Encrypting the swap partition"},"content":{"rendered":"<p>Now that my system is considered (that&#8217;s what I think) a working desktop machine, it&#8217;s time for some security. First and easiest thing to do is to encrypt the swap partition.<br \/>\nWhat should I use though to achieve this goal ? cryptoloop ? Loop-AES ? cgd ? ppdd ? and so on and so on&#8230;The choices are too many to list. After reading Loop-AES author&#8217;s reply to this question:<\/p>\n<blockquote><p>\n[&#8230;] if Loop-AES works so much better, why hasn&#8217;t it been included in the kernel?[&#8230;]\n<\/p><\/blockquote>\n<p><a href=\"http:\/\/http:\/\/www.uwsg.iu.edu\/hypermail\/linux\/kernel\/0402.2\/1137.html\">here<\/a>, and studying this great guide on computer security (<a href=\"http:\/\/jdoedoe.tripod.com\/\">How to defend your Privacy<\/a>), I&#8217;ve decided to go for Loop-AES.<\/p>\n<p>Quick SWAP encryption with Loop-AES HOWTO for gentoo linux:<\/p>\n<p>1)Be SURE to remove any loop support from your kernel. Either as a module or builtin. We are going to build our own module so we don&#8217;t want the kernel&#8217;s module. <\/p>\n<p>2) Supposing that your kernel does NOT have loop support we move on to installing the necessary packages.<br \/>\n<code><br \/>\necho \"sys-fs\/loop-aes ~x86\" >> \/etc\/portage\/package.keywords<br \/>\nemerge \/usr\/portage\/sys-apps\/util-linux\/util-linux-2.12q.ebuild<br \/>\nemerge loop-aes<br \/>\n<\/code><\/p>\n<p>3) Time to change current swap configuration end enable the encryption support<br \/>\n<code><br \/>\nswapoff -a<br \/>\n<\/code><br \/>\nNow edit your \/etc\/fstab, find your swap lines and change them to something looking like this:<br \/>\n<code><br \/>\n \/dev\/hda999   none   swap   sw,loop=\/dev\/loop9,encryption=AES128   0   0<br \/>\n<\/code><\/p>\n<p>4) We now clean the swap partition by filling it with 0s, recreate the swap partition and start using it<br \/>\n<code><br \/>\ndd if=\/dev\/zero of=\/dev\/hda999 bs=64k conv=notrunc<br \/>\nmkswap \/dev\/hda999<br \/>\nswapon -a<br \/>\n<\/code><\/p>\n<p>You are ready, you swap is now encrypted on the fly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that my system is considered (that&#8217;s what I think) a working desktop machine, it&#8217;s time for some security. First and easiest thing to do is to encrypt the swap partition. What should I use though to achieve this goal ? cryptoloop ? Loop-AES ? cgd ? ppdd ? and so on and so on&#8230;The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[1,3],"tags":[],"class_list":["post-105","post","type-post","status-publish","format-standard","hentry","category-general","category-linux"],"aioseo_notices":[],"views":2881,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=105"}],"version-history":[{"count":0,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/105\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}