Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multicodec for aes-gcm #314

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

guillaumemichel
Copy link
Contributor

Adding aes-gcm-256 multicodec. Please edit if the category encryption doesn't fit here.

aes-gcm-256 is a payload format: the 12-byte Initialization Vector (IV) is concatenated with a payload encrypted using AES in Galois/Counter Mode, using a 256-bit key and the 12 byte IV.

This multicodec is required for the Double Hash DHT ipfs/specs#373

Adding aes-gcm-256 multicodec with category encryption.
Copy link
Member

@vmx vmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable to me. I've had a brief look at the corresponding section in the Double Hash DHT spec. Please note that the encoded value won't be 0xa5, but the varint of it: 0xa501.

Though I'd like to get input from others as this introduces a new category.

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this opens the door to a massive number of permutations, all under the same "encryption" category, I think this should go later in the table where there is a sizeable chunk of free space.

Otherwise I don't mind a new category .. there's just a lot of them and I can imagine the inevitable PR with someone adding all the possible permutations ..

code                         varint
8192 (0x2000)   => 10000000 01000000 (0x8040)
@guillaumemichel
Copy link
Contributor Author

Moved aes-gcm-256 to 0x2000

code               varint
8192 (0x2000)   => 10000000 01000000 (0x8040)

Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👌

@rvagg rvagg merged commit 47ba6fd into multiformats:master Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants