added enc/dec test func