Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-crypto/raw-keyring

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-crypto/raw-keyring

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

  • 4.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
187K
decreased by-7%
Maintainers
0
Weekly downloads
 
Created

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

FAQs

Package last updated on 30 Jul 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc