Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
publish/
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.md
!README.md
/*.jpl
/api
/src
/dist
tsconfig.json
webpack.config.js
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Changelog

All notable changes to this project will be documented in this file.

## v2.2.6 [2026-03-11]

This is a **format migration** release. The previous **JSON-based** format has been replaced with a **CodeFence-based** format in favour of performance enhancements planned for **Joplin 3.6** and to address bugs caused by note tags in the **JSON** format. This update will force users to migrate to the new format.

The update also resolves usability issues, including automatic focus on the password input field and the addition of password confirmation during encryption. Due to current editor limitations, the plugin is now restricted to the **Markdown viewer layout**, and **Rich Text Editor (RTE)** support is currently unavailable, possibly until **Joplin 3.6**.

As this is a migration release, most issues present in **v1.2.4** have been resolved. However, for compatibility reasons the previous implementation is still retained alongside the new format until **Joplin 3.6** is released.

### Added

- Password prompt now validates empty passwords and includes confirmation.

### Changed

- Note storage format migrated from **JSON** to **CodeFence**.
- Plugin now uses **ContentScript** instead of the **Editor API**, since the Editor API has limited triggering capabilities.

### Fixed

- JSON-based detection relied on tags, which failed in some cases; replaced by format migration (#18).
- Password prompt now automatically receives focus (#16).
- Password prompt now includes confirmation field (#15).

## v1.2.4 [2025-10-21]

Initial release of **Secure Notes**, a plugin to password protect and encrypt Joplin notes. Uses industry-standard AES encryption with multiple modes (**GCM, CTR, CBC**) and key sizes (**128, 256**).

### Added

- Commands to encrypt and decrypt notes from the toolbar and menu.
- Secure view mode to read encrypted notes using in-RAM decryption.
78 changes: 78 additions & 0 deletions GENERATOR_DOC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Plugin development

This documentation describes how to create a plugin, and how to work with the plugin builder framework and API.

## Installation

First, install [Yeoman](http://yeoman.io) and generator-joplin using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo@4.3.1
npm install -g generator-joplin
```

Then generate your new project:

```bash
yo --node-package-manager npm joplin
```

## Structure

The main two files you will want to look at are:

- `/src/index.ts`, which contains the entry point for the plugin source code.
- `/src/manifest.json`, which is the plugin manifest. It contains information such as the plugin a name, version, etc.

The file `/plugin.config.json` could also be useful if you intend to use [external scripts](#external-script-files), such as content scripts or webview scripts.

## Building the plugin

The plugin is built using Webpack, which creates the compiled code in `/dist`. A JPL archive will also be created at the root, which can use to distribute the plugin.

To build the plugin, simply run `npm run dist`.

The project is setup to use TypeScript, although you can change the configuration to use plain JavaScript.

## Updating the manifest version number

You can run `npm run updateVersion` to bump the patch part of the version number, so for example 1.0.3 will become 1.0.4. This script will update both the package.json and manifest.json version numbers so as to keep them in sync.

## Publishing the plugin

To publish the plugin, add it to npmjs.com by running `npm publish`. Later on, a script will pick up your plugin and add it automatically to the Joplin plugin repository as long as the package satisfies these conditions:

- In `package.json`, the name starts with "joplin-plugin-". For example, "joplin-plugin-toc".
- In `package.json`, the keywords include "joplin-plugin".
- In the `publish/` directory, there should be a .jpl and .json file (which are built by `npm run dist`)

In general all this is done automatically by the plugin generator, which will set the name and keywords of package.json, and will put the right files in the "publish" directory. But if something doesn't work and your plugin doesn't appear in the repository, double-check the above conditions.

## Updating the plugin framework

To update the plugin framework, run `npm run update`.

In general this command tries to do the right thing - in particular it's going to merge the changes in package.json and .gitignore instead of overwriting. It will also leave "/src" as well as README.md untouched.

The file that may cause problem is "webpack.config.js" because it's going to be overwritten. For that reason, if you want to change it, consider creating a separate JavaScript file and include it in webpack.config.js. That way, when you update, you only have to restore the line that include your file.

## External script files

By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases:

- The script is a TypeScript file - in which case it has to be compiled to JavaScript.

- The script requires modules you've added to package.json. In that case, the script, whether JS or TS, must be compiled so that the dependencies are bundled with the JPL file.

To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file.

## More information

- [Joplin Plugin API](https://joplinapp.org/api/references/plugin_api/classes/joplin.html)
- [Joplin Data API](https://joplinapp.org/help/api/references/rest_api)
- [Joplin Plugin Manifest](https://joplinapp.org/api/references/plugin_manifest/)
- Ask for help on the [forum](https://discourse.joplinapp.org/) or our [Discord channel](https://discord.gg/VSj7AFHvpq)

## License

MIT © Laurent Cozic
122 changes: 120 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,120 @@
# joplin-plugin-notelock
Joplin plugin to lock and encrypt a notebook with password.
# Secure Notes

Secure Notes is a Joplin plugin that lets you password-protect and encrypt your notes locally. It ensures your sensitive information stays private — only you can unlock and read your data.

> [!IMPORTANT]
> **SecureNotes-v2.2.6**
> This release migrates the encryption format from JSON-based to CodeFence-based, laying the groundwork for performance improvements in Joplin 3.6 and fixing bugs caused by note tags in the old JSON format. The plugin is temporarily limited to the Markdown viewer layout and is not supported in Rich Text Editor (RTE).
>
> See the **[CHANGELOG](./CHANGELOG.md)** for full details.

## Features

- 🔒 **Password-Protected** - Encrypt sensitive notes with a password of your choice
- 👁️ **Secure View** - Preview encrypted notes without decrypting them permanently
- 📁 **Local Storage** - Encrypted notes are stored locally in Joplin's database
- 🛡️ **Strong Encryption** - Uses industry-standard AES encryption with Webcrypto API.
- 🔄 **Multiple Modes** - Supports AES-CBC, AES-CTR, and AES-GCM modes with 128-bit or 256-bit key sizes.

## **Disclaimer**

**NO RECOVERY** – If you forget your password, your encrypted notes are permanently lost. There’s no way to recover or reset it. Please keep backups of anything important.

**NO WARRANTIES** – This plugin is provided "as is" without any guarantees. While it uses industry-standard AES encryption, no system is 100% secure. The author is not liable for data loss or security issues.

**_Use at your own risk. By using this plugin, you accept these terms._**

## Installation

### **From Market-Place (Recommended)**

- Open Joplin and navigate to **Tools → Options → Plugins → Search**
- Search for **Secure Notes**
- Click **Install** and restart Joplin

### **From Source-Build**

- Build the plugin package file (.jpl):

```bash
git clone https://github.com/cipherswami/joplin-plugin-secure-notes.git
cd joplin-plugin-secure-notes
npm install
npm run dist
```

- Then in Joplin, Go to **Tools → Options → Plugins → Install from file**
- Select the generated `.jpl` file from the `publish/` directory

## Usage

### Encrypt Note

1. Select the note you want to encrypt.
2. Click the lock icon in the toolbar, or go to `Tools > Secure Notes > Encrypt Note`.
3. Enter a password when prompted.
4. The note will be encrypted and encryption tag is added.

### Decrypt Note

1. Select an encrypted note.
2. Click the unlock icon in the toolbar, or go to `Tools > Secure Notes > Decrypt Note`.
3. Enter the correct password.
4. The note will be permanently decrypted and the encryption tag removed.

### View Note

1. Select an encrypted note.
2. The plugin will automatically prompt for a password.
3. Enter your password to view the note in read-only mode.
4. The content is displayed temporarily without permanently decrypting the note.

> [!NOTE]
> Menu options for encrypt/decrypt is replaced with toggle Lock for this version.

## Settings

Access plugin settings via `Tools > Options > Secure Notes`

#### AES Key Size

- **128-bit** - Faster, suitable for most use cases
- **256-bit** - Maximum security (Recommended)

#### AES Cipher Mode

- **CBC** - Cipher Block Chaining mode
- **CTR** - Counter mode
- **GCM** - Galois/Counter Mode (Recommended)

> [!NOTE]
> Changing encryption settings only affects newly encrypted notes. Previously encrypted notes will use the settings that were active when they were encrypted.

## FAQ

**Q: Can I encrypt all my notes or notebook at once?**
A: Currently, the plugin encrypts notes individually. Batch encryption may be added in future versions.

**Q: Are resources in my notes encrypted?**
A: This plugin only encrypts your note contents. Resources like images, attachments are **not** encrypted because they’re just hyperlinks not the actual files themselves.

**Q: Are encrypted notes searchable?**
A: No, encrypted content cannot be searched until the note is decrypted.

**Q: What happens if I uninstall the plugin?**
A: Encrypted notes will remain encrypted. Reinstall the plugin to decrypt them.

## Change Log

See the full project history in [CHANGELOG](./CHANGELOG.md).

## Support

- **Questions & Discussions**: Join the conversation on the [Joplin Forum](https://discourse.joplinapp.org/t/secure-notes/47501)
- **Bug Reports**: Report issues on [GitHub Issues](https://github.com/cipherswami/joplin-plugin-secure-notes/issues).

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.

Contributions are welcome! Visit the [GitHub repository](https://github.com/cipherswami/joplin-plugin-secure-notes) to submit pull requests or suggest new features.
14 changes: 14 additions & 0 deletions api/Global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Plugin from '../Plugin';
import Joplin from './Joplin';
/**
* @ignore
*/
/**
* @ignore
*/
export default class Global {
private joplin_;
constructor(implementation: any, plugin: Plugin, store: any);
get joplin(): Joplin;
get process(): any;
}
80 changes: 80 additions & 0 deletions api/Joplin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import Plugin from '../Plugin';
import JoplinData from './JoplinData';
import JoplinPlugins from './JoplinPlugins';
import JoplinWorkspace from './JoplinWorkspace';
import JoplinFilters from './JoplinFilters';
import JoplinCommands from './JoplinCommands';
import JoplinViews from './JoplinViews';
import JoplinInterop from './JoplinInterop';
import JoplinSettings from './JoplinSettings';
import JoplinContentScripts from './JoplinContentScripts';
import JoplinClipboard from './JoplinClipboard';
import JoplinWindow from './JoplinWindow';
import BasePlatformImplementation from '../BasePlatformImplementation';
import JoplinImaging from './JoplinImaging';
/**
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
*
* The API is now relatively stable and in general maintaining backward compatibility is a top priority, so you shouldn't except much breakages.
*
* If a breaking change ever becomes needed, best effort will be done to:
*
* - Deprecate features instead of removing them, so as to give you time to fix the issue;
* - Document breaking changes in the changelog;
*
* So if you are developing a plugin, please keep an eye on the changelog as everything will be in there with information about how to update your code.
*/
export default class Joplin {
private data_;
private plugins_;
private imaging_;
private workspace_;
private filters_;
private commands_;
private views_;
private interop_;
private settings_;
private contentScripts_;
private clipboard_;
private window_;
private implementation_;
constructor(implementation: BasePlatformImplementation, plugin: Plugin, store: any);
get data(): JoplinData;
get clipboard(): JoplinClipboard;
get imaging(): JoplinImaging;
get window(): JoplinWindow;
get plugins(): JoplinPlugins;
get workspace(): JoplinWorkspace;
get contentScripts(): JoplinContentScripts;
/**
* @ignore
*
* Not sure if it's the best way to hook into the app
* so for now disable filters.
*/
get filters(): JoplinFilters;
get commands(): JoplinCommands;
get views(): JoplinViews;
get interop(): JoplinInterop;
get settings(): JoplinSettings;
/**
* It is not possible to bundle native packages with a plugin, because they
* need to work cross-platforms. Instead access to certain useful native
* packages is provided using this function.
*
* Currently these packages are available:
*
* - [sqlite3](https://www.npmjs.com/package/sqlite3)
* - [fs-extra](https://www.npmjs.com/package/fs-extra)
*
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/nativeModule)
*
* <span class="platform-desktop">desktop</span>
*/
require(_path: string): any;
versionInfo(): Promise<import("./types").VersionInfo>;
/**
* Tells whether the current theme is a dark one or not.
*/
shouldUseDarkColors(): Promise<boolean>;
}
45 changes: 45 additions & 0 deletions api/JoplinClipboard.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ClipboardContent } from './types';
export default class JoplinClipboard {
private electronClipboard_;
private electronNativeImage_;
constructor(electronClipboard: any, electronNativeImage: any);
readText(): Promise<string>;
writeText(text: string): Promise<void>;
/** <span class="platform-desktop">desktop</span> */
readHtml(): Promise<string>;
/** <span class="platform-desktop">desktop</span> */
writeHtml(html: string): Promise<void>;
/**
* Returns the image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
*
* <span class="platform-desktop">desktop</span>
*/
readImage(): Promise<string>;
/**
* Takes an image in [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs) format.
*
* <span class="platform-desktop">desktop</span>
*/
writeImage(dataUrl: string): Promise<void>;
/**
* Returns the list available formats (mime types).
*
* For example [ 'text/plain', 'text/html' ]
*/
availableFormats(): Promise<string[]>;
/**
* Writes multiple formats to the clipboard simultaneously.
* This allows setting both text/plain and text/html at the same time.
*
* <span class="platform-desktop">desktop</span>
*
* @example
* ```typescript
* await joplin.clipboard.write({
* text: 'Plain text version',
* html: '<strong>HTML version</strong>'
* });
* ```
*/
write(content: ClipboardContent): Promise<void>;
}
Loading