Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 我能用加密箱密封打开来解密我自己的信息吗?_Objective C_Libsodium - Fatal编程技术网

Objective c 我能用加密箱密封打开来解密我自己的信息吗?

Objective c 我能用加密箱密封打开来解密我自己的信息吗?,objective-c,libsodium,Objective C,Libsodium,我用加密箱密封通过别人的公钥加密了一封邮件。接收者可以使用他们自己的密钥对解密,而不会有任何问题 if(crypto_box_seal_open(decryptedMessage, [ciphertextDataDerived mutableBytes], [ciphertextDataDerived length], [pubkey bytes], [privkey bytes]) != 0){ NSLog(@"Oops! Error on decryption"); } else {

我用加密箱密封通过别人的公钥加密了一封邮件。接收者可以使用他们自己的密钥对解密,而不会有任何问题

if(crypto_box_seal_open(decryptedMessage, [ciphertextDataDerived mutableBytes], [ciphertextDataDerived length], [pubkey bytes], [privkey bytes]) != 0){
   NSLog(@"Oops! Error on decryption");
} else {
   NSUInteger sizeDecrypted = sizeof(decryptedMessage);
   NSData* dataDecrypted = [NSData dataWithBytes:(const void *)decryptedMessage length:sizeof(unsigned char)*sizeDecrypted];
   NSString *decryptedString = [[NSString alloc] initWithData:dataDecrypted encoding:NSUTF8StringEncoding];
   NSLog(@"Decrypted Message: %@", decryptedString);
}
但是也可以解密我自己的信息吗。如果是,怎么做?
我曾尝试用我自己的公钥和私钥解密,但都失败了。

如果实际上可以用收件人私钥以外的任何东西解密邮件,这将表明整个星球的软件安全基本上是无效的。 因此,不,除非收件人向您披露其私钥,否则无法解密您的原始邮件,当然,他们永远不应该这样做