0

I need to pass the data to the server2.c through another server1.c in the middle. Before calling SSL_write() I want to encrypt my data using public key file pubkey.pem of the server2.c so the server1.c cannot understand the data and simply writes it to the server2.c

What system call I should use that takes data and public key file as arguments?

1 Answer 1

1

What system call I should use that takes data and public key file as arguments?

In the C language with OpenSSL, there are no arguments like in a program with argc and argv. There are functions and parameters.

In OpenSSL, you use the EVP functions to do it. In particular, EVP_Seal to encrypt and EVP_Open to decrypt using public key cryptography. See the EVP(3) man pages for more details. Or see OpenSSL's EVP Wiki page for details.

There are EVP_encrypt and EVP_Decrypt functions, but they are used for symmetric key encryption, and not public key encryption.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.