update API based on http://blog.yezhucn.com/seccrypto/cryptography_functions.htm