diff options
| author | pooka <pooka@NetBSD.org> | 2009-09-08 21:48:25 +0000 |
|---|---|---|
| committer | pooka <pooka@NetBSD.org> | 2009-09-08 21:48:25 +0000 |
| commit | 676351e4c4c84123f9b442087ec49404b88a93cd (patch) | |
| tree | 15a6e9a01a8057f2db4080e146beeaecdbd1dbc6 /sys/dev/dm/dm_dev.c | |
| parent | 7ae6c0a6f6bf9863bc94a2d649cd7f837eb36101 (diff) | |
Add a simple proof-of-concept program which shows how to use the
kernel cgd driver in an application which encrypts and decrypts
files. The cgd driver is running completely in userspace and
requires no special access privileges.
For example:
golem> dmesg > dmesg.txt
# write encrypted dmesg.txt to encrypted.img
golem> ./img2cgd write encrypted.img dmesg.txt
/cryptfile's passphrase:
# read encrypted.img and output decrypted contents to decrypted.txt
golem> ./img2cgd read encrypted.img decypted.txt
/cryptfile's passphrase:
golem> diff dmesg.txt decypted.txt
# but when entering a different password:
golem> ./img2cgd read encrypted.img decypted.txt
/cryptfile's passphrase:
golem> diff dmesg.txt decypted.txt
Binary files dmesg.txt and decypted.txt differ
Currently the utility writes the data length in a proprietary
format, but I'll convert it to use a real disklabel RSN. Then it
can be used to create cgd-encrypted disk images.
This program can later be used as a base for a utility to create
cgd-encrypted images of a standard NetBSD build. Idea for such a
tool and hence the inspiration for this simple example program from
Roland Dowdeswell.
Diffstat (limited to 'sys/dev/dm/dm_dev.c')
0 files changed, 0 insertions, 0 deletions
