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

Extend engine to AES symmetric key encryption / decryption #23

Open
ZacharyEspiritu opened this issue Jun 18, 2020 · 0 comments
Open

Extend engine to AES symmetric key encryption / decryption #23

ZacharyEspiritu opened this issue Jun 18, 2020 · 0 comments
Labels
layer: backing Involves changes to backend layer layer: bridge Involves changes to frontend layer

Comments

@ZacharyEspiritu
Copy link
Collaborator

ZacharyEspiritu commented Jun 18, 2020

Copied from #24:

We can extend the engine to Cloud KMS keys that have key purposes of types ENCRYPT_DECRYPT (i.e. AES) and ASYMMETRIC_DECRYPT (i.e. RSA encryption). Currently, the backing layer is algorithm-agnostic and so most of the backing layer structure should be immediately reusable. The bulk of the work involved would be:

  • Add the requisite Cloud KMS API calls to the GrpcClient implementation (for example, AsymmetricDecrypt for ASYMMETRIC_DECRYPT keys; Encrypt and Decrypt for ENCRYPT_DECRYPT keys).
  • Expose those API calls to the bridge layer by adding them to the CryptoKeyHandle implementation.
  • In the bridge layer, write OpenSSL callbacks for AES / RSA implementations that call the corresponding API methods exposed in CryptoKeyHandle.
  • For ENCRYPT_DECRYPT keys, add AES functionality to the key loader in the bridge layer. (At the time of writing, all ASYMMETRIC_DECRYPT keys are RSA keys, so those keys should be able to reuse the existing RSA key loader code.)

The engine could also support key generation OpenSSL APIs. For example, the engine currently defines the callback for RSA_meth_set_keygen as a null pointer (since it is unimplemented), but in the future this could be defined to make Cloud KMS API calls to create private keys on the fly.

@ZacharyEspiritu ZacharyEspiritu added layer: bridge Involves changes to frontend layer layer: backing Involves changes to backend layer labels Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
layer: backing Involves changes to backend layer layer: bridge Involves changes to frontend layer
Projects
None yet
Development

No branches or pull requests

1 participant