Smart card security and applications