Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel crypto API userspace access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
K-Bo
n00b
n00b


Joined: 03 Feb 2012
Posts: 13

PostPosted: Fri Nov 09, 2012 2:19 am    Post subject: Kernel crypto API userspace access Reply with quote

I am writing a an instant messenger program for my Networks class. I plan to use a block cipher to encrypt the contents of the messages for transit over the internet. During my kernel config I saw options for the linux kernel api in userspace. Can some one explain to me or point me to documentation on how I can call the kernel crypto api function from a C or C ++ program?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Fri Nov 09, 2012 3:20 pm    Post subject: Reply with quote

The Kernel crypto API is mainly for things like disk-encryption that happen inside the kernel (modules). Don't know for sure, but I'd expect any "userspace" options related to the crypto API are targeted toward similar applications like FUSE modules. For a pure userspace application it's better to use a userspace library like openssl for encryption for several reasons (portability, performance, compatibility, debugging options, ...).
Back to top
View user's profile Send private message
sundialsvc4
Guru
Guru


Joined: 10 Nov 2005
Posts: 436

PostPosted: Tue Nov 13, 2012 1:24 am    Post subject: Reply with quote

A more common use of those kernel routines is, say, VPN. The key-negotiation is handled by software but the actual encryption and decryption of packets (using a conventional cipher ...) is done in the kernel.

If you want to do crypto in a userland program, use a well-established library to do it ... gpg, openssl, and so-on. The kernel routines have nothing to do with this although they do implement some of the same ciphers.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum