question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQ] Provide an implementation of 'AsyncKeyEncryptionKey' that uses a local symmetric key

See original GitHub issue

Is your feature request related to a problem? Please describe. With version 8 of the storage SDK, we are using SymmetricKey for client-side encryption of Azure storage blobs. This implementation performs encryption locally on the machine and accepts an in-memory encryption key. The new version 12 of the storage SDK (azure-storage-blob-cryptography) uses a new interface AsyncKeyEncryptionKey for the encryption key and I couldn’t find an implementation of it like the SymmetricKey class. There is one implementation that Rick from storage sdk team pointed me to KeyEncryptionKeyClient but it requires the encryption key to be present in key vault. More details in this query - #6536.

Describe the solution you’d like An implementation of AsyncKeyEncryptionKey that mimics the functionality provided by SymmetricKey.

Describe alternatives you’ve considered No other alternatives have been considered yet.

Additional context NA

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
g2vinaycommented, Apr 16, 2020

@SukruthKS The April beta release contains the features:

  1. Set custom key ids.
  2. No requirement for credentials for local keys. Package link: https://search.maven.org/artifact/com.azure/azure-security-keyvault-keys/4.2.0-beta.3/jar

Here is the code sample that you can use:

JsonWebKey localKey = JsonWebKey.fromAes(new SecretKeySpec(encryptionKeyBytes, "AES"), Arrays.asList(KeyOperation.WRAP_KEY, KeyOperation.UNWRAP_KEY))
                    .setId("my-id");
AsyncKeyEncryptionKey akek = new LocalKeyEncryptionKeyClientBuilder()
                                                 .buildAsyncKeyEncryptionKey(localKey).block();
1reaction
g2vinaycommented, Feb 17, 2020

@SukruthKS The Febburay KV-keys release, supports this feature. Here is the package link: https://search.maven.org/artifact/com.azure/azure-security-keyvault-keys/4.2.0-beta.1/jar

Sample Code to build AsyncKeyEncryptionKey using local symmetric key: JsonWebKey localKey = JsonWebKey.fromAes(new SecretKeySpec(localSymmeticKeyBytes, “AES”), Arrays.asList(KeyOperation.WRAP_KEY, KeyOperation.UNWRAP_KEY)); KeyVaultKey kvKey = KeyVaultKey.fromName(“localSymmeticKey”, localKey);

AsyncKeyEncryptionKey akek = new KeyEncryptionKeyClientBuilder() .credential(credentialReal) .buildAsyncKeyEncryptionKey(kvKey).block();

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symmetric Key Encryption - why, where and how it's used in ...
Symmetric encryption is a type of encryption where only one key (a secret key) is used to both encrypt and decrypt electronic data....
Read more >
Client-side encryption for blobs - Azure Storage | Microsoft Learn
The Blob Storage client library supports client-side encryption and integration with Azure Key Vault for users requiring encryption on the client.
Read more >
When to Use Symmetric Encryption vs Asymmetric ... - Keyfactor
Asymmetric cryptography typically gets used when increased security is the priority over speed and when identity verification is required, as ...
Read more >
GenerateDataKey - AWS Key Management Service
Returns a unique symmetric data key for use outside of AWS KMS. ... that you use the following pattern to encrypt data locally...
Read more >
Symmetric Key Management Requirements v2_1.pdf
This section provides implementation requirements for the use of PSKs within CSfC solutions. 2.1 OVERVIEW OF PRE-SHARED KEYS (PSKS) IN CSFC ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found