Cross-platform Secure TUI Secret Locker

Overview

Latest Version Chat on Miaou

SafeCloset keeps your secrets in password protected files. SafeCloset is designed to be convenient and avoid common weaknesses like external editing or clear temporary files written on disk.

Warning

  • This is a personal project
  • It hasn't been audited
  • It's not even finished anyway
  • The storage format is still expected to change in breaking ways

SafeCloset comes with absolutely no guarantee. And I can do nothing for you if you lose the secrets you stored in SafeCloset.

Overview

A closet is stored in a file that you can backup, keep with you on an USB key, etc.

A closet contains drawers, each one is found and open with its own password.

A drawer contains a list of (key, value). Values are texts in which you can store a code, a password, comments, a poem, some data, etc.

A drawer can also contains deeper crypted drawers.

clear drawer

Features

  • The closet contains several drawers, some of them automatically created with an unknown password so that nobody can determine which drawers you're able to open, or even how many
  • Each drawer is separately crypted with AES-GCM-SIV, with a random one-use nonce and the password/key of your choice. This gives an inherently long to test decrypt algorithm (but you should still use long passphrases for your drawers)
  • You can have one or several drawers with real content. You can be forced to open a drawer at gun point and still keep other drawers secret without any trace, either at the top level or deeper in the drawer you opened
  • When you open a drawer, with its password, you can read it, search it, edit it, close it
  • In an open drawer you can create new drawers, or open deeper drawers if you know their password
  • SafeCloset automatically quits on inactivity
  • The size of the drawer's content isn't observable
  • No clear file is ever created, edition is done directly in the TUI (external editors are usually the weakest point)
  • No clear data is ever given to any external library, widget, etc.
  • All data is viewed and edited in the TUI application
  • You can compile SafeCloset yourself. Its code is small and auditable
  • The code is 100% in Rust. I wouldn't trust anything else today for such a program
  • The format of the closet file is described so that another application could be written to decode your closet files in the future (assuming you have the password)
  • SafeCloset can't be queryied by other applications, like browsers. This is a feature.
  • You may have all your secrets in one file easy to keep with you and backup
  • No company can die and lose your secrets: you keep everything, with as many copies as necessary, where you want
  • No company can be forced to add some secret stealing code: SafeCloset is small, open-source and repleacable
  • Fast and convenient to use - This is where the focus of the design was
  • Cross-platform because you don't know where you'll have to use your closet
  • "I'm being watched" mode in which unselected values are hidden. This mode is kept per drawer, and always activated when you launch SafeCloset with the --hide option

Non features

  • SafeCloset doesn't protect you against keyloggers
  • SafeCloset doesn't protect you from somebody watching your screen while a secret value is displayed (but the rest of the drawer can be kept hidden)

