I'm writing a C program that encrypts(based on the private key) and decrypts(based on the public key) text. I'm trying to do this with the OpenSSL lib. Does anyone know any good tutorial, quick starting guide or sample code? I haven't found any decent one on the web.
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- “Zero out” sensitive String data in Swift
- Mechanize getting “Errno::ECONNRESET: Connection r
- glDrawElements only draws half a quad
Here's an example I created for encrypting a file using RSA for the asymmetric algorithm and AES-128-CBC for the symmetric algorithm, with the OpenSSL EVP functions:
And the corresponding decryption example:
I think that's fairly easy to follow. As written both commands can be used as part of a pipeline (they take input on
stdin
and write output tostdout
).