library(crypt)

crypt_open(+FileName, +Password, +Mode, -Stream)
is the same as open(FileName, Mode, Stream) except that the external file is encrypted, using Password as the key.
crypt_open(+FileName, +Mode, -Stream)
prompts for Password and proceeds as crypt_open/4.

These predicates do not use any of the encryption features of the operating system, so a separate C program for managing encrypted files is included.