mirror of https://gogs.blitter.com/RLabs/xs
Comment re: AtE vs. EtA
This commit is contained in:
parent
5f42894ac2
commit
640e59be4f
13
xsnet/net.go
13
xsnet/net.go
|
@ -1501,6 +1501,19 @@ func (hc *Conn) WritePacket(b []byte, ctrlStatOp byte) (n int, err error) {
|
|||
log.Printf(" :>ptext:\r\n%s\r\n", hex.Dump(b[0:payloadLen]))
|
||||
}
|
||||
|
||||
// NOTE the code currently uses Authenticate-then-Encrypt, which in block modes
|
||||
// is insecure; however
|
||||
// 1) we are using exclusively XOR-stream modes with random padding,
|
||||
// 2) are padding randomly either before or after the real payload, and
|
||||
// 3) the padding side indicator value itself is part of the ciphertext
|
||||
// ... thus are not subject to oracle attacks of the type used on SSL
|
||||
// (see https://link.springer.com/content/pdf/10.1007%2F3-540-44647-8_19.pdf)
|
||||
//
|
||||
// Nevertheless, to address any future concerns this code may switch to
|
||||
// Encrypt-then-Auth and offer the current scheme as a legacy mode
|
||||
// (or just issue a breaking release since this is very pre-1.0.)
|
||||
// -rlm 2020-12-15
|
||||
|
||||
// Calculate hmac on payload
|
||||
hc.wm.Write(b[0:payloadLen])
|
||||
hmacOut = hc.wm.Sum(nil)[0:HMAC_CHK_SZ]
|
||||
|
|
Loading…
Reference in New Issue