Delete magic number

Replace '2' with BASE_ENCRYPT
Extract method encode
Extract method crypt