About Common Crypto

The Common Crypto library, also known as CCCrypt and 3CC, provide access to a number of types and flavors of encryption algorithms. The Common Crypto library of functions supports AES, DES, 3DES, and other encryption standards. Depending on the encryption algorithm used, block and/or stream ciphers are available.

在OS X v10.5 and later and iOS 5.0 and later 的系统中,Common Crypto成为用于加解密的被推荐的API。而之前的CDSA/CSSM则不被推荐使用。Apple的官方文档对Common Crypto介绍不多,只有manpage。现在我要从结构的角度介绍一下Common Crypto。

简单说Common Crypto就是一组API提供symmetric加解密相关的APIs。更具体而言,Common Crypto提供的API按照功能类别被声明在5个header file中,分别是:

  • CommonCryptor.h: 由CCCryptoRef对象提供使用AES128,DES,3DES,CAST,RC4,RC2算法的block cipher或者stream cipher;
  • CommonDigest.h:支持MD2、MD4、MD5、SHA1、SHA224、SHA256、SHA384和SHA512等hash算法;
  • CommonHMAC.h:HMAC是Hash-based message authentication code,
  • CommonKeyDerivation.h:提供derive key的API;
  • CommonSymmetricKeywrap.h: 提供wrap/unwrap a symmetric key with a Key Encription Key(KEK is key used to protect other keys);

应该来说,Common Crypto提供的功能还是很丰富的,类似于一个CSP提供的功能。

转载于:https://www.cnblogs.com/whyandinside/archive/2013/03/21/2973912.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值