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

ASN.1 module #348

Open
tarcieri opened this issue May 9, 2022 · 2 comments
Open

ASN.1 module #348

tarcieri opened this issue May 9, 2022 · 2 comments

Comments

@tarcieri
Copy link

tarcieri commented May 9, 2022

RFC9106 provides the foundational work for eventually using Argon2 for e.g. PKCS#5. However, what's missing is an ASN.1 module to do so.

There's such a module specified for scrypt in RFC7914 Section 7.

Using that as inspiration, an Argon2 ASN.1 module might look something like this:

argon2-params ::= SEQUENCE {
    version INTEGER, -- 16 or 19
    salt OCTET STRING,
    memorySize INTEGER (1..MAX),
    iterations INTEGER (1..MAX),
    parallelization INTEGER (1..MAX),
    keyId OCTET STRING OPTIONAL,
    data OCTET STRING OPTIONAL,
}

Argon2d, Argon2i, and Argon2id could potentially be selected by assigning them different OIDs.

@ljluestc
Copy link

ljluestc commented Jan 2, 2024


-- Define Argon2 OID values for different modes (example values)
argon2d OID ::= { 1 2 3 4 1 }
argon2i OID ::= { 1 2 3 4 2 }
argon2id OID ::= { 1 2 3 4 3 }

-- Define the Argon2 parameters structure
Argon2Params ::= SEQUENCE {
    version INTEGER { v16(16), v19(19) },
    salt OCTET STRING,
    memorySize INTEGER (1..MAX),
    iterations INTEGER (1..MAX),
    parallelization INTEGER (1..MAX),
    keyId OCTET STRING OPTIONAL,
    data OCTET STRING OPTIONAL
}

@tarcieri
Copy link
Author

tarcieri commented Jan 3, 2024

FYI, I made a repo to collaborate on this here a few years ago: https://github.com/P-H-C/argon2-asn1

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

No branches or pull requests

2 participants