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

Bind Keys to Version and Purpose #11

Open
paragonie-security opened this issue Aug 5, 2021 · 0 comments
Open

Bind Keys to Version and Purpose #11

paragonie-security opened this issue Aug 5, 2021 · 0 comments

Comments

@paragonie-security
Copy link

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.

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

1 participant