Added two functions.

error_protect() encodes the data for data protection
error_correct() decodes and corrects errors