English 中文(简体)
静态图书馆的加密
原标题:Error while encrypting string in staticLibrary

在我的申请中,我使用了加密和加密。

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 link below

www.un.org/spanish/ecosoc 在加密时:

    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];

www.un.org/spanish/ecosoc 加密时:

    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];

但是,我已静态地接受了同样的项目。 我在另一个项目中利用这一静态图书馆。 当我管理该项目时,在加密时,它给我留下了以下错误:

[NSConcrete MutableData] 缩略语

最佳回答

You need to make change in the Build Settings of the project which will link the static library with the main project. Follow these steps:

(1) 铺设地板。

2)Search for “其他联系旗帜”。

3)Add -all_loadcode to it。

4)Build and run the project.

它对我来说是很出色的。

问题回答

1. 进口类别负责人档案:

#import "NSData-AES.h"

我认为有<代码>。 AESDecodeWithPassphrase methods下定义。 如果没有这种说法,则不知道这种方法。

仅澄清一下——在你想要利用这一类别所增加的能力的每一个档案中,你必须输入该类别负责人的档案。





相关问题
Extend Contacts application on Android to provide encryption

I want to encrypt individual contacts stored by the Contacts application on Android based on user s preference. So, I am thinking I ll have to hook/extend the Contacts application before the it stores ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

Thread & Queue vs Serial performance

I though it ll be interesting to look at threads and queues, so I ve written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I m still very new ...

Convert PHP encryption code to C#

I m trying to convert this piece of code from PHP to C#. It s part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = ...

Encryption: how to have 1 iv despite multiple fields

I ve been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I m encrypting an address and I ...