Finished all procedures, writing main encrypt method