Navdeep
Navdeep

Reputation: 11

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

Encryption code in objective c

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

Terminal command for mac

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

but end in error bad magic number.

Upvotes: 1

Views: 427

Answers (1)

Rob Napier
Rob Napier

Reputation: 299345

RNCryptor and OpenSSL have different formats. There is a very simple command-line version of RNCryptor in the RNCryptor-objc repository. I don't believe anyone has written a full-featured command-line client.

Upvotes: 1

Related Questions