Skip to content

Add new operations: AES Key Wrap/Unwrap With Padding #2053

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aosterhage
Copy link

The Advanced Encryption Standard (AES) Key Wrap with Padding Algorithm is defined in RFC 5649. It utilizes the key wrapping algorithm defined in RFC 3394 but enables the "key" being wrapped to be of any length.

cipher.finish();
output = cipher.output.getBytes();
} else {
// Otherwise, follow the wrapping process from RFC 3394 (AESKeyWrap operation).
Copy link
Author

Choose a reason for hiding this comment

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

Is there a mechanism to programmatically call another operation? That would be preferable to the copy/paste that has been done here (since this is just the "AES Key Wrap" operation).

For anyone not familiar with RFC 5649, it does not make sense to try to force this operation to only handle padding for two reasons:

  1. It contains a special wrapping case when the padded input is exactly 8 octets (that does not adhere to RFC3394).
  2. The padding operations would need to pass multiple values (both the padded plaintext as well as the AIV) between the AES Key Wrap/Unwrap operations when chained together.

Copy link
Author

Choose a reason for hiding this comment

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

Is there a mechanism to programmatically call another operation?

If that doesn't exist, I suppose an appropriate thing to do is to move the RFC 3394 algorithm into a shared utility.

Copy link
Author

Choose a reason for hiding this comment

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

If that doesn't exist, I suppose an appropriate thing to do is to move the RFC 3394 algorithm into a shared utility.

This is now done.

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.

1 participant