[encryption] clean up encryption exceptions

clean up the encryption exceptions, add error codes as constants and updated the header for all files I touched.