<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=LoopCrypt</id>
	<title>LoopCrypt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=LoopCrypt"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=LoopCrypt&amp;action=history"/>
	<updated>2026-05-23T00:10:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=LoopCrypt&amp;diff=2089&amp;oldid=prev</id>
		<title>PhilippeTeuwen: /* Cryptsetup &amp; LUKS */</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=LoopCrypt&amp;diff=2089&amp;oldid=prev"/>
		<updated>2007-04-12T20:05:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Cryptsetup &amp;amp; LUKS&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 20:05, 12 April 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cf /usr/share/doc/cryptsetup/CryptoSwap.HowTo&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cf /usr/share/doc/cryptsetup/CryptoSwap.HowTo&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The diff is that I had to destroy the content of the swap partition before /etc/init.d/cryptdisks otherwise cryptsetup refuses to work.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The diff is that I had to destroy the content of the swap partition before /etc/init.d/cryptdisks otherwise cryptsetup refuses to work.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== To encrypt disks ===&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Creation&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cryptsetup luksFormat /dev/hdaX&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cryptsetup luksOpen /dev/hdaX hdaX&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* mkfs.ext3 /dev/mapper/hdaX&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cryptsetup luksClose hdaX&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Usage&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* cryptsetup luksOpen /dev/hdaX hdaX &amp;amp;&amp;amp; mount -t ext3 /dev/mapper/hdaX /mnt/&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* umount /mnt &amp;amp;&amp;amp; cryptsetup luksClose hdaX&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Loopcrypt==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Loopcrypt==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-1448:rev-2089:wikidiff2=table:1.14.1:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=LoopCrypt&amp;diff=1448&amp;oldid=prev</id>
		<title>PhilippeTeuwen at 21:53, 18 November 2006</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=LoopCrypt&amp;diff=1448&amp;oldid=prev"/>
		<updated>2006-11-18T21:53:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Cryptsetup &amp;amp; LUKS==&lt;br /&gt;
&lt;br /&gt;
=== To encrypt the swap===&lt;br /&gt;
* apt-get install cryptsetup&lt;br /&gt;
* cf /usr/share/doc/cryptsetup/CryptoSwap.HowTo&lt;br /&gt;
* The diff is that I had to destroy the content of the swap partition before /etc/init.d/cryptdisks otherwise cryptsetup refuses to work.&lt;br /&gt;
&lt;br /&gt;
==Loopcrypt==&lt;br /&gt;
&lt;br /&gt;
Should work with the Knoppix&lt;br /&gt;
&lt;br /&gt;
As root:&lt;br /&gt;
&lt;br /&gt;
Make a mount point for the encrypted filesystem as follows:&lt;br /&gt;
 mkdir /mnt/crypt&lt;br /&gt;
Edit &amp;#039;/etc/fstab&amp;#039;, adding an entry for your mount point as follows:&lt;br /&gt;
 /dev/loop0 /mnt/crypt ext2 user,noauto,rw,loop 0 0&lt;br /&gt;
Create your encrypted file as follows:&lt;br /&gt;
 dd if=/dev/urandom of=/etc/cryptfile bs=1M count=10&lt;br /&gt;
This creates a 10M encryption &amp;quot;container&amp;quot; in /etc called cryptfile.&lt;br /&gt;
&amp;lt;br&amp;gt;You can adjust size, location, and name to your preferences.&lt;br /&gt;
&lt;br /&gt;
Next, run losetup as follows:&lt;br /&gt;
 losetup -e aes /dev/loop0 /etc/cryptfile&lt;br /&gt;
You only have one chance to enter the 20 character password, be careful.&lt;br /&gt;
&amp;#039;&amp;#039;Note: optional test&amp;#039;&amp;#039;&lt;br /&gt;
If you want to double-check your password, use the command:&lt;br /&gt;
 losetup -d /dev/loop0&lt;br /&gt;
to deactivate your loop device. Next you will run losetup again to test your password, as follows:&lt;br /&gt;
 losetup -e aes /dev/loop0 /etc/cryptfile&lt;br /&gt;
&amp;#039;&amp;#039;end optional test&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Make your ext2 filesystem as follows:&lt;br /&gt;
 mkfs -t ext2 /dev/loop0&lt;br /&gt;
Now you can mount the encrypted filesystem with:&lt;br /&gt;
 mount -t ext2 /dev/loop0 /mnt/crypt&lt;br /&gt;
When you&amp;#039;re done, you can unmount and protect your filesystem as follows:&lt;br /&gt;
 umount /dev/loop0&lt;br /&gt;
 losetup -d /dev/loop0&lt;br /&gt;
&lt;br /&gt;
The above works fine for the root user, but I wanted something where &amp;quot;joe user&amp;quot; could mount, unmount, and read / write to the encrypted container.&lt;br /&gt;
&amp;lt;br&amp;gt;After a little trial and effort, here is what I have come up with...&lt;br /&gt;
&lt;br /&gt;
This example shows how to create an ext2 file system on encrypted file.&lt;br /&gt;
&amp;lt;br&amp;gt;This example creates a 5 MB file (/mnt/msdos/scratch/cryptfile) for storage and a directory (/mnt/crypt) as a mount point.&lt;br /&gt;
&lt;br /&gt;
A couple of notes: This example is intentionally simple to help you understand basic loop encryption, but is also vulnerable to optimized dictionary attacks.&lt;br /&gt;
&amp;lt;br&amp;gt;Also, the &amp;quot;losetup -e&amp;quot; command asks for a 20 character encryption password, make up one and don&amp;#039;t forget it.&lt;br /&gt;
&lt;br /&gt;
Execute the following commands (as root), modifying paths and filenames for your purposes:&lt;br /&gt;
 dd if=/dev/zero of=/mnt/msdos/scratch/cryptfile bs=4k count=1280&lt;br /&gt;
 losetup -e AES128 -T /dev/loop1 /mnt/msdos/scratch/cryptfile&lt;br /&gt;
 mkfs -t ext2 /dev/loop1&lt;br /&gt;
 losetup -d /dev/loop1&lt;br /&gt;
 mkdir /mnt/crypt&lt;br /&gt;
 cd /mnt/crypt&lt;br /&gt;
 chown knoppix.knoppix *&lt;br /&gt;
 chown knoppix.knoppix .&lt;br /&gt;
 chown knoppix.knoppix ..&lt;br /&gt;
 cd ..&lt;br /&gt;
 chown knoppix.knoppix crypt&lt;br /&gt;
Next, add this to your /etc/fstab file (all one line):&lt;br /&gt;
 /mnt/msdos/scratch/cryptfile /mnt/crypt ext2 noauto,users,exec,loop=/dev/loop1,encryption=AES128 0 0&lt;br /&gt;
Exit the root account, to your joe user account (knoppix in this example).&lt;br /&gt;
&lt;br /&gt;
Now regular users should be able to mount the file system as follows (after answering the password prompt correctly).&lt;br /&gt;
 mount /mnt/crypt&lt;br /&gt;
The can then unmount it like this:&lt;br /&gt;
 umount /mnt/crypt&lt;br /&gt;
==Attempt to recover old loopcrypts==&lt;br /&gt;
* http://www.saout.de/misc/dm-crypt/&lt;br /&gt;
* http://clemens.endorphin.org/Cryptoloop_Migration_Guide&lt;br /&gt;
* http://glarson.org/files/loopaes&lt;br /&gt;
 apt-get install hashalot&lt;/div&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
</feed>