Main » 2011 » Март » 16 » Encrypt the full
13:11
Encrypt the full
Once the idea to hide the data away from human eyes, I scratch with a variety of encryption systems and found a huge minus, they advertise their presence (to install) and make the fact of the existence of kriptokonteynera explicit (an empty partition or file kriptokonteynerom)

T. e. in both cases you can "termorektalny cryptanalysis TM» on the fact of encryptions disk imaging on the computer.

What led me to write a script.
It can be run even from a LiveCD, it does not create encrypted files or partitions, but of course has the following problems:
  • control the integrity of the data will have to manually

Below is the code, use it at your own and risk, in which case for damage to your data, I am not responsible.
Who cares look under the cut.



The essence of all bodily movements is to create kriptokonteyner used to drive in the unused area by using only the standard built-in commands Ububntu LiveCD.

Tested it only in the sandbox (on a separate partition created kriptokonteyner 200MB 50MB 50MB offset) md5 sums of files on a physical partition (20MB) and inside kriptokonteynera (10 MB) agreed with the originals.

All we do as root (sudo su).
Device, location (offset), size is replaced with your own. The size and offset from the beginning of the disc anywhere is specified in megabytes bytes.

Create


modprobe cryptoloop
modprobe aes

mkdir ~ / mnt1
mount-t tmpfs ~ / mnt1
dd if = / dev / urandom of = ~ / mnt1/file bs = 1M count = size
losetup-e aes / dev/loop2 ~ / mnt1/file
/ / enter password
mkfs-t ext2 / dev/loop2
dd if = / dev/loop2 of = device bs = 1M seek = location count = size

losetup-e aes / dev/loop1 <device>-o <place> - sizelimit <size>
/ / enter Password
mount / dev/loop1 <mount point>
mkfs-t ext2 <mount point>


mount


modprobe cryptoloop
modprobe aes


mkdir ~ / mnt1
mkdir ~ / mnt2
mount-t tmpfs ~ / mnt1
dd of = ~ / mnt1/file if = device bs = 1M skip = location count = size
losetup-e aes / dev/loop2 ~ / mnt1/file
/ / enter password
mount / dev/loop2 ~ / mnt2

losetup-e aes / dev/loop1 <device>-o <place> ; - sizelimit <size>
/ / enter password
mount / dev/loop1 <mount point>

unmount


umount / dev/loop2
dd if = / dev/loop2 of = device bs = 1M seek = location count = size

umount / dev/loop1

Note


If anyone knows a simple solution to beg in the comments. And once again warn you, this method is dangerous for your data, use it only in extreme cases. Also in the script may be errors and inaccuracies, so I do not advise using it on a very important data.

PS: As an extension of this method in a small container is created in this way we can put a full program for encryption, for example, the same Truecrypt. Or come up with something of my own using a similar principle, but more comfortable and safer.

UPD: Early was young and stupid, everything becomes a lot easier than it was originally presented, in fact corrected the article.
Views: 619 | Added by: w1zard | Rating: 0.0/0
Total comments: 0
Имя *:
Email *:
Код *: