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 temporary files written on disk.

Warning

SafeCloset hasn't been independently audited yet and 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, always activated when you launch SafeCloset with the --hide option, and toggled with ctrlh

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)

Usage

Those screenshots are small, to fit here, but you may use SafeCloset full screen if you want.

Create your closet file

Run

safecloset some/name.closet

new closet

Have a glance at the help

Hit ? to go to the help screen, where you'll find the complete list of commands.

help

Hit esc to get back to the previous screen.

Create your first drawer

Hit ctrln

drawer creation

new drawer

If you want, you can create a deeper drawer there, at any time, by hitting ctrln.

Or hit n to create a new entry, starting with its name then hitting tab to go fill its value.

typing entry

Change the selection with the arrow keys. Go from input to input with the tab key. Or edit the currently selected field with a.

Reorder entries with ctrl🠕 and ctrl🠗.

In SafeCloset, when editing, searching, opening, etc., the enter key validates the operation while the esc key cancels or closes.

You may add newlines in values with ctrlenter:

multiline

You may notice the values are rendered as Markdown.

Don't hesitate to store hundreds of secrets in the same drawer as you'll easily find them with the fuzzy search.

Search with the / key:

search

When in the search input, remove the search with esc, freeze it with enter.

Save

Hit ctrls to save, or ctrlx to save and quit.

Reopen

The same command is used later on to open the closet again:

safecloset some/name.closet

It may be a good idea to define an alias so that you have your secrets easily available. You could for example have this in you .bashrc:

function xx {
	safecloset -o ~/some/name.closet
}

The -o argument makes safecloset immediately prompt for drawer password, so that you don't have to type ctrlo.

On opening, just type the password of the drawer you want to open (all will be tested until the right one opens):

drawer opening

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 platforms 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
An impish, cross-platform binary parsing crate, written in Rust

libgoblin Documentation https://docs.rs/goblin/ changelog Usage Goblin requires rustc 1.40.0. Add to your Cargo.toml [dependencies] goblin = "0.4" Fea

null 891 Dec 29, 2022
Cross-platform async library for system information fetching 🦀

heim Cross-platform library for system information fetching heim is an ongoing attempt to create the best tool for system information fetching (ex., C

null 782 Jan 2, 2023
Secure drive wipe

Lethe A secure, free, cross-platform and open-source drive wiping utility. Should work with any HDD, SSD (read limitations) and flash drives. The usua

Konstantin Alexandroff 70 Dec 19, 2022
Secure multithreaded packet sniffer

sniffglue sniffglue is a network sniffer written in rust. Network packets are parsed concurrently using a thread pool to utilize all cpu cores. Projec

null 914 Dec 30, 2022
Secure transport for running MPC protocols backed by Signal

MPC over Signal Overview This library provides a high-level interface for connecting to Signal Server and using it to exchange messages with other con

[ZenGo X] 42 Jan 4, 2023
Secure sandboxing system for untrusted code execution

Godbox Secure sandboxing system for untrusted code execution. It uses isolate which uses specific functionnalities of the Linux kernel, thus godbox no

Nathanael Demacon 19 Dec 14, 2022
Secure and fast microVMs for serverless computing.

Our mission is to enable secure, multi-tenant, minimal-overhead execution of container and function workloads. Read more about the Firecracker Charter

firecracker-microvm 20.3k Jan 1, 2023
Secure storage for cryptographic secrets in Rust

secrets secrets is a library to help Rust programmers safely held cryptographic secrets in memory. It is mostly an ergonomic wrapper around the memory

Stephen Touset 165 Dec 22, 2022
Use Touch ID / Secure Enclave for SSH Authentication!

SeKey About SeKey is a SSH Agent that allow users to authenticate to UNIX/Linux SSH servers using the Secure Enclave How it Works? The Secure Enclave

SeKey 2.3k Dec 26, 2022
Cyg will help you to secure files in your repository directly using PGP encryption

cyg: Secure files in your repository Cyg will help you to secure files in your repository directly using PGP encryption. The name "cyg" was inspired b

Hisam Fahri 2 Aug 31, 2022
A self-hosted Fuzzing-As-A-Service platform

OneFuzz A self-hosted Fuzzing-As-A-Service platform Project OneFuzz enables continuous developer-driven fuzzing to proactively harden software prior t

Microsoft 2.6k Jan 8, 2023
Cross-platform Secure TUI Secret Locker

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

Canop 63 Dec 26, 2022
Remote Secret Editor for AWS Secret Manager

Barberousse - Remote Secrets Editor About Usage Options Printing Editing Copying RoadMap 1.0 1.1 Future About A project aimed to avoid downloading sec

Mohamed Zenadi 18 Sep 28, 2021
This is a template to build secret contracts in Rust to run in Secret Network

Secret Contracts Starter Pack This is a template to build secret contracts in Rust to run in Secret Network. To understand the framework better, pleas

Ethan Gallucci 1 Jan 8, 2022
Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs

localbang Cross-platform, cross-browser, cross-search-engine duckduckgo-like bangs What are "bangs"?? Bangs are a way to define where to search inside

Jakob Kruse 7 Nov 23, 2022
An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform deployment.

??️ Bevy Shell - Template An opinionated, monolithic template for Bevy with cross-platform CI/CD, native + WASM launchers, and managed cross-platform

Kurbos 218 Dec 30, 2022
gobang - A cross-platform TUI database management tool written in Rust

gobang - A cross-platform TUI database management tool written in Rust

Takayuki Maeda 2.1k Jan 1, 2023
Build light & secure cross-platform applications with a web-based UI

Millennium Icon by XFaon. *Stats are from Tauri and may not be fully accurate. Millennium is a cross-platform webview framework written in Rust. With

pyke 20 Dec 29, 2022
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun Parmaksız 72 Dec 31, 2022
A user-friendly TUI for secure file transfers, with arrow-key and VIM-style navigation

gsftp SFTP with an interactive text-based user interface (TUI). Transfer files through an encrypted connection with a visual interface, so you can see

Ben Jiron 3 Jul 7, 2022