Skip to content

Commit

Permalink
Merge pull request #170 from robinmoisson/v3
Browse files Browse the repository at this point in the history
StatiCrypt V3
  • Loading branch information
robinmoisson authored Mar 30, 2023
2 parents 7021e3a + 7cde7de commit dbbad91
Show file tree
Hide file tree
Showing 19 changed files with 1,425 additions and 910 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
node_modules
.staticrypt.json
.env
encrypted/
!example/encrypted/
34 changes: 34 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Migration guide

## From 2.x to 3.x

StatiCrypt 3.x brings a number of improvements: strong default security with WebCrypto, cleaner CLI options and a much simpler `password_template`. This has been done while preserving auto-decrypt "share" links and remember-me functionality: if you used those with StatiCrypt 2.x, your links will still work with 3.x and you'll still be logged in.

There are a few breaking changes, but they should be easy to fix. If you have any trouble, feel free to open an issue.

### Breaking changes

#### The CLI

When encrypting `secret.html`, the CLI will now create a folder with your encrypted file `encrypted/secret.html`. It will not create a `secret_encrypted.html` file anymore.

Passwords shorter than 14 characters used to trigger a warning, now they trigger a blocking promp ("Do you want to use that password [yn]"). Add `--short` to hide that prompt.

The options and parameters have been changed:
- all template related options have been renamed to `--template-*`: pick your file with `--template`, set title with `--template-title`, etc.
- the password is now an optional argument: set with `-p <password>`, or leave blank to be prompted for it.
- many other options have been renamed, refer to the help (`--help`) or documentation for the full reference.

#### The password template

If you don't use a custom password template, you don't need to do anything.

If you do, you need to update your template. To do so:
- get `lib/password_template.html`
- replace the javascript part from this file in your custom template (the new template is logic is much simpler)
- update the injected variables in your template (notice we use new template tags, they now are `/*[|variable|]*/0` instead of `{variable}`):
- `{title}` => `/*[|template_title|]*/0`
- `{instructions}` => `/*[|template_instructions|]*/0`
- `{remember_me}` => `/*[|template_remember|]*/0`
- `{passphrase_placeholder}` => `/*[|template_placeholder|]*/0`
- `{decrypt_button}` => `/*[|template_button|]*/0`
152 changes: 69 additions & 83 deletions README.md

Large diffs are not rendered by default.

Loading

0 comments on commit dbbad91

Please sign in to comment.