[Python-Dev] Parametrized codecs
Gordon McMillan
gmcm@hypernet.com
Tue, 18 Sep 2001 16:31:31 -0400
Andrew wrote:
> Are there any codecs that can take parameters at initialization
> time? If not, how about supporting them? Here's a motivating
> example:
>
> import codecs
> f = codecs.open('output', 'wb', encoding='DES', # arguments to
> open()
> key = '...', mode = DES.ECB)
> f.write('This will be encrypted\n')
> f.close()
RC4, maybe. But I think you're asking for trouble in trying to
pretend a block-mode cipher is a stream.
- Gordon