An antivirus may flag a file which matches the heuristics of a known virus. You can test this with an eicar test file, a string that isn't actually malicious but should trigger an antivirus to react to it.
By encrypting data before storing it, an antivirus would have no way to know the content of the file, so simply writing encrypted text shouldn't trigger an antivirus response, unless you are also doing other suspicious activity.