I want to write a small program in C/C++ which reads a small text file, and encrypts it, using a \"internal\" key. Then I also want to write another small program which can
OpenSSL is specifically concerned with implementing SSL and TLS which are protocols for encrypting data over a network. Since you are just looking to encrypt a file, it is possible to use OpenSSL but not ideal.
Instead, I would use something like BeeCrypt or Crypto++® Library 5.6.0 which both provide examples for their use.