Support custom auth tag length

Issue #313 wontfix
Andrew Berlin created an issue

Currently A256GCM encryption method produces only 128-bit auth tags.

It would be nice to have a possibility to customise its length.

Comments (3)

  1. Vladimir Dzhuvinov

    Are you aware that this would then no longer classify as A256GSM as specified in the JWA RFC?

    https://tools.ietf.org/html/rfc7518#section-5.3

    The requested size of the Authentication Tag output MUST be 128 bits,
    regardless of the key size.
    

    And 128 bits is the longest value taken from the NIST spec:

    https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf

    The bit length of the tag, denoted t, is a security parameter, as discussed in Appendix B. In general, t may be any one of the following five values: 128, 120, 112, 104, or 96.

  2. Vladimir Dzhuvinov

    Customising the A256GSM auth tag length is against the spec.

    If there's real need for that create a custom enc identifier and content encryption method.

  3. Log in to comment