Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@aws-crypto/raw-rsa-keyring-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
@aws-crypto/raw-rsa-keyring-node is a package provided by AWS that allows you to use raw RSA keyrings for encryption and decryption operations. It is part of the AWS Encryption SDK for JavaScript, which provides tools for encrypting and decrypting data using various key management techniques.
Encrypting Data
This code demonstrates how to use the @aws-crypto/raw-rsa-keyring-node package to encrypt data using a raw RSA keyring. It generates an RSA key pair, creates a keyring, and then encrypts a plaintext message.
const { RawRsaKeyringNode, encrypt } = require('@aws-crypto/raw-rsa-keyring-node');
const { KeyPair } = require('crypto');
const keyPair = KeyPair.generateSync('rsa', {
modulusLength: 2048,
});
const keyring = new RawRsaKeyringNode({
keyName: 'my-key',
keyNamespace: 'my-namespace',
publicKey: keyPair.publicKey,
privateKey: keyPair.privateKey,
});
const plaintext = Buffer.from('Hello, world!');
(async () => {
const { result } = await encrypt(keyring, plaintext);
console.log(result);
})();
Decrypting Data
This code demonstrates how to use the @aws-crypto/raw-rsa-keyring-node package to decrypt data using a raw RSA keyring. It generates an RSA key pair, creates a keyring, and then decrypts a ciphertext message.
const { RawRsaKeyringNode, decrypt } = require('@aws-crypto/raw-rsa-keyring-node');
const { KeyPair } = require('crypto');
const keyPair = KeyPair.generateSync('rsa', {
modulusLength: 2048,
});
const keyring = new RawRsaKeyringNode({
keyName: 'my-key',
keyNamespace: 'my-namespace',
publicKey: keyPair.publicKey,
privateKey: keyPair.privateKey,
});
const ciphertext = Buffer.from('...'); // Replace with actual ciphertext
(async () => {
const { plaintext } = await decrypt(keyring, ciphertext);
console.log(plaintext.toString());
})();
node-forge is a JavaScript library that provides a wide range of cryptographic tools, including support for RSA key generation, encryption, and decryption. It is a versatile library that can be used for various cryptographic operations, but it does not provide the same level of integration with AWS services as @aws-crypto/raw-rsa-keyring-node.
The built-in 'crypto' module in Node.js provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. While it is a powerful tool for cryptographic operations, it does not offer the key management and integration features provided by @aws-crypto/raw-rsa-keyring-node.
jose is a JavaScript library for JSON Web Tokens (JWT), JSON Web Encryption (JWE), and JSON Web Signatures (JWS). It supports RSA encryption and decryption, but it is primarily focused on web token-based authentication and authorization, rather than general-purpose encryption and decryption like @aws-crypto/raw-rsa-keyring-node.
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.
This package should only be used as part of the AWS Encryption SDK for Javascript. For more information about the packages in this project and how they can be used together, see the main node package readme
npm install @aws-crypto/raw-rsa-keyring-node
npm test
This SDK is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.
FAQs
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
The npm package @aws-crypto/raw-rsa-keyring-node receives a total of 71,879 weekly downloads. As such, @aws-crypto/raw-rsa-keyring-node popularity was classified as popular.
We found that @aws-crypto/raw-rsa-keyring-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.