You are given a file system represented as a tree. There are two node types: - DirectoryNode: has a children list that can contain a mix of DirectoryNode and FileNode instances. - FileNode: has an is_encrypted boolean flag. Part 1: Implement a function that accepts a root DirectoryNode and recursively…