Added output data encryption, need to add header generation