Note that there are some explanatory texts on larger screens.

plurals
  1. POError while encrypting string in staticLibrary
    text
    copied!<p>In my application I am using encryption and decryption.</p> <p>Before entering the string in to local database, I am encrypting that and after fetching the data from database I am decrypting it and using in my application. It is working fine. I have used encryption/decryption from <a href="http://blog.objectgraph.com/index.php/2010/04/20/encrypting-decrypting-base64-encode-decode-in-iphone-objective-c/" rel="nofollow">link below</a></p> <p><strong>At the time of Encrypting:</strong></p> <pre><code> NSString *myKey=@"any string more than 8 char"; NSData *data ; NSData *encryptedData; NSString *encryptPassword,*encryptPasscode; // 1) Encrypt data = [password dataUsingEncoding: NSASCIIStringEncoding]; encryptedData = [data AESEncryptWithPassphrase:myKey]; // 2) Encode Base 64 [Base64 initialize]; encryptPassword = [Base64 encode:encryptedData]; </code></pre> <p><strong>At the time of Decrypting :</strong></p> <pre><code> NSData *decryptedData; NSData *b64DecData; field1 = (char *) sqlite3_column_text(selectPasscodeStatement, 0); NSString *fieldStr1 = [[NSString alloc] initWithUTF8String: field1]; // 3) Decode Base 64 b64DecData = [Base64 decode:fieldStr1]; // 4) Decrypt decryptedData = [b64DecData AESDecryptWithPassphrase:myKey]; retrivedPasscode = [[NSString alloc] initWithData:decryptedData encoding:NSASCIIStringEncoding]; </code></pre> <p>But I have made staticLibrary of that same project. I am using that staticLibrary in another project. When I run that project, at the time of encrypting it gave me error below</p> <blockquote> <p><strong>-[NSConcreteMutableData AESEncryptWithPassphrase:]: unrecognized selector sent to instance 0x6a3fe40</strong></p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload