[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [design question] Symmetric cipher interface.
- From: Nagaev Boris <bnagaev@...>
- Date: Thu, 17 Aug 2017 19:56:03 -0400
On Thu, Aug 17, 2017 at 1:59 PM, Sean Conner <firstname.lastname@example.org> wrote:
> It was thus said that the Great Martin once stated:
>> In continuation of Dirk's Laurie proposal for standard interface for
>> common things...
>> How do you see generic interface for symmetric encryption/decryption?
>> Usually you can process input stream by parts (in case you wish to
>> encrypt 50GiB file which unlikely fit into string). Do you prefer
>> some functions encrypt()/decrypt() which returns output and inner
>> state, or object that holds inner state itself?
> I prefer an object that holds inner state. Tht way, I can have several
> streams of input/output being encrypted/decrypted (say for a network
I like the way the symmetric cryptography primitives are abstracted in Go:
Block cipher: https://golang.org/pkg/crypto/cipher/#Block
Authenticated encryption with associated data: