I have defined a class so that it can closely resemble to what i believe encryption is. Am I even using encryption at all in this class?
The setEncrypt() member function accept an integer representing a "key" and a file object as an argument. If the key passed to the function is 5, then the contents of the file will be displayed.
Encryption would be anything that obsures the content, called plaintext. But you're not obsuring it at all. You just have some logic that decides whether the plaintext should be displayed, without changing the content.
We can use XOR to encrypt the file content in this way. XOR is a reversible operation, so encryption and decryption are the same.