Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

356
Visualizações
How can I improve the Performance (response time) for the AWS Encryption SDK on decrypt

I have an AWS Lambda that is used to encrypt PII (Personal Identifying Information) using the AWS Encryption SDK before storing it in DynamoDB.

When retrieving the data from DynamoDB using a different Lambda to display to end users, the average time for each call to KMS is 9.48sec. This is averaged across roughly 2k requests with requests ranging from ~14.5 seconds to ~5.1 seconds. The calls to KMS are being made asynchronously.

The total time from the first KMS call to the last is ~20 seconds

We have considered using data key caching and read this AWS blog post about when to use it.

The input of our data may not be frequent enough to take full advantage of caching, and I am trying to find other ways to improve the performance.

Decrypt Code Sippet:

async function decryptWithKeyring(keyring: KmsKeyringNode, ciphertext: string, context: {}) {
    const b: Buffer = Buffer.from(ciphertext, 'base64');
    const { plaintext, messageHeader } = await decrypt(keyring, b);
    const { encryptionContext } = messageHeader;
    Object.entries(context).forEach(([key, value]) => {
        if (encryptionContext[key] !== value) {
            throw new Error('Encryption Context does not match expected values');
        }
    });
    return plaintext.toString();
}

Encrypt Snippet:

async function encryptWithKeyring(keyring: KmsKeyringNode, value: any, context: any) {
    const { result } = await encrypt(keyring, value, { encryptionContext: context });
    return result.toString('base64');
}

The conversion to base64 was to facilitate storing in DynamoDB.

XRay Trace Map Sampling of KMS Trace data

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda