Perhaps it's better to do the crypto stuff like libusb, that is, have the kernel export only the data channel and have an userspace library (perhaps even daemon if there is concurrency to deal with) to do the crypto context setup etc.
An API for user-space access to kernel cryptography
Posted Aug 28, 2010 15:27 UTC (Sat) by kleptog (subscriber, #1183)
[Link]
Oh, I was thinking that the logical step would be cryptfs, where you mount a file system and get a bunch of directories representing encryption algorithms and you just open() the one you want and then use send/recvmsg with options to do the work you want.
No seriously, I don't understand why this needs to be in the kernel, a root-owned daemon should be more than enough.