Socket
Socket
Sign inDemoInstall

@aws-crypto/raw-keyring

Package Overview
Dependencies
3
Maintainers
9
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/raw-keyring


Version published
Maintainers
9
Install size
1.08 MB
Created

Package description

What is @aws-crypto/raw-keyring?

@aws-crypto/raw-keyring is a package provided by AWS that allows developers to use raw keyrings for cryptographic operations. This package is part of the AWS Encryption SDK and is used to encrypt and decrypt data using raw cryptographic keys.

What are @aws-crypto/raw-keyring's main functionalities?

Encrypting Data

This feature allows you to encrypt data using a raw AES keyring. The code sample demonstrates how to create a RawAesKeyringNode and use it to encrypt a plaintext string.

const { RawAesKeyringNode } = require('@aws-crypto/raw-keyring');
const { encrypt } = require('@aws-crypto/client-node');

const keyName = 'example-key-name';
const keyNamespace = 'example-key-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff', 'hex');

const keyring = new RawAesKeyringNode({
  keyName,
  keyNamespace,
  unencryptedMasterKey
});

const plaintext = 'Hello, World!';

(async () => {
  const { result } = await encrypt(keyring, plaintext);
  console.log(result);
})();

Decrypting Data

This feature allows you to decrypt data that was encrypted using a raw AES keyring. The code sample demonstrates how to create a RawAesKeyringNode and use it to decrypt an encrypted data buffer.

const { RawAesKeyringNode } = require('@aws-crypto/raw-keyring');
const { decrypt } = require('@aws-crypto/client-node');

const keyName = 'example-key-name';
const keyNamespace = 'example-key-namespace';
const unencryptedMasterKey = Buffer.from('00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff', 'hex');

const keyring = new RawAesKeyringNode({
  keyName,
  keyNamespace,
  unencryptedMasterKey
});

const encryptedData = /* previously encrypted data */;

(async () => {
  const { plaintext } = await decrypt(keyring, encryptedData);
  console.log(plaintext.toString());
})();

Other packages similar to @aws-crypto/raw-keyring

Readme

Source

aws-encryption-sdk-javascript

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.

About @aws-crypto/raw-keyring

This package is not intended for direct use by clients. To get started with the AWS Encryption SDK for JavaScript, follow the instructions in the README.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

FAQs

Last updated on 14 Jul 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc