
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@aws-crypto/example-node
Advanced tools
The AWS Encryption SDK for JavaScript is a client-side encryption library designed to make it easy for everyone to encrypt and decrypt data using industry standards and best practices. It uses a data format compatible with the AWS Encryption SDKs in other languages. For more information on the AWS Encryption SDKs in all languages, see the Developer Guide.
The CMKs in these examples are only for example. Replace these CMKs with your own.
This repository includes examples for encrypting and decrypting in Node.js. These are not for production use.
This is a simple example of using a KMS keyring to encrypt and decrypt using the AWS Encryption SDK for Javascript in Node.js. For more information, see kms_simple.ts.
This is an example of using a KMS keyring to encrypt and decrypt a file stream. For a more detailed explanation, see kms_stream.ts.
This is an example of using a KMS Regional Discovery Keyring that limits the AWS Encryption SDK to CMKs in a particular AWS Region(s). This is different from a KMS Discovery Keyring that doesn't specify any CMKs and will therefore use CMKs from any region available. For a more detailed explanation, see kms_regional_discovery.ts.
This is an example of using a RSA key pair to encrypt and decrypt a simple string. This has some advantages for certain use cases, but we recommend that you use a keyring that protects your wrapping keys and performs cryptographic operations within a secure boundary. The KMS keyring uses AWS Key Management Service (AWS KMS) customer master keys (CMKs) that never leave AWS KMS unencrypted. For a more detailed explanation, see rsa_simple.ts.
This is an example of using a shared secret to encrypt and decrypt a simple string. This has some advantages for certain use cases, but we recommend that you use a keyring that protects your wrapping keys and performs cryptographic operations within a secure boundary. The KMS keyring uses AWS Key Management Service (AWS KMS) customer master keys (CMKs) that never leave AWS KMS unencrypted. For a more detailed explanation, see aes_simple.ts.
This is a simple example of combining an KMS keyring and a raw AES keyring to encrypt and decrypt using the AWS Encryption SDK for Javascript in Node.js This has some advantages for certain use cases, but we recommend that you use a keyring that protects your wrapping keys and performs cryptographic operations within a secure boundary. The KMS keyring uses AWS Key Management Service (AWS KMS) customer master keys (CMKs) that never leave AWS KMS unencrypted. For a more detailed explanation, see multi_keyring.ts.
To see these examples in action, run npm test.
Note: Remember to first run npm build in the root of the project.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.
FAQs
Unknown package
The npm package @aws-crypto/example-node receives a total of 40 weekly downloads. As such, @aws-crypto/example-node popularity was classified as not popular.
We found that @aws-crypto/example-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.