I’m trying to find a very efficient way to encrypt files.
One way that I think is very efficient ( CPU-wise, not security-level wise ), is doing a XOR during writing and another xor at reading ( with a 4-bytes key for example ).
The way I want to do it is by creating my own Decorator of InputStream and OutputStream. Does anyone know a better method/most efficient than that ?
Create subclasses of FilterInputStream and FilterOutputStream.