0.3.1 • Published 2 years ago

@dtinth/encrypted v0.3.1

Weekly downloads
105
License
ISC
Repository
github
Last release
2 years ago

@dtinth/encrypted

Simple library for encrypted secrets with pre-shared key powered by TweetNaCl.js. It helps you store keys directly inside source code in encrypted form.

Example

Use as a tagged template literal:

const encrypted = require('@dtinth/encrypted')()

const accessKeyId = encrypted`H7WwoocLJnbDgKk1+5vH47JvLp49FQZn.0KlZf2igrh8
hzoKG9zGv1t9rmrUZ4PYftuOy3lV96ygthjpFBlQ=`
const secretAccessKey = encrypted`pg2ozvrK9nun1TGuycfCAV50qgjdgc3Y.WSweWkt
y/OSqppfOcbTEGn0jmdoHy+6fCkV0cnij9S7UVC0rihIygjFZ5S8TBYd8+Rl8LEKLDDuSFA==`

Use as a function:

const encrypted = require('@dtinth/encrypted')()

const accessKeyId = encrypted(`
  H7WwoocLJnbDgKk1+5vH47JvLp49FQZn.0KlZf2igrh8hzoKG9zGv1t9rmrUZ4PYftuOy3lV
  96ygthjpFBlQ=
`)
const secretAccessKey = encrypted(`
  pg2ozvrK9nun1TGuycfCAV50qgjdgc3Y.WSweWkty/OSqppfOcbTEGn0jmdoHy+6fCkV0cni
  j9S7UVC0rihIygjFZ5S8TBYd8+Rl8LEKLDDuSFA==
`)

The encryption keys will be loaded from the environment variable ENCRYPTION_SECRET.

Documentation

For more information, check out the project documention page.

Project documention page

API reference

https://apiref.page/package/@dtinth/encrypted

0.3.1

2 years ago

0.3.0

2 years ago

0.2.4

2 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago