Hi Aleksey, Thanks a lot for your reply. Actually your link does not help me much because the output of the example is an XML file, whereas I'd like o encrypt so that the output file is a binary file, too. Can libxmlsec help with that ? Thanks in advance for your assistance, Sébstien.