On 16 Jan 2019, at 20:32, Howard Shere <howard.sh...@synchronoss.com> wrote:

> We can’t entirely stream from the files because we need to encrypt the data.

Hmmmm.  I have various points on that front:

* The networking APIs don’t generally support a “send this file to this 
connection” primitive, so you have to read the file and write it to the 
connection using the CPU.  While doing that you can apply your encryption.

* Encryption on modern CPUs is pretty darned fast, so I don’t think that will 
slow you down significantly.

* Assuming you’re using an Apple API for that (like CommonCrypto, as mentioned 
by Yarshure).

* After profiling you may want to introduce some buffering system to pipeline 
the read, the crypto, and the write.  If you do that, make sure you limit the 
size of that buffer.

Finally, a question: Is there a reason you’re doing your own encryption rather 
than using TLS?  Creating your own on-the-wire crypto is very tricky, and it’s 
something best left to the experts.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to