Thursday December 18, 2008 The encryption part of the OpenSolaris lofi compression & encryption project integrated into snv_105. I initially started this as a proof of concept several years ago but it never became high enough priority for such a long time. Casper Dik made a working version of it that was "distributed" internally for quite a few years as part of frkit. Now Dina has finished it off and got it integrated.
Finishing it off took much longer than we originally projected due to interactions with the compression code that was added to lofi and some very hard to track down bugs where lofi is used by xVM (the Xen based hypervisor) - particularly the interations with dom0 and domU lofi use.
So what can you do with it ? It is similar to what has been available for many many years on Linux using the cryptoloop system. It isn't perfect but it is better than the nothing we had before.
# mkfile 128m /export/lofi-backing-file
# lofiadm -a /export/lofi-backing-file -c aes-256-cbc
Enter passphrase:
Re-enter passphrase:
/dev/lofi/1
# newfs /dev/rlofi/1
newfs: construct a new file system /dev/rlofi/1: (y/n)? y
/dev/rlofi/1: 262036 sectors in 436 cylinders of 1 tracks, 601 sectors
127.9MB in 28 cyl groups (16 c/g, 4.70MB/g, 2240 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 9648, 19264, 28880, 38496, 48112, 57728, 67344, 76960, 86576,
173120, 182736, 192352, 201968, 211584, 221200, 230816, 240432, 250048, 259664
# mount /dev/lofi/1 /mnt
Nice and simple. We can also store the key in a file, key generation can be done with pktool(1). Or we can store it in any PKCS#11 accessible keystore:
# pktool genkey keystore=pkcs11 keytype=aes keylen=256 label=mylofikey Enter PIN for Sun Software PKCS#11 softtoken : # lofiadm -a /export/lofi-backing-file -c aes-256-cbc -T :::mylofikey Enter PIN for Sun Software PKCS#11 softtoken : /dev/lofi/1
I still think this is better than nothing even if we are delivering it much later than we had hoped. Ultimately ZFS encryption is the solution for OpenSolaris encrypted filesystems and volumes.
( Dec 18 2008, 01:09:46 AM GMT ) Permalink Comments [1]
It'd be interesting to see if the changes Juergen's prototyped for compression performance in bug 1119 helped the performance of encrypted lofi at all.
Posted by Dave Miner on December 19, 2008 at 10:11 PM GMT #