使用objective-c加密和解密密码 [英] Encrypt and Decrypt password using objective-c
问题描述
如何加密 nsstring 并将其存储在文件中,以及如何解密.
How to encrypt a nsstring and store it in a file, and how to decrypt the same.
请建议我使用 wat api 的...
Please suggest me wat api's i shld use...
推荐答案
这是我用来加密的函数.
This is the function i used for encryptiong.
DES_cfb64_encrypt( ( unsigned char * ) pchInputData, ( unsigned char * ) pchOutCipher,大小,&schedule,&ParityKey,&no,DES_ENCRYPT);
DES_cfb64_encrypt( ( unsigned char * ) pchInputData, ( unsigned char * ) pchOutCipher, size, &schedule, &ParityKey, &no, DES_ENCRYPT );
我必须将其转换为 base64,以便我可以将其存储在文件中.
pstrResult = Base64encoding(size,( unsigned char * )pchOutCipher);
I had to convert this to base64 so that i can store it in a file.
pstrResult = Base64encoding(size,( unsigned char * )pchOutCipher);
这篇关于使用objective-c加密和解密密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!