Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.