title: SQLcipher how to create cypted database?
body: <p>I'm trying to follow this tutorial: <a href="http://sqlcipher.net/ios-tutorial/" rel="nofollow">http://sqlcipher.net/ios-tutorial/</a></p>
  
  <p>I create a database called "sqlcipher.db" then I recreate this </p>
  
  <p>When I execute this code: </p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
  
      NSString *databasePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] 
                                stringByAppendingPathComponent: @"encrypted.db"];
      sqlite3 *db;
      if (sqlite3_open([databasePath UTF8String], &amp;db) == SQLITE_OK) {
          const char* key = [@"secret" UTF8String];
          int sqlite3_key(sqlite3 *db, const void *pKey, int nKey);
          sqlite3_key(db, key, strlen(key));
          if (sqlite3_exec(db, (const char*) "SELECT count(*) FROM t1;", NULL, NULL, NULL) == SQLITE_OK) {
              // password is correct, or, database has been initialized
              NSLog(@"Hello 1");
          } else {
              // incorrect password!
              NSLog(@"Hello 2");
          }
  
          sqlite3_close(db);
      } else {
          NSLog(@"Hello 3");
      }
  }
  </code></pre>
  
  <p>It allways outs "Hello 2".</p>
  
  <p>When I try to reproduce the steps to crate an encrypted db described here <a href="http://zetetic.net/blog/2009/12/29/how-to-encrypt-a-plaintext-sqlite-database-to-use-sqlcipher.html#disqus_thread" rel="nofollow">http://zetetic.net/blog/2009/12/29/how-to-encrypt-a-plaintext-sqlite-database-to-use-sqlcipher.html#disqus_thread</a> I can't get it encrypted, I believe that it is beacause I am using sqlite3 mac command.</p>
  
  <p>So I saw in the comments that S Lombardo says that I have to compile a command line sqlcipher executable but the link doesn't works.</p>
  
  <p>How should I encrypt my database to use it with SQLcipher?</p>
  
  <p>Did anyone have success using sqlicipher in iOS?</p>