Skip to content

cyclic-software/example-secure-file

Repository files navigation

example-secure-file

This repo provides a few examples of how to securely store and retrieve a file using Nodejs and Cyclic.

Getting Started

  1. Clone repo
  2. npm ci
  3. Add your secret file and .env to your .gitignore
  4. Create a .env file if you don't have one with SECRET_PASSPHRASE=<some long and secret passphrase>
  5. Run: npm run encrypt <YOUR_INPUT_FILENAME>

Store encrypted file in git

  1. git add <YOUR_INPUT_FILENAME>.secure; git commit -m "Added secret file"
  2. Set an environment variable SECRET_PASSPHRASE with the value used to encrypt the file
  3. Read the file in your server
const { decryptToString } = require('./secure-file.js')
...
const secureFileName = './account.json.secure'
const jsonStr = await decryptToString(secureFileName)

Store encrypted file in S3

Coming soon!

Store encrypted file in DynamoDB

Coming soon!

About

Examples of how to initialize with a secure file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published