Added Enc and Dec functions