Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/share/examples/rump/img2cgd



Module Name:    src
Committed By:   pooka
Date:           Tue Sep  8 21:48:25 UTC 2009

Added Files:
        src/share/examples/rump/img2cgd: Makefile cgd.conf cgd_rumpops.c
            img2cgd.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/examples/rump/img2cgd/Makefile \
    src/share/examples/rump/img2cgd/cgd.conf \
    src/share/examples/rump/img2cgd/cgd_rumpops.c \
    src/share/examples/rump/img2cgd/img2cgd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Home | Main Index | Thread Index | Old Index