Alan Quatermain provides a toolkit that has some useful wrappers around cryptographic libraries to make encryption / decryption very simple.
Here is the link:
AlanQuatermain / aqtoolkit
No matter what you do, just make sure that you do not store the document on the device unencrypted even for a short time. Always store it in encrypted form. Perform any encryption operation in memory.
Make sure for any file operations that you do not cache. So, for example, with any download, etc. You want to make sure that no data is temporarily written to the disk.
Finally, for your encrypted documents, do not store the key on the device in any format. Do not store it in a keychain.
source share