Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Stream Read Error when Encryption enabled


Good day,

I’ve the following error message: “Stream read error” when opening the log file using encryption.

My C# code is the following:

var path = string.Format(@"file(filename={0}\{1}, encrypt=true, key=MyLogFilePassword)", myPath, "log.sil");

This only happens when log file is empty.




Hi David,

Thanks for your posting. Could you please verify that you also set Enabled = false at the end of your application? This is needed for encrypted log files in order to flush the last block before the file is closed.