Pin and zero the key to avoid keeping it in memory
Correctly read from streams and don't copy the input in memory