Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gas-buddy/kms-crypto
Crytography operations that use Amazon Key Management Service, with reasonable development time proxies
https://github.com/gas-buddy/kms-crypto
Last synced: about 2 months ago
JSON representation
Crytography operations that use Amazon Key Management Service, with reasonable development time proxies
- Host: GitHub
- URL: https://github.com/gas-buddy/kms-crypto
- Owner: gas-buddy
- Created: 2016-10-03T02:36:08.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-10-13T04:45:14.000Z (over 2 years ago)
- Last Synced: 2024-11-28T21:44:07.825Z (2 months ago)
- Language: TypeScript
- Size: 1.54 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
kms-crypto
==========![main CI](https://github.com/gas-buddy/kms-crypto/actions/workflows/nodejs.yml/badge.svg)
[![npm version](https://badge.fury.io/js/@gasbuddy%2Fkms-crypto.svg)](https://badge.fury.io/js/@gasbuddy%2Fkms-crypto)
The kms-crypto module creates a generic interface for Key Management Services which allows reasonably flexible usage between true cloud providers (currently only AWS) and local encryption (mostly for development).
The key resource name is used to differentiate between the service providers, and the service provider is embedded in encrypted values (e.g. ciphertext). PLEASE NOTE - the examples use `null:whatever` but DO NOT USE THAT IN PRODUCTION CODE. Your key should start with `kms:` and you should get that key ARN from the ops team.
```
import assert from 'assert';
import { createKmsCryptoProvider } from '@gasbuddy/kms-crypto';(async () => {
const kms = createKmsCryptoProvider({});
const encBlob = kms.encrypt('null:whatever', 'somethingunique', 'testing123');
const decBlob = kms.decrypt('somethingunique', encBlob);
assert.equals(decBlob.toString(), 'testing123');
})();
```