title: How to store critically sensitive information such as secret, key, token, encryptionKey in iOS application
body: <p>When we talk about securing iOS application we often forget to secure most critically sensitive information such as secret, key, token, encryptionKey.  This information is stored in iOS binary. So none of your server side security protocol will help you. </p>
  
  <p>There are lots of suggestion that we should not store such information in the app but store in the server and get it via SSL secured web service call. But this is not possible for all application. E.g. if my application does not need web service at all. </p>
  
  <p>In iOS app we have following option to store information.</p>
  
  <ol>
  <li><strong>UserDefault</strong>: Not appropriate for this case</li>
  <li><strong>String</strong> Constant: Not appropriate for this case. Can be reverse
  engineer to retrieve or just use <strong><a href="https://stackoverflow.com/questions/12260744/how-to-view-nsstring-defined-in-a-given-ios-ipa-file">strings command</a></strong> </li>
  <li><strong>Secure Database</strong>: Store in Secure and encrypted Database. <strong>But again have responsibility to secure database username and password.</strong></li>
  <li><strong>KeyChain</strong>: Best to store critical info. But we cannot save information before installing the app. To store in the keychain, we first need to open the app, read from some source and store in the keychain. Not appropriate for our case either. </li>
  <li><strong>Custom Hash String Constant</strong>: Not to directly use secret, token, key from service provider (mixpanel, paypal), instead use hash version of that information from custom key. This is also not perfect solution. But add complexity during hacking. </li>
  </ol>
  
  <p>Kindly send some awsome solution to this problem. </p>