[Cryptography-dev] Create Fernet API allowing streaming encryption and decryption from file-like objects.

Michael Iverson dr.michael.iverson at gmail.com
Mon Jan 19 17:30:44 CET 2015


On Mon, Jan 19, 2015 at 10:47 AM, Jean-Paul Calderone <
jean-paul at clusterhq.com> wrote:

>
> A file-like interface is not particularly well-suited for asynchronous
> operation.  Have you looked into whether Tornado and Cyclone would
> actually be able to use such an interface?
>
>
I don't see an immediate reason why it could not. I could be wrong on this
point, however.

For example, here is an excerpt from a simple twisted protocol I wrote. The
protocol spawns an external process, and reads data from stdout.
The class has a attribute 'request', which is the file handle generating
the HTTP response.

For each chunk of data it reads, it (asynchronously) calls

    def outReceived(self, data):
        self.request.write(data)
        self.request.flush()

Most of the asynchronous behavior involves waiting for IO or network
responses, and processing chunks (or entire responses) when available. This
seems to fit this proposal well.


> And it would certainly be bad if this were the *only* interface
> Cryptography provided to certain functionality (which, fortunately,
> isn't what you're suggesting, I think).
>

That is definitely not what I'm suggesting. Just an alternate interface for
a specific option.


>
> Jean-Paul
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
>



-- 
Dr. Michael Iverson
Director of Information Technology
Hatteras Printing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20150119/4f842209/attachment.html>


More information about the Cryptography-dev mailing list