Features not yet implemented

  • pasting (I don't think it would be a good idea to allow copying from safecloset)
  • password change

Keyboard actions

  • ? : Open the help screen
  • ctrln : Create a drawer (in the open drawer, or at root when none is open)
  • ctrlo : Open a drawer
  • ctrlc : Close the current drawer, without saving (you're back in the upper level one if you close a deep drawer)
  • ctrls : Save the current drawer and all upper drawers
  • ctrlx : Save then quit
  • ctrlq : Quit without saving (with no confirmation)
  • / : Start searching the current drawer (do enter or use the down or up arrow key to freeze it)
  • / then esc : Remove the current filtering
  • esc : Cancel current field edition
  • tab : Create a new entry or edit the value if you're already editing an entry's name
  • arrow keys : Move selection, selecting either an entry name or a value
  • i or insert : Start editing the selected name or value
  • d : Remove the selected entry (with confirmation)
  • Enter : Validate the current edition
  • alt-Enter : New line in the currently edited value

Advices

  1. Use the search to navigate among entries. That's the most efficient solution. It's OK to have thousands of secrets in your drawer.
  2. You may not need deep drawers. They make you open twice, with two passwords, so don't use them without reason.
  3. Don't use drawers as categories. They separate audience or security levels and ensure plausible deniability. You're supposed to have one drawer for most of your secrets. Maybe a second one if you have a very secret level. Or one with your work secrets that you may open with colleagues nearby. Or one for the family that even the kids can read. This shouldn't be more than 3 or 4 drawers at most.
  4. Backup your closet files. They're not readable as long as your passphrases can't be guessed so you don't have to hide those files and it's most important to not lose them.
  5. Use hard to guess passphrases, but ones that you can remember for a very long time.
  6. You may keep the executables of all OS on your USB keys, so that you can read your secrets everywhere.

Storage format

The closet file is a MessagePack encoded structure Closet with the following fields:

  • salt: a string
  • drawers: an array of ClosedDrawer

The MessagePack serialization preserves field names and allows future additions.

An instance of ClosedDrawer is a structure with the following fields:

  • id: a byte array
  • nonce: a byte array
  • content: a byte array

The content is the AES-GCM-SIV encryption of the serializied drawer with the included nonce. The key used for this encryption is a 256 bits Argon2 hash of the password with the closet's salt.

The serialized drawer is a MessagePack encoded structure with the following fields:

  • id: a byte array
  • entries: an array of Entry
  • settings: an instance of DrawerSettings
  • closet: a deeper closet, containing drawers, etc.
  • garbage: a random byte array

Instances of Entry contain the following fields:

  • name: a string
  • value: a string

Instances of DrawerSettings contain for now just one optional field:

  • hide_values: a boolean
Comments
  • Paste multiline text doesn't work

    Paste multiline text doesn't work

    I'm on Windows and using v0.4.0. It seems that I can't paste multiline text in the info entry UI. When I do that, they get concatenated and some characters were missing. Also it seems that I can't add newline in the left cells. Is this expected? See below image for details. safe1

    Windows 
    opened by 0x7FFFFFFFFFFFFFFF 21
  • Support Termux

    Support Termux

    Since safecloset is very useable now, I migrated my secret management fully to it. I hope I can run it on my Android devices. I tried build it under Termux, but I got this error: Screenshot_20211117-185636_Termux

    Do you know how to solve it? Since it's from a color related crate, is it possible to remove color support if not easy to solve. Thanks.

    enhancement 
    opened by 0x7FFFFFFFFFFFFFFF 9
  • Newline doesn't work on Windows

    Newline doesn't work on Windows

    In the document it states that

    You may add newlines in values with ctrl enter

    and

    alt-Enter : New line in the currently edited value

    However, I tried both on Windows and it doesn't work. I tried both Windows Terminal and the old school cmd.exe, same result.

    opened by 0x7FFFFFFFFFFFFFFF 8
  • Question mark doesn't work

    Question mark doesn't work

    I'm using v0.2.5 and when safecloset starts, the ? shortcut has never worked. Below is the log. I started safecloset, pressed ? three times and ctrl+x exited. It seems safecloset did receive the key.

    08:38:15.620 [INFO] cli_log::init: Starting safecloset v0.2.5 with log level DEBUG
    08:38:15.621 [INFO] safecloset::cli: args: Args {
        version: false,
        hide: false,
        open: false,
        path: Some(
            "test",
        ),
    }
    08:38:15.888 [DEBUG] safecloset::tui::app: user event: Ok(Resize(107, 29))
    08:38:20.380 [DEBUG] safecloset::tui::app: user event: Ok(Key(KeyEvent { code: Char('?'), modifiers: SHIFT }))
    08:38:20.747 [DEBUG] safecloset::tui::app: user event: Ok(Key(KeyEvent { code: Char('?'), modifiers: SHIFT }))
    08:38:21.077 [DEBUG] safecloset::tui::app: user event: Ok(Key(KeyEvent { code: Char('?'), modifiers: SHIFT }))
    08:38:23.290 [DEBUG] safecloset::tui::app: user event: Ok(Key(KeyEvent { code: Char('x'), modifiers: CONTROL }))
    08:38:23.290 [DEBUG] safecloset::tui::app_state: user requests save and quit
    08:38:23.290 [DEBUG] safecloset::tui::app_state: self.close_drawer_input(false) took 300ns
    08:38:23.290 [DEBUG] safecloset::tui::app: user requests quit
    08:38:23.290 [INFO] safecloset: bye
    

    Also as you can see in the following screen snapshot, there are duplicate help information at the bottom when I started safecloset. image The length of the first help line is not equal to the second line, which is a little weird. For example, when I copy a cell, it looks like this. image

    opened by 0x7FFFFFFFFFFFFFFF 6
  • [Question] How to add a new entry below the active entry?

    [Question] How to add a new entry below the active entry?

    Many times I need to add a new entry below the active entry. Is there a shortcut for it? Right now I always add a new entry at the end of the list and move it up to the proper position, which is a little cumbersome.

    opened by 0x7FFFFFFFFFFFFFFF 5
  • Can't use mouse select cell content

    Can't use mouse select cell content

    I'm on Windows and use SafeCloset 0.5.2. When I use mouse to select the cell content, SafeCloset exits with an error message Error: Crossbeam(RecvError). Is SafeCloset designed so that the user is not allowed to select text inside the program with the mouse? I'm using Windows Terminal and by default Windows Terminal will copy the selection to clipboard. And that's why I was making the selection. selection_error

    bug Windows 
    opened by 0x7FFFFFFFFFFFFFFF 5
  • Inconsistent password pasting behavior

    Inconsistent password pasting behavior

    I don't know if this trivial behavior is caused by safecloset or the terminal. It behaves exactly the same on Windows Terminal, cmd.exe and the native PowerShell console. It behaves like this.

    https://user-images.githubusercontent.com/39968/142635139-3f0c2caf-c28f-4b18-aec3-e7cf5dc574c0.mp4

    Not a big issue, just curious why it behaves like this.

    opened by 0x7FFFFFFFFFFFFFFF 4
  • Suggestion: show nested closets as a breadcrumb

    Suggestion: show nested closets as a breadcrumb

    Right now if safecloset only show the file name that you passed to it on the title bar. If you have multiple level of nested closets, there is no information for you to identify where you are. For example, if I run the following command:

    safecloset test
    ctrl+n
    aa
    ctrl+n
    bb
    ctrl+n
    cc
    

    After running these commands, I'm in the cc closet of the breadcrumb aa > bb > cc. But there is no information on the screen that tells me this. Is it possible to add a breadcrumb like aa > bb > cc or [test] > aa > bb > cc to safecloset title bar?

    opened by 0x7FFFFFFFFFFFFFFF 4
  • Feature request: Let the user customize some common parameters and probably save to a config file

    Feature request: Let the user customize some common parameters and probably save to a config file

    Right now some behaviors are hardcoded in SafeCloset. For example, the user must provide a pretty strong drawer password. If yo u left SafeCloset for a period of time it will automatically close itself. I think if behaviors like these could be customized by the user will make it more useful. You may say enforce a strong password and quickly close a closet are SafeCloset's security features. But there are some cases that the user may want a short password (easier to type) and want it keep open for a longer time. For example, if the information in a drawer is not that sensitive, but the user does want to protect it to some level, he can use SafeCloset with a short password.

    My suggestion is, if the user run safecloset without a configuration file (which is the default), safecloset will run with its default behavior. If the user create a safecloset.config file and put some customization parameter in it, safecloset will use the parameters there.

    opened by 0x7FFFFFFFFFFFFFFF 4
  • Could you add command line version of the program?

    Could you add command line version of the program?

    Thanks for creating safecloset. It's a very useful utility!

    Current SC use TUI for everything. If there is a command line interface so that users can add, query, delete, change drawer entries, that would make the program more versatile and can be used under more situations.

    opened by FikretSanda 3
  • Question: Is it possible to always show the full cell content?

    Question: Is it possible to always show the full cell content?

    When the cell has multiple line, it collapsed by default and only show full content when the cell is active. Is it possible to always show the full cell content? That way, you can see the whole content at a glance, which is more useful imo.

    undecided 
    opened by 0x7FFFFFFFFFFFFFFF 3
  • Provide ready to use Mac executable

    Provide ready to use Mac executable

    This tool looks great, although mac users can use Mac keychain this looks very useful to send closets to other people but there is no darwin executable on the released zip

    enhancement 
    opened by angel-git 3
Releases(v0.7.0)
Owner
Canop
Denys Séguret. Looking for a new job as Rust Remote Developer.
Canop
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Dec 30, 2022
User-friendly secure computation engine based on secure multi-party computation

CipherCore If you have any questions, or, more generally, would like to discuss CipherCore, please join the Slack community. See a vastly extended ver

CipherMode Labs 356 Jan 5, 2023
A value transfer bridge between the Monero blockchain and the Secret Network.

Secret-Monero-Bridge A value transfer bridge between the Monero blockchain and the Secret Network. Proof-of-Concept Video Demonstration: https://ipfs.

null 28 Dec 7, 2022
secret folders generator to hide hentais in your computer

hentai dream 95 secret folders generator to hide hentais in your computer, but its really old way as **** used techniquee one injection technique from

jumango pussu 7 Jul 8, 2021
A pure-Rust implementation of various threshold secret sharing schemes

Threshold Secret Sharing Efficient pure-Rust library for secret sharing, offering efficient share generation and reconstruction for both traditional S

Snips 137 Dec 29, 2022
Manage secret values in-repo via public key cryptography

amber Manage secret values in-repo via public key cryptography. See the announcement blog post for more motivation. Amber provides the ability to secu

FP Complete 82 Nov 10, 2022
A tool for secret-shared passphrases.

harpo harpo is a tool and library that provides the following functionality: It can generate a seed phrase. Given a seed phrase, it can generate any n

Thomas Locher 11 Jun 30, 2022
Rust implementation of Shamir's Secret Sharing

Horcrux - Rust implementation of Shamir's Secret Sharing This program is an example implementation of Shamir's Secret Sharing in Rust. You can find mo

null 13 Dec 29, 2022
Secret contract for Anons project.

Snip-721 Protocal by Baedrik template with several edits Minting Limits mint() caps tokens max at 580 mint() will keep count of how many anons each ad

Stake or Die 14 Jul 9, 2022
🔑 Threshold Shamir's secret sharing in Rust

Rusty Secrets Rusty Secrets is an implementation of a threshold Shamir's secret sharing scheme. Documentation (latest) Documentation (master) Design g

Spin Research 233 Dec 17, 2022
Rusty Hog is a secret scanner built in Rust for performance, and based on TruffleHog which is written in Python.

Rusty Hog is a secret scanner built in Rust for performance, and based on TruffleHog which is written in Python. Rusty Hog provides the following bina

New Relic 306 Jan 4, 2023
A CLI application that implements multi-key-turn security via Shamir's Secret Sharing.

agree agree is a CLI tool for easily applying multi-key-turn security via Shamirs Secret Sharing. Project state agree is unstable. Version semantics:

Alexander Weber 19 Aug 29, 2023
The protocol are designed and made for the future of cross-IP, cross-chain metaverse.

Avatar-protocol 化身协议 This project demonstrates how to use the Solana Javascript API to interact with programs on the Solana blockchain. The project co

Wind-protocol 1 Jan 10, 2022
DexiosGUI - Simple cross-platform drag-and-drop Dexios file encryption

DexiosGUI Simple cross-platform drag-and-drop Dexios file encryption. Latest Windows x64 release is here. DexiosGUI is a Qt/C++ app for encrypt and de

Fabrice Corraire 4 Jul 25, 2022
A minimalistic cross-platform malware scanner with non-blocking realtime filesystem monitoring using YARA rules.

Sauron is a minimalistic, YARA based malware scanner with realtime filesystem monitoring written in Rust. Features Realtime scan of created and modifi

Simone Margaritelli 155 Dec 26, 2022
Cross-platform atomic wait and wake (aka futex) functionality for Rust.

Cross platform atomic wait and wake (aka futex) functionality. This crate only supports functionality that's available on all of Linux, Windows, and m

Mara Bos 38 Dec 15, 2022
A simple to use, cross-platform aes encryption

About Project End to End encryption (AES) for multiple languages (cross-platform) with CBC Icon Item ?? Upcoming ⚖️ License ?? ChangeLog Usage (rust)

Zot Cryptography 2 Dec 15, 2022
A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords

password-generator-pro A fast, simple and powerful open-source cross platform utility tool for generating strong, unique and random passwords. Feature

Sebastien Rousseau 3 Dec 16, 2022