the mysql function encode() should work fine.
insert into table set ccNum = encode('$ccNum', '$encodeKey')
The encodeKey variable (of course) being your encoding/decoding key. To decode, it would be the same, just decode()
select decode(ccNum, '$encodeKey') as ccNum from table
Hope this helps.
-Travis