RNCryptor-objc and openssl

143 views
Skip to first unread message

LisaL

unread,
Jan 21, 2017, 5:23:14 PM1/21/17
to rncryptor
Hi

I realise that openssl is not especially secure, but for various reasons we want to encrypt a file using openssl and decrypt it using RNCryptor. We need to use RNCryptor-objc, not the Swift version. XCode 8.2, Mac OS X Sierra.

Is openssl decryption still supported in RNCryptor-objc?   Encrypting from the command line with 'openssl aes-256-cbc -in infield.txt -out outfield.enc -k Passw0rd' and then decrypting with 

         fileData = [RNDecryptor decryptData:[NSData dataWithContentsOfFile:path] withPassword:aPassword error:&error];

        

or

        

        fileData = [RNDecryptor decryptData:[NSData dataWithContentsOfFile:path] withSettings:kRNCryptorAES256Settings password:aPassword error:&error];



(correct password is in aPassword, correct paths are set etc).   returns  Error Domain=net.robnapier.RNCryptManager Code=2 "Unknown header" 



We have looked at RNOpenSSLCryptor but this doesn't compile - again I understand it is 'not recommended and no longer supported', but does anyone have suggestions on getting it working? Does it need to be integrated with an existing RNCryptor?


Thanks


Lisa

Rob Napier

unread,
Jan 21, 2017, 5:37:34 PM1/21/17
to rncr...@googlegroups.com
The openssl format is no longer supported by RNCryptor. I removed the code for it and placed it in RNOpenSSLCryptor, but haven't continued to support it. You would need to re-integrate it. In principle it should still drop into the RNCryptor-objc repository and work, though I haven't looked at it in a couple of years. Also, if could try just reverting the relevant commit (63864c0), or going back to the previous version (95d18db). I don't believe there have been any changes since then that would impact the openssl code (and very few code changes of any kind).

If you run into significant issues, or have other encryption related issues, I'm happy to help on a consulting basis. Please email me and we can discuss your project and rates. 

Best of luck,
-Rob



--
You received this message because you are subscribed to the Google Groups "rncryptor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rncryptor+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/rncryptor.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages