Re:“Should you encrypt or compress first?”
by lisper on Tuesday June 28, 2016 @12:29PM
(#11995109)
Why would you use a stream cipher to encrypt a document?
[ Parent
| on HN ]
In GCM, the 'C' is for counter, and hence turning AES into a stream cipher. This part is usually known as 'AES-CTR'. The 'G' is Galois for 'Galois field multiplication', which allows for a parallelizable way of computing a MAC. AES-GCM packages AES-CTR (a stream cipher made from a block cipher) and GMAC (the Galois MAC) together into a primitive. This type of scheme, which combines confidentiality, integrity, and authenticity is called 'authenticated encryption with associated data' (AEAD) [1]. A stream cipher is the easiest way of accomplishing that the cipherstream will safely expand to cover all the plaintext.
Other famous AEAD schemes are:
- CCM (Counter with CBC-MAC), packages AES-CTR and CBC-MAC together in an authenticate-then-encrypt regime
- ChaCha20-Poly1305, which packages together the stream cipher ChaCha20 and the MAC Poly1305.
The AES-GCM mode of operation turns the AES block cipher into a stream cipher. Doing this makes it possible to add authentication on top for relatively cheap. The ChaCha20-poly1305 has a similar construction. These are the two most secure and efficient ciphers available in TLS, so they get a lot of use. If you are sending documents over HTTPS, you definitely want them encrypted with one of these two.
Fair enough, I concede the point.
Re:“Should you encrypt or compress first?”
by StavrosK on Tuesday June 28, 2016 @01:21PM
(#11995590)
Why wouldn't you?
http://security.stackexchange.com/questions/334/advantages-a...
Not that this really matters. The advantages/disadvantages of compression are the same in both cases.