Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to use kernel cryptographic functions in the userspace? Let's say, I don't have md5sum binary installed on my system, but my kernel has md5sum support. Can I use the kernel function from userspace? How would I do it?

Another scenario would be, if I don't trust the md5sum binary on my system (my system could have been compromised), but I trust my kernel (I am using cryptographically signed kernel modules).

share|improve this question
If I have had access sufficient to subvert files in /usr/bin, then I've probably been able to subvert your kernel modules and anything else I want. Saying "I trust the kernel" in such a scenario is foolhardy. – msw Oct 4 '13 at 19:10
If you had subverted the kernel modules, then my kernel would refuse to load these modules, because the cryptographic signature would not match. I thought I have made this clear in my original question. – Martin Vegter Oct 15 '13 at 18:37
I forgot to mention that I also overwrote your "signatures" and your kernel. The kernel is just a file, it has no magical properties, and if I've hacked your machine then no file is safe. To be more explicit, if you don't trust the md5sum file there's no reason to trust the kernel or any other file. – msw Oct 15 '13 at 22:55
Overwriting the "kernel file" does not have any effect on the running kernel. You would have to restart the machine and boot into the compromised kernel. I think, I would have noticed if somebody had restarted my machine. – Martin Vegter Oct 16 '13 at 6:36

According to this article titled: A netlink-based user-space crypto API it would appear that what you're proposing is possible. I'm not sure how to answer your question any further than this article though.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.