I need to encrypt and decrypt files using the openssl library in C++.
I use the following for encryption to run in shell:
commandToRun = "openssl enc -aes-256-ctr -pbkdf2 -salt -in ";
commandToRun += in_fileToEncrypt;
commandToRun += " -out ";
commandToRun += in_fileToEncrypt;
commandToRun += ".enc -pass pass:";
commandToRun += in_password;
I use the following for decryption to run in shell:
commandToRun = "openssl enc -aes-256-ctr -pbkdf2 -salt -d -in ";
commandToRun += in_fileToDecrypt;
commandToRun += ".enc -out ";
commandToRun += in_fileToDecrypt;
commandToRun += " -pass pass:";
commandToRun += in_password;
These two methods use the openssl binary but I need code that does it in C++ directly using the openssl library.
Code needs to be in C++ and will run on Debian 10 Linux.
Hi there,
I would love to help you with this one.. feel free to get in touch with a short message to start discussing how to move forwards..
Best Regards..