finally fixing that "cryptostream is not writeable" problem