Skip to content

Commit

Permalink
Merge pull request #13 from pralad-p/final-touches
Browse files Browse the repository at this point in the history
Final touches
  • Loading branch information
pralad-p authored Mar 3, 2024
2 parents 1f5fd17 + dcd3d30 commit 20a22ae
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
74 changes: 73 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
![Cypher Note logo](./local/logo.png)
# cypher-note

## Work In Progress
[Cypher Note](https://cypher-note.vercel.app/) is a desktop/web application built with Electron, specifically designed for obfuscated prompting with Language Learning Models (LLMs). It facilitates a secure interaction layer between users and LLMs by enabling the encryption of sensitive text within prompts. This ensures that extra context is not inadvertently passed on to the LLM, safeguarding user privacy. Additionally, Cypher Note provides the functionality to decrypt responses received from the LLM, allowing for a seamless, secure dialogue flow.
It is available online here: https://cypher-note.vercel.app/

# Table of Contents
- [cypher-note](#cypher-note)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [Considerations](#considerations)
- [License](#license)

## Features

- **Sensitive Text Encryption & Decryption**: Securely encrypt sensitive text within prompts before sending to an LLM, and decrypt LLM responses to view original context.
- **Session Management**: Manage encryption sessions with start and end capabilities, ensuring that encryption keys (noun mappings) are only active when needed.
- **Custom Text Marking**: Easily mark text for encryption with mouse or keyboard shortcuts, visually highlighting text segments for encryption or decryption.
- **Word options**: Case-sensitive and whole word options can be used to perform mappings on words that match by case and/or by the entire word too.
- **It's all on you**: The mappings take place completely on your browser. It is also possible to run a self-hosted version as shown [below](#getting-started).

## Getting Started

### Prerequisites

- Node.js (LTS version recommended)
- npm (comes with Node.js)

### Installation

1. Clone the repository to your local machine:
```bash
git clone https://github.com/your-github-username/cypher-note.git
```

2. Navigate to the cloned repository directory:
```bash
Copy code
cd cypher-note
```

3. Install the necessary dependencies:
```
npm install
```

4. Launch the application:
```
npm start
```

## Usage

- **Encrypting Text**: Highlight the text you wish to encrypt within your prompt and use the left-and-right mouse buttons *or* Ctrl-Space keyboard shortcut to mark a sensitive word. When you're done, you can click the "Encrypt" button to perform the mapping in place that can be safely sent to the LLM.
- **Decrypting LLM Responses**: After receiving a response containing muddled words, use the "Decrypt" button to convert it back into its original form, maintaining the confidentiality of sensitive information.
- **Session Control**: Use the "End Session" button to clear all current encryption mappings and start a new session, ensuring old mappings are not retained.
- **Accessing Help**: Click the "Help" button to view detailed instructions on using Cypher Note effectively.

## Contributing

We welcome contributions! Feel free to submit pull requests or create issues for bugs, features, or improvements.

## Considerations

- [ ] Direct LLM integration? (Avoid the whole copy-paste workflow)

## License

Cypher Note is made available under the MIT License. See the LICENSE file for more details.

Binary file added local/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
</div>
</div>
</div>
<div class="credits mt-auto py-4 text-center text-sm text-gray-600">
🪪 Made by PP
</div>
</aside>
<main id="main-content" class="flex-grow overflow-hidden">
<div
Expand Down
4 changes: 2 additions & 2 deletions utils/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ def write_contents_to_file(directory, filenames):
output_file_path = os.path.join(script_dir,'..', 'content.txt')
output_file_path = os.path.normpath(output_file_path)

with open(output_file_path, 'w') as output_file:
with open(output_file_path, 'w', encoding='utf-8') as output_file:
for filename in filenames:
# Construct full path to the file
file_path = os.path.join(directory, filename)

try:
# Attempt to open and read the file
with open(file_path, 'r') as file:
with open(file_path, 'r', encoding='utf-8') as file:
content = file.read()
output_file.write("================\n")
output_file.write(f"//{filename}\n")
Expand Down

0 comments on commit 20a22ae

Please sign in to comment.