Implemented prototype encrypt stream.