Skip to content

Message encryption for Memberlist hardcoded to AES-128 #1982

Closed

Description

@rranjan3

Hashicorp Memberlist supports AES-128, AES-192 and AES-256 for message encryption. This can be found here - https://github.com/hashicorp/memberlist/blob/v0.5.0/config.go#L187.

A review of codebase suggests, hardcoding this to AES-128 only. This is essentially controlled by the size of the secret being used. For the latest code it can be observed that the size is 16.

		sha := sha256.New()
		mconfig.SecretKey = sha.Sum([]byte(secret))[:16]

Is this choice on purpose ? Can this be made configurable so that the choice of symmetric encryption algorithm can be made ? AES-192 & AES-256 might be a better option if given a choice.

Activity

  1. fedepaol commented on Jul 10, 2023

    @fedepaol
    Member

    Yes, this sounds doable or we can even default to the larger size.

  2. AzraelSec commented on Oct 9, 2023

    @AzraelSec
    Contributor

    Hi @fedepaol 👋🏻 If it works for you, I'd like to pick this up.

    Yes, this sounds doable or we can even default to the larger size.

    Do you prefer me to just hard-code the key length to the longer available value, or would you also like a customizable value? Thanks!

  3. fedepaol commented on Oct 9, 2023

    @fedepaol
    Member

    I don't see much value in making it configurable, just go for the longer

  4. fedepaol commented on Oct 24, 2023

    @fedepaol
    Member

    @AzraelSec are you still interested in working on this?

  5. AzraelSec commented on Oct 24, 2023

    @AzraelSec
    Contributor

    Yes, @fedepaol, I am. Sorry for the long delay - I picked this up at the wrong moment. Is it acceptable for you to assign this issue to me for two days more? I should be able to work on this today/tomorrow. If I can't, I'll ping you asap so you can unassign it.

  6. fedepaol commented on Oct 24, 2023

    @fedepaol
    Member

    No rush! I was just checking :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions