Encrypt/Decrypt File With OpenSSL C++
Budget: $10 – $30 USD
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.
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.