On 8/30/2022 2:24 PM, Daggumati, Rajesh via Boost wrote:
Hi Team, We can create an .csv file using std::ofstream() function.
But my project requirement demands to create a .csv file with password protected.
Ofstream has open() function to create a file but how to create a file with password protected?
Please help me on this.
Regards, Rajesh D
You need to use a library that does password key derivation, secret key encryption and preferably a message authentication code to verify integrity. For a C++ library with lots of options, try crypto++:
Crypto++ has lots of older algorithms that should no longer be used in modern systems. I recommend Argon2 for password key derivation, and ChaCha20 with Poly1305 for secret key encryption. Kind regards, Philip Bennefall