Giter Site home page Giter Site logo

petejoybaker / ssh-chacha20-poly1305-drafts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rus-cert/ssh-chacha20-poly1305-drafts

0.0 1.0 0.0 27 KB

chacha20-poly1305 encryption algorithm drafts

Home Page: https://rus-cert.github.io/ssh-chacha20-poly1305-drafts/

Makefile 0.58% HTML 99.42%

ssh-chacha20-poly1305-drafts's Introduction

layout title
page
chacha20-poly1305 encryption algorithm drafts

Drafts

Motivation

When I first started implementing "[email protected]" I was greatly disappointed by the qualitify of the documentation.

Finding the draft "draft-josefsson-ssh-chacha20-poly1305-openssh-00" I hoped for some improvements, but it sadly is just the same document as present in openssh-portable.

I read some of the discussions following the draft announce, and found the following design questions:

  • Whether to use the Poly1305 data construction from RFC7539:

    At first I thought the Poly1305 usage in "[email protected]" is vulnerable to some length modifications; but then I remembered that Poly1305 uses an explicit termination in the padding.

    As the length of the AAD is fixed I see no security gain changing to the method described in RFC7539.

  • Whether it is necesary to encrypt the packet length field:

    Some voiced a strong preference for this as a requirement to prevent traffic analysis.

    It was pointed out the encrypted could lead to some extra attack surface (or has done so in other protocols in the past), but I think it is safe in the context of Chacha20. I see nothing an attacker could gain here.

  • Encrypting the packet length using otherwise discarded bytes from the Chacha20 block used for the Poly1305 key:

    It is a nice idea which can be used to optimize both performance and memory usage.

  • Binary packet protocol rethink:

    This is certainly worth exploring, but I don't think this needs to be completed before "chacha20-poly1305" becomes official.

    I think a new family of algorithms could be started with a different binary packet protocol, or even a new SSH protocol version.

    (My idea for a new protocol: separate encryption framing and inner message framing. No need to hide the outer packet length anymore.)

  • Changing padding requirements, authentication of the encrypted length:

    I see no need to change this in the context of a single algorithm. Belongs into a more generic protocol redesign.

Changing the binary packet protocol probably requires rewriting core logic in many SSH implementations, so this should be done very carefully and not just for one cipher.

Until this happens I propose defining "chacha20-poly1305" as either the existing "[email protected]" or as a slightly modified variant:

  • using the RFC7539 Poly1305 data construction
  • using the Chacha20 variant from RFC7539
  • encrypt the packet length with otherwise discarded bytes from the first Chacha20 block, i.e. only a single Chacha20 instance
  • pad the nonce to 12 bytes with zeroes on the left side, so one can simply reuse the original Poly1305 implementation with a 8-byte nonce.
  • openssh patch

ssh-chacha20-poly1305-drafts's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.