简体   繁体   English

如何加密目标c中的数据并使用终端在mac中解密

[英]How to encrypt data in objective c and decrypt in mac using terminal

I am trying to encrypt the file using RnCryptor in objective and decrypting it in mac using following command in terminal 我试图在目标中使用RnCryptor加密文件,并使用终端中的以下命令在mac中解密它

Encryption code in objective c 目标c中的加密代码

NSData *encryptedData =[RNEncryptor encryptData:fileData withSettings:kRNCryptorAES256Settings password:aPassword error:&error];

Terminal command for mac mac的终端命令

openssl enc -aes-256-cbc -d -in /Users/Desktop/Log.txt  -out  /Users/Desktop/Log1.txt

but end in error bad magic number. 但最终错误的魔法数字结束。

RNCryptor and OpenSSL have different formats. RNCryptor和OpenSSL有不同的格式。 There is a very simple command-line version of RNCryptor in the RNCryptor-objc repository . RNCryptor-objc存储库中有一个非常简单的RNCryptor命令行版本。 I don't believe anyone has written a full-featured command-line client. 我不相信任何人编写了一个功能齐全的命令行客户端。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM