- About the Project
- Getting Started
- Usage
- Settings
- Application Styles
- Roadmap
- Contributing
- FAQ
- License
- Contact
- Acknowledgements
Last updated: Jun 27, 2022
Last updated: Jun 24, 2022
Database
- 🔒️ Uploaded files are encrypted.
- 🔑 Password protection for files.
- 🔍️ Preview text file in terminal.
- ✏️ File editor in the terminal.
- 🎨 Syntax highlight for supporting formats.
- 🧰 Toolbox:
- 📝 Sign file.
- ✅ Verify file signature.
- 🔒 Encrypt the file.
- 🔓 Decrypt the file.
- 👀 (Preview feature) Preview image in terminal using ANSI codes.
This color palette is based on Nord theme.
To run this project, you will need to add the following environment variables to
your .env
file:
-
MongoDB configs:
MONGODB_HOST
: An URI to connect to your database.
E.g:
# .env
MONGODB_HOST="mongodb+srv://{username}:{password}@crypto-file.9mziwnd.mongodb.net/test"
You can also check out the file .env.example
to see all required environment
variables.
-
Python:
>= 3.9
. -
Operating system:
Linux
andmacOS
.Note: This app only supports
Linux
andmacOS
. Currently not supportingWindows
. -
This project uses Poetry as package manager:
Linux, macOS, Windows (WSL)
curl -sSL https://install.python-poetry.org | python3 -
Read more about installation on Poetry documentation.
Clone the project:
git clone https://github.com/DuckyMomo20012/file-crypto.git
Go to the project directory:
cd file-crypto
Install dependencies:
poetry install
OR:
Export Poetry dependencies to file requirements.txt
:
poetry export -f requirements.txt --output requirements.txt
Note: You can add the option:
--dev
to include development dependencies.
Then install dependencies with pip
:
pip install -r requirements.txt
Activate the virtual environment:
poetry shell
Start the program:
poe dev
OR:
python3 app.py
First, you have to log in to your account on the Login page:
OR:
Create your new account on the Register page:
Note: The email field must have a valid email format.
After login, you will see the Dashboard page:
-
Your files will be grouped into dates and sorted by date from newest to oldest.
-
Settings: You can see and edit your account information or change your password here.
-
Your information: This page will show you brief information about your account.
-
Edit your information page: You can edit your information here.
Note: To edit your date of birth, your new value has to follow this format:
YYYY-MM-DD
. E.g:2022-01-01
. -
Change password page:
-
Logout: This will log you out and redirect you to the Login page.
-
-
Tools: This consists of multiple helpful tools:
-
Sign file: This tool will create a file with the
.sig
extension in your save folder path, which is your file's signature. Later, another user can use theVerify signed file
tool to check who has signed that file. -
Verify signed file: This tool will check all available users to verify that file was signed by a valid user.
-
Encrypt file: This tool will create a file with
.bin
extension in your save folder path. The only targeted receiver can decrypt that file using theDecrypt file
tool.Note: You can target yourself as the receiver.
-
Decrypt file: This tool will try to decrypt your encrypted and encode it if possible and save it to your save folder path.
Note: Encrypted file name MUST have
.bin
extension.
-
Note: The file path and folder path can be an absolute path or relative path. E.g:
./src/pages/ ./ ../ ./../ /home/alice/Desktop/file-crypto /home/alice/Desktop/file-crypto/
Note: Other fields without
(optional)
is required.
-
Upload: You can upload your file here. After uploading, your file will be encrypted.
Note: If you upload a file with the same name, the new file name will be appended with a timestamp. E.g:
app_20220626221134.py
. -
File preview: After you type your password to unlock the file, the file will be opened in a window, in preview mode, and using the
dracula
theme by default (only available for text files).Note: Preview mode supports text files and images files. Edit mode only supports text files.
-
In Preview mode, you can change many themes if the file extension is supported since we use Pygments to enable syntax highlighting.
-
You can turn off syntax highlighting by choosing
no theme
in the theme picker. -
All supported file types: https://pygments.org/docs/lexers/
Note: If your file type is not supported, you should change to the
no theme
theme.- All available themes: https://pygments.org/styles/
Note: Some themes will be removed due to incompatible:
borland
,lilypond
,trac
,bw
,algol
,algol_nu
. -
-
You can optionally switch to Edit mode with the
Edit mode
button:Note: Any changes with "newlines"
("\n")
, "tabs"("\t")
or "whitespace"(" ")
will be consider as "no changes", and won't be saved. -
You can also can Download this file to your computer or Delete this file.
Note: Delete will completely delete the file from the server.
-
File information: You can see brief information about your file.
-
Edit file information: You can edit your file name here.
-
(Preview feature) Preview image file: Using CLImage to display beautiful pictures using ANSI codes.
Note: This is a preview feature. This feature may reduce your computer performance.
-
You can override default behaviors by configuring the settings.json
file.
Name | Description | Default |
---|---|---|
workbench.preview.defaultColorTheme |
The default theme for file preview mode |
'dracula'
|
workbench.preview.imageWidth |
Default image width for image preview mode |
60
|
workbench.preview.defaultMode |
Default mode for preview page. Options: preview , edit
|
preview
|
workbench.animation |
Controls if animation is played when adding or removing windows |
true
|
workbench.styles |
Load default styles to the application |
[object Object]
|
Note:
workbench.animation
setting not apply to modals (error, success, warning) or toast messages.
Note:
workbench.styles
will simply dump JSON to YAML and load them to the application. The default value for this setting is loaded from the filestyles.yaml
.
You can customize your application looks (text colors, border chars,...) by
changing default styles in file styles.yaml
.
Read more about customizing on PyTermGUI documentation.
- Share files with other users.
- Download shared files.
- "Shared with me" tab to view shared files.
- File permission level. E.g: read-only, write,...
- Edit shared files.
- Apply themes for editing mode.
- Trash can store temporarily deleted files.
- Preview mode for images.
- Image size automatically resizes on window resize in preview mode.
- Config default theme in user settings.
- Config testing.
Contributions are always welcome!
Please read the Code of Conduct.
-
Is this project still maintained?
- Yes, but we will only update UI, docs, or dependencies. New features won't be added frequently.
-
Is this project ready for production?
- No, this is a small project for practicing cryptographic systems or schemes. This wasn't meant for production.
-
Are you planning to support Windows OS in the future?
- No, we are not adding support for Windows any time soon (and most likely never).
-
Error:
IndexError: list index out of range
:- Please update PyTermGUI to version 7.0.0 or higher to resolve this issue.
-
Error:
assert self._drag_start is not None
:- Please update PyTermGUI to version 7.0.0 or higher to resolve this issue.
-
Error:
ValueError: list.remove(x): x not in list
:- You are clicking the button too fast before the modal or window is fully closed. You should click the button once and wait for the modal or window is fully closed.
-
In image preview mode, my image is broken:
- That is because your terminal width size is too small. Image has a
default width size is
60
block. The terminal should be larger than that size (the nav bar wasn't counted).
- That is because your terminal width size is too small. Image has a
default width size is
-
I can't decrypt my file using the
Decrypt file
tool:- Maybe the encrypted file is broken. You should ask the owner to resend the file.
-
In preview mode for large text files, the app becomes very laggy:
- Then you should change to the
no theme
theme.
- Then you should change to the
-
I have accidentally deleted the file, how can I restore it?
- No, you can't. If the file is deleted, it will be completely deleted from our database and can't be restored.
-
I can't load settings using the
settings.json
file:-
Ensure your JSON format is correct. Notice that comment is not allowed in JSON files.
-
For application styles, make sure those styles are supported.
-
Distributed under MIT license. See LICENSE for more information.
Duong Vinh - @duckymomo20012 - tienvinh.duong4@gmail.com
Project Link: https://github.com/DuckyMomo20012/file-crypto.
Here are useful resources and libraries that we have used in our projects:
- PyTermGUI: A wonderful and fully documented TUI framework to make your terminal rocks.
- Pygments: A useful utility to add your favorite theme to your code.
- CLImage: Print out magnificent pictures in your terminal using ANSI codes.
- Awesome Readme Template: A detailed template to bootstrap your README file quickly.