加密/解密.plist文件ios [英] Encrypt/decrypt .plist file ios
问题描述
任何帮助将非常感谢
由howanghk提供的链接包含有错误的代码。在该网页上应用由InoriXu提供的修复以解决问题。您必须修改加密和解密功能。
所以在一行之后:
const char * password = [pass UTF8String];
add:
code> const int passwordLen = [pass length];
更改行:
key [i] = password!= 0? *密码++:0;
into:
code> key [i] = i< passwordLen!= 0? *密码++:0;
代码本身仍然添加了一些空格填充,但如果需要加密属性列表,你会很好。
i have a plist with some stored data and want to encrypt decrypt so it's not readable using objective c. i've read about AES encryption etc but i want the whole plist to be encrypted some how not the strings in the plist....
any help will be really appreciated.
The link provided by howanghk contains code with a bug. Apply fix provided by InoriXu on that webpage to resolve the issue. You have to modify both encrypt and decrypt functions.
So after a line:
const char *password = [pass UTF8String];
add:
const int passwordLen = [pass length];
And change line:
key[i] = password != 0 ? *password++ : 0;
into:
key[i] = i < passwordLen != 0 ? *password++ : 0;
The code itself still adds some space padding behind, but if you need it to encrypt a property list, you'll be fine.
这篇关于加密/解密.plist文件ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!