Skip to content

Bind Keys to Version and Purpose #11

@paragonie-security

Description

@paragonie-security

public static byte[] Encrypt(byte[] payload, byte[] macBytes, byte[] symmetricKey, byte[] additionalData) =>
SecretAead.Encrypt(payload, macBytes, symmetricKey, additionalData, useXChaCha: true);
public static byte[] Decrypt(byte[] payload, byte[] nonceBytes, byte[] symmetricKey, byte[] additionalData) =>
SecretAead.Decrypt(payload, nonceBytes, symmetricKey, additionalData, useXChaCha: true);

See https://github.com/paseto-standard/paseto-spec/blob/master/docs/02-Implementation-Guide/03-Algorithm-Lucidity.md

Right now, byte arrays are accepted by this API. There's no mechanism to prevent a user from using a v2 public key as a v2 local key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions