Crypto Library for iOS

Crypto Library for iOS


IOS applications are developed in Objective c programming language. The fundamental library for using cryptographic techniques in iOS, which is actually not described by Apple, is CommonCrypto library. Common Crypto provides low-level C support for encryption and decryption, it provides a wide range of cryptographic algorithms used in various Internet standards, including additional hashing schemes, cipher modes, and so on. See here how to properly use CommonCrypto library.

IOS provides a number of encryption technologies. Of these, three APIs are available on both iOS and OS X:
  • Keychain Services API�provides secure storage for passwords, keys, and so on
  • Cryptographic Message Syntax�provides (nonstreaming) symmetric and asymmetric encryption and decryption
  • Certificate, Key, and Trust Services�provides cryptographic support services and trust validation
Keychain Services

The Keychain Services API is commonly used to store passwords, keys, certificates, and other secrets in a special encrypted file called a keychain. Developers should always use the keychain to store passwords and other short pieces of data (such as cookies) that are used to grant access to secure web sites, as otherwise this data might be compromised if an unauthorized person gains access to a user�s computer, mobile device, or a backup thereof.
Although this is mostly used for storing passwords and keys, the keychain can also store small amounts of arbitrary data. The keychain is described further in�Managing Keys, Certificates, and Passwords.�
OS X also includes a utility that allows users to store and read the data in the keychain, called Keychain Access. For more information, see �Keychain Access� in Security Overview.
For developers there is Keychain Services Programming Guide.


Cryptographic Message Syntax Services


The Cryptographic Message Syntax Services programming interface allows developer to encrypt or add a digital signature to S/MIME messages. (S/MIME is a standard for encrypting and signing messages, most commonly used with email.) It is a good API to use when signing or encrypting data for store-and-forward applications, such as email. See Cryptographic Message Syntax Services Reference for details.


Certificate, Key, and Trust Services


The Certificate, Key, and Trust Services API provides trust validation and support functions for cryptography. These features are described further in �Managing Keys, Certificates, and Passwords.�
In iOS, this API also provides basic encryption capabilities, as described in �Encryption in iOS.�

Security bugs in iOS

When we look back, iOS had many bugs in source code that led to hacker attacks. Here are some interesting links:
  • Article : Latest iOS 7 bug is embarrassingly simple and more about it.
  • iPhones and Macs get fix for extremely critical �triple handshake� crypto bug
  • iOS 7.0.6 and iOS 6.1.6 Still Vulnerable to Hacker Attacks, Says FireEye
  • Hackers use Find My iPhone to lockout, ransom Mac and iOS device owners in Australia
  • iOS Hackers handbook


download file now