testRewind tests reading and writing after rewind on an encrypted stream; testWriteWriteRead tests r+ mode