finished the post_encryption functions, added some comments