npm

archiviation

0.2.20 • Public • Published

Archiviation (work-in-progress)

A way to publish text with GitHub Pages without allowing everyone to read.

Note: This software does not have a stable version yet.

Explain Like You Are A Developer

Archiviation encrypts your text files with AES. The AES key is derived from the master key and the filename. The master key is automatically generated during initialization.

A file can be accessed online with a URL like https://username.github.io/?key=${__AES_KEY__}&file=${__FILE_NAME__}, after you push the repository to GitHub Pages (or any other web server). The identifier consists of the 64-character-long AES encryption key and the filename hash. The page will load the file with XMLHttpRequest from https://username.github.io/db/${__FILE_NAME__}. So you do not have to worry about the sensitivity of file names; the URL itself cannot be used to infer the filename.

__AES_KEY__ is generated by:

var key = crypto.createHash('sha256').update(config.masterKey + 'd46fb93ff24448b4a04ee3115cf5147d|9cfbf34fc443455baf19c27f692ecc76|' + articleFileName_raw).digest('base64').replace(/[\=\+\/]/g, '').slice(0, 22);
return key;

__FILE_NAME__ is generated by:

var masterSalt = crypto.createHash('sha256').update(config.masterKey.slice(0, 32)).digest('base64');
var filename = crypto.createHash('sha256').update('d46fb93ff24448b4a04ee3115cf5147d|9cfbf34fc443455baf19c27f692ecc77|' + masterSalt + articleFileName_raw).digest('base64').replace(/[\=\+\/]/g, '').slice(0, 28);
filename += '_' + crypto.createHash('sha256').update('48b4a04ee3115c' + masterSalt.slice(0,5) + articleFileName_raw).digest('base64').replace(/[\=\+\/]/g, '').slice(4, 8);
return filename;

This approach should probably be cryptographically strong enough. Probably!

Use

Dependencies

  • node
  • npm

Installation

Install through NPM:

$ npm install -g archiviation

If NPM is not available:

$ git clone https://github.com/neruthes/archiviation.git
$ cd archiviation
$ npm install .
$ npm link

Initialization

Get inside a directory which you would like to store your project.

$ archiviation init
$ archiviation build
$ cat docs-index.txt

Configuration

All information you are able to configure is in /archiviation-config.json.

Management

You may add plaintext files in /source-articles.

Publishing

You are supposed to git init in /html. And publish to any web server, like GitHub Pages.

Cheatsheet

LINKTO

Create a link to a file. Otherwise, if you add a link in Markdown grammar to a file in the archive, you will need to manually update the link whenever you modify the master key. Modifying the master key will make all previously generated links invalid.

{{LINKTO|File_Name.txt}}

Copyright

© 2018-2020 Neruthes (a.k.a. J.N.)

License: AGPL.

Readme

Keywords

none

Package Sidebar

Install

npm i archiviation

Weekly Downloads

0

Version

0.2.20

License

AGPL-3.0

Unpacked Size

86.4 kB

Total Files

5

Last publish

Collaborators

  • neruthes