Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C unix, asymmetric encryption on a socket

i have a client/server application in C unix, and i need to encrypt/decript the data with something like RSA (but not necessarly RSA). Is there a library (and the correspondent documentation) for this kind of function?

like image 359
giozh Avatar asked Oct 08 '22 16:10

giozh


2 Answers

You can take a look at SSL/TLS C API.

like image 66
0xd Avatar answered Oct 10 '22 08:10

0xd


For a Client/Server Application, the best way to ensure security is by using TLS/SSL.

The latest version of TLS is TLS 1.2 (RFC 5246) and as WagnerVaz has rightly mentioned, the best opensource library available fro TLS is OpenSSL .OpenSSL not only provides the library for TLS/Crypto. But, it also provides you a tool for generating certificates & private keys (based on RSA/DSA etc) on various formats.

Though OpenSSL is the finest TLS Library available in the market, it is a little difficult to understand and use for a first timer. There is a very wonderful tutorial written by Eric Rescorla himself on using OpenSSL.

An Introduction to OpenSSL Programming (Part - I) / An Introduction to OpenSSL Programming (Part - II)

It would be best if you first try to get some idea as to what is SSL and then start writing code for the same.

Alternately, let's say you are interested only in assymetric encryption / decryption, still OpenSSL's Crypto Libraries can be used.

like image 36
Jay Avatar answered Oct 10 '22 09:10

Jay