Re: I need some feedback
Re: I need some feedback
- Subject: Re: I need some feedback
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Thu, 17 Jan 2019 08:26:21 +0000
On 16 Jan 2019, at 20:32, Howard Shere <email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden