Tag: rcryptor

在iOS上使用RNCryptorasynchronous解密大文件

我需要iOS上的RNCryptorasynchronous解密大文件(以显示进度条)。 我没有发现任何地方的例子,因此已经尝试了我所猜测的是正确的,但是…我得到的东西不起作用:解密程序的处理程序不会被调用,并且线程在发送所有数据后与EXC_BAD_ADDRESS一起崩溃在函数的结尾。 NSOutputStream *decryptedStream = [NSOutputStream outputStreamToFileAtPath:decryptedPath append:NO]; [decryptedStream open]; NSUInteger totalBytesToRead = [[[NSFileManager defaultManager] attributesOfItemAtPath:tempPath error:nil] fileSize]; __block NSUInteger totalBytesRead = 0; LOG("I've got %d bytes to decrypt.", totalBytesToRead); RNDecryptor *decryptor = [[RNDecryptor alloc] initWithPassword:SNCatalogPassword handler:^(RNCryptor *cryptor, NSData *data) { totalBytesRead += data.length; [decryptedStream write:data.bytes maxLength:data.length]; LOG("Decrypted %d bytes : %d / %d bytes […]

导入RNCryptor后,架构armv7的未定义符号

我导入RNCryptor,可以在这里find: https : //github.com/rnapier/RNCryptor到我的应用程序。 不过,我在日志中收到了三个错误。 Undefined symbols for architecture armv7: "_SecRandomCopyBytes", referenced from: +[RNCryptor randomDataOfLength:] in RNCryptor.o "_kSecRandomDefault", referenced from: +[RNCryptor randomDataOfLength:] in RNCryptor.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) 我看到,这通常是导入的类不包含在目标中,但我已经检查了构build阶段,所有导入的类都在那里。 我不知道是什么原因造成的,我没有触及任何这些类的代码。 我也清理了几次目标。

在iOS上使用RNCryptorencryption/解密大文件时存在内存问题

我正在尝试使用RNCryptor在iOS上encryption和解密大文件(600 + MB)。 在github上,我find了关于如何在stream上asynchronous使用库的示例代码。 这个代码类似于Rob Napier在关于这个相同主题的问题上的答案。 不过,尽pipe我认为我正确实施了代码,但是应用程序使用了高达1.5 GB的内存(在iPad 6.1模拟器中)。 我认为代码应该防止应用程序保持在内存中的多个数据块? 那么是怎么回事? 在我的控制器中,我创build了一个encryption/解密请求消息的CryptController。 // Controller.m NSString *password = @"pw123"; self.cryptor = [[CryptController alloc] initWithPassword:password]; //start encrypting file [self.cryptor streamEncryptRequest:self.fileName andExtension:@"pdf" withURL:[self samplesURL]]; //wait for encryption to finish NSDate *timeout = [NSDate dateWithTimeIntervalSinceNow:1]; do { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:timeout]; } while (![self.cryptor isFinished]); 在CryptController中我有: – (void)streamEncryptionDidFinish { […]