如何通过iso10126padding和CBC模式加密AES 256中的NSDATA,需要像android的密码那样做。请帮助用AES256加密来做NSData的加密。需要加密AES256
-1
A
回答
0
转到这个问题,它会帮助你:AES Encryption for an NSString on the iPhone
或转到:https://github.com/RNCryptor/RNCryptor
在Objective-C
对象 -
//
// Encryption
//
NSString *password = @"Secret password";
RNEncryptor *encryptor = [[RNEncryptor alloc] initWithPassword:password];
NSMutableData *ciphertext = [NSMutableData new];
// ... Each time data comes in, update the encryptor and accumulate some ciphertext ...
[ciphertext appendData:[encryptor updateWithData:data]];
// ... When data is done, finish up ...
[ciphertext appendData:[encryptor finalData]];
//
// Decryption
//
RNDecryptor *decryptor = [[RNDecryptor alloc] initWithPassword:password];
NSMutableData *plaintext = [NSMutableData new];
// ... Each time data comes in, update the decryptor and accumulate some plaintext ...
NSError *error = nil;
NSData *partialPlaintext = [decryptor updateWithData:data error:&error];
if (error != nil) {
NSLog(@"FAILED DECRYPT: %@", error);
return;
}
[plaintext appendData:partialPlaintext];
// ... When data is done, finish up ...
NSError *error = nil;
NSData *partialPlaintext = [decryptor finalDataAndReturnError:&error];
if (error != nil) {
NSLog(@"FAILED DECRYPT: %@", error);
return;
}
[ciphertext appendData:partialPlaintext];
0
您可以设置属性为可变形并使用您自己的Transformer类来应用加密/解密。
这是一个指南,可转换的属性: enter link description here
+0
任何有用的代码Transformable属性,因为我需要iso10126填充和CBC模式,我认为comoncrpto doest没有相同的库。 – Abhimanyu
相关问题
- 1. C#/ Java | AES256加密/解密
- 2. 解密AES256加密字节
- 3. AES256加密/解密速度
- 4. 在java中AES256加密需要多少初始化向量?
- 5. 的NodeJS AES256加密是从网上AES256加密工具
- 6. AES256 JAVA加密不匹配,C#加密
- 7. AES256 iOS中的NSString加密
- 8. AES256加密用PHP rijndael_256 ECB_MODE
- 9. ASP25中的AES256加密和解密
- 10. linux aes256与cbc加密/解密库
- 11. 在PHP中加密和JS解密 - AES256
- 12. iOS AES256解密
- 13. AES256解密问题
- 14. Objective C AES256解密
- 15. AES256加密目标c执行
- 16. C#AES256加密使用System.Security.Cryptography.Aes示例
- 17. iPhone - 使用内置库的AES256加密
- 18. Objective-C中的Java AES256加密
- 19. 需要Arduino的加密库
- 20. xor加密帮助需要
- 21. 需要说明:加密
- 22. 需要RSA加密帮助
- 23. https上需要加密
- 24. iOS加密/解密需要指导
- 25. node.js:加密需要解密的数据?
- 26. 使用初始化向量解密AES256-rijdeal加密文件
- 27. 如何在PHP中解密iPhone加密的AES256文本
- 28. 的NodeJS加密密码AES256最大数据大小
- 29. 在Matlab中使用AES256加密/解密图像
- 30. C#服务器与java/c#客户端,aes256加密和解密
显示一些代码,你也尝试了什么,你在哪里得到的问题 – 2016-04-29 10:12:22