{"id":772,"date":"2009-08-28T20:59:49","date_gmt":"2009-08-28T17:59:49","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=772"},"modified":"2009-08-28T21:03:26","modified_gmt":"2009-08-28T18:03:26","slug":"how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/","title":{"rendered":"how to use encrypted loop files with a gpg passphrase in Debian"},"content":{"rendered":"<p>Fast howto (mostly a note for personal use) on what&#8217;s needed on Debian to use an encrypted loop:<\/p>\n<p>1.  The necessary utilities (patched losetup)<br \/>\n<code># aptitude install loop-aes-utils <\/code><br \/>\n2. The necessary kernel-module<br \/>\n<code># aptitude install loop-aes-modules-2.6.30-1-686-bigmem<\/code><br \/>\n3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy)<br \/>\n<code># head -c 2925 \/dev\/urandom | uuencode -m - | head -n 66 | tail -n 65| gpg --symmetric -a >\/path\/to\/keyfile.gpg<\/code><br \/>\n4.  Loopfile creation (10Mb)<br \/>\n<code># dd if=\/dev\/urandom of=\/my-encrypted-loop.aes bs=1k count=10000<\/code><br \/>\n5. Initialize loopfile<br \/>\n<code># losetup -K \/path\/to\/keyfile.gpg -e AES256 \/dev\/loop5 \/home\/username\/crypto-loop.img<\/code><br \/>\n6. Format loopfile<br \/>\n<code># mke2fs \/dev\/loop5<\/code><br \/>\n7. Delete loop device<br \/>\n<code># losetup -d \/dev\/loop5<\/code><br \/>\n8. Create mount point for loopfile<br \/>\n<code># mkdir \/mnt\/crypto-loop<\/code><br \/>\n9. Add entry to fstab<\/p>\n<blockquote><p>\/home\/username\/crypto-loop.img \/mnt\/crypt-loop ext2 defaults,noauto,user,loop=\/dev\/loop7,encryption=AES256,gpgkey=\/path\/to\/keyfile.gpg 0 0<\/p><\/blockquote>\n<p>10. Try mounting the loopfile as user<br \/>\n<code>$ mount \/mnt\/crypto-loop<\/code><br \/>\n11. Check it&#8217;s mounted properly<br \/>\n<code>$ mount | grep -i aes<\/code><\/p>\n<p>and use it!<\/p>\n<p>P.S. Secure your keyfile.gpg, if it gets lost you won&#8217;t _ever_ be able to decrypt what was inside crypto-loop.img!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Fast howto (mostly a note for personal use) on what&#8217;s needed on Debian to use an encrypted loop: 1. The necessary utilities (patched losetup) # aptitude install loop-aes-utils 2. The necessary kernel-module # aptitude install loop-aes-modules-2.6.30-1-686-bigmem 3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy) # head [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[6,3],"tags":[189,33,598,82,595,187,188],"class_list":["post-772","post","type-post","status-publish","format-standard","hentry","category-encryption","category-linux","tag-aes","tag-debian","tag-encryption","tag-gpg","tag-linux","tag-loop","tag-loop-aes"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"Fast howto (mostly a note for personal use) on what&#039;s needed on Debian to use an encrypted loop: 1. The necessary utilities (patched losetup) # aptitude install loop-aes-utils 2. The necessary kernel-module # aptitude install loop-aes-modules-2.6.30-1-686-bigmem 3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy) # head\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"kargig\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#article\",\"name\":\"how to use encrypted loop files with a gpg passphrase in Debian | Into.the.Void.\",\"headline\":\"how to use encrypted loop files with a gpg passphrase in Debian\",\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"},\"datePublished\":\"2009-08-28T20:59:49+03:00\",\"dateModified\":\"2009-08-28T21:03:26+03:00\",\"inLanguage\":\"en-US\",\"commentCount\":4,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#webpage\"},\"articleSection\":\"Encryption, Linux, aes, debian, Encryption, gpg, Linux, loop, loop-aes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/linux\\\/#listItem\",\"name\":\"Linux\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/linux\\\/#listItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/linux\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#listItem\",\"name\":\"how to use encrypted loop files with a gpg passphrase in Debian\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#listItem\",\"position\":3,\"name\":\"how to use encrypted loop files with a gpg passphrase in Debian\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/category\\\/linux\\\/#listItem\",\"name\":\"Linux\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/kargig\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/\",\"name\":\"kargig\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#webpage\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/\",\"name\":\"how to use encrypted loop files with a gpg passphrase in Debian | Into.the.Void.\",\"description\":\"Fast howto (mostly a note for personal use) on what's needed on Debian to use an encrypted loop: 1. The necessary utilities (patched losetup) # aptitude install loop-aes-utils 2. The necessary kernel-module # aptitude install loop-aes-modules-2.6.30-1-686-bigmem 3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy) # head\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/2009\\\/08\\\/28\\\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/author\\\/site-admin\\\/#author\"},\"datePublished\":\"2009-08-28T20:59:49+03:00\",\"dateModified\":\"2009-08-28T21:03:26+03:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/\",\"name\":\"Into.the.Void.\",\"description\":\"Into The Void\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.void.gr\\\/kargig\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"how to use encrypted loop files with a gpg passphrase in Debian | Into.the.Void.","description":"Fast howto (mostly a note for personal use) on what's needed on Debian to use an encrypted loop: 1. The necessary utilities (patched losetup) # aptitude install loop-aes-utils 2. The necessary kernel-module # aptitude install loop-aes-modules-2.6.30-1-686-bigmem 3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy) # head","canonical_url":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#article","name":"how to use encrypted loop files with a gpg passphrase in Debian | Into.the.Void.","headline":"how to use encrypted loop files with a gpg passphrase in Debian","author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"},"datePublished":"2009-08-28T20:59:49+03:00","dateModified":"2009-08-28T21:03:26+03:00","inLanguage":"en-US","commentCount":4,"mainEntityOfPage":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#webpage"},"isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#webpage"},"articleSection":"Encryption, Linux, aes, debian, Encryption, gpg, Linux, loop, loop-aes"},{"@type":"BreadcrumbList","@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/www.void.gr\/kargig\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/#listItem","name":"Linux"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/#listItem","position":2,"name":"Linux","item":"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#listItem","name":"how to use encrypted loop files with a gpg passphrase in Debian"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#listItem","position":3,"name":"how to use encrypted loop files with a gpg passphrase in Debian","previousItem":{"@type":"ListItem","@id":"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/#listItem","name":"Linux"}}]},{"@type":"Organization","@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization","name":"Into.the.Void.","description":"Into The Void","url":"https:\/\/www.void.gr\/kargig\/blog\/","sameAs":["https:\/\/x.com\/kargig"]},{"@type":"Person","@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author","url":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/","name":"kargig"},{"@type":"WebPage","@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#webpage","url":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/","name":"how to use encrypted loop files with a gpg passphrase in Debian | Into.the.Void.","description":"Fast howto (mostly a note for personal use) on what's needed on Debian to use an encrypted loop: 1. The necessary utilities (patched losetup) # aptitude install loop-aes-utils 2. The necessary kernel-module # aptitude install loop-aes-modules-2.6.30-1-686-bigmem 3. Create the keyfile (keep your computer as busy as possible while doing this to increase entropy) # head","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/#breadcrumblist"},"author":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"creator":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/author\/site-admin\/#author"},"datePublished":"2009-08-28T20:59:49+03:00","dateModified":"2009-08-28T21:03:26+03:00"},{"@type":"WebSite","@id":"https:\/\/www.void.gr\/kargig\/blog\/#website","url":"https:\/\/www.void.gr\/kargig\/blog\/","name":"Into.the.Void.","description":"Into The Void","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.void.gr\/kargig\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"772","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2022-01-04 11:57:20","updated":"2026-10-21 09:44:36","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/\" title=\"Linux\">Linux<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\thow to use encrypted loop files with a gpg passphrase in Debian\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.void.gr\/kargig\/blog\/"},{"label":"Linux","link":"https:\/\/www.void.gr\/kargig\/blog\/category\/linux\/"},{"label":"how to use encrypted loop files with a gpg passphrase in Debian","link":"https:\/\/www.void.gr\/kargig\/blog\/2009\/08\/28\/how-to-use-encrypted-loop-files-with-a-gpg-passphrase-in-debian\/"}],"views":25199,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/772","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=772"}],"version-history":[{"count":5,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/772\/revisions"}],"predecessor-version":[{"id":777,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/772\/revisions\/777"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}