Improve crypto lib