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

Jean-Paul Calderone jean-paul at clusterhq.com
Mon Jan 19 16:47:13 CET 2015


Michael Iverson <dr.michael.iverson at gmail.com> writes:

> Hello,
>
> [snip]
>
> Furthermore, many python libraries use file handles as an abstraction for
> incrementally consuming or producing data.  Examples include http responses
> in Tornado and Cyclone, and the SFTP interface in paramiko.
>
> I'd like to propose the addition of an alternate API that would accept and
> return file handles, and incrementally encrypt or decrypt using the
> handles. I think this would make the library more useful for a variety of
> solutions, enhancing adoption.
>

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?

This is not to say such an interface shouldn't be introduced - but if
two out of three of the potentially users can't actually use it, it
might not be as widely applicable as you guessed.

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).

Jean-Paul


More information about the Cryptography-dev mailing list