calvinmetcalf / chacha20poly1305

chacha20/poly1305 with the node api
40 stars 7 forks source link

question: is poly1305 authenticated mid stream? #5

Open dominictarr opened 9 years ago

dominictarr commented 9 years ago

If this is used to encrypt a stream, will I know if authentication fails part way, or do I have to get to the end of the stream to know that?

i.e. If I want realtime authenticated encryption of a long running stream, do I have to encrypt separate messages instead?

calvinmetcalf commented 9 years ago

end of the stream, I wrote https://github.com/calvinmetcalf/hmac-stream for this exact use case, or you could use tls with aes-gcm which would do similar things as well