{"id":22820181,"url":"https://github.com/kizzycode/cryptobox-rust","last_synced_at":"2025-03-30T23:16:39.229Z","repository":{"id":57613605,"uuid":"167769824","full_name":"KizzyCode/Cryptobox-rust","owner":"KizzyCode","description":"A KISS CLI-wrapper around libsodium's `cryptobox_easy`","archived":false,"fork":false,"pushed_at":"2022-12-10T17:08:54.000Z","size":36792,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-15T12:52:58.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KizzyCode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE BSD 2-CLAUSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-27T04:40:02.000Z","updated_at":"2023-10-26T22:53:33.000Z","dependencies_parsed_at":"2023-01-26T05:30:41.934Z","dependency_job_id":null,"html_url":"https://github.com/KizzyCode/Cryptobox-rust","commit_stats":null,"previous_names":["kizzycode/cryptobox"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2FCryptobox-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2FCryptobox-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2FCryptobox-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KizzyCode%2FCryptobox-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KizzyCode","download_url":"https://codeload.github.com/KizzyCode/Cryptobox-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390858,"owners_count":20769478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T15:16:51.233Z","updated_at":"2025-03-30T23:16:39.209Z","avatar_url":"https://github.com/KizzyCode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![docs.rs](https://docs.rs/cryptobox/badge.svg)](https://docs.rs/cryptobox)\n[![License BSD-2-Clause](https://img.shields.io/badge/License-BSD--2--Clause-blue.svg)](https://opensource.org/licenses/BSD-2-Clause)\n[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![crates.io](https://img.shields.io/crates/v/cryptobox.svg)](https://crates.io/crates/cryptobox)\n[![Download numbers](https://img.shields.io/crates/d/cryptobox.svg)](https://crates.io/crates/cryptobox)\n[![AppVeyor CI](https://ci.appveyor.com/api/projects/status/github/KizzyCode/Cryptobox-rust?svg=true)](https://ci.appveyor.com/project/KizzyCode/Cryptobox-rust)\n[![dependency status](https://deps.rs/crate/cryptobox/0.2.0/status.svg)](https://deps.rs/crate/cryptobox/0.2.0)\n\n\n\n# About Cryptobox\nCryptobox is a [KISS](https://en.wikipedia.org/wiki/KISS_principle) data en-/decryption-tool that generates a random\n256bit key and hex-prints it to StdErr, seals everything from from StdIn with this random key using\n[libsodium's `crypto_secretbox_xchacha20poly1305_easy`](https://download.libsodium.org/doc/secret-key_cryptography/authenticated_encryption)\nand writes the sealed data to StdOut.\n\nThe idea is to keep the code as simple as possible so that it's easy to understand and validate it (this is also the\nreason why we use [libsodium](https://libsodium.org) as backend).\n\nOptionally Cryptobox can use [`ma_proper`](https://crates.io/crates/ma_proper) as memory allocator to ensure that the\nallocated memory is overwritten before it is returned to the OS (feature `use-maproper`; disabled by default).\n\n\n## Use-Case\nThe use-case is pretty limited – in particular, Cryptobox is __NOT__ suited for\n - large files: Cryptobox reads the _entire_ input from StdIn and writes the result to a _different_ memory location –\n   this means that Cryptobox requires at least two times the input-size as memory\n - any kind of password based encryption: Cryptobox uses a new random key for each encryption and displays the raw hex\n   key – it's up to you to store it somewhere safe and secure\n\nInstead, the use-case is secure long-term encryption of small sensible data for backup purposes. E.g. you could encrypt\nyour GnuPG-keyring and upload it to [Pastebin.com](https://pastebin.com) – this way you only need to store 64 hex chars\nin a safe and secure place instead of the entire keyring.\n\n\n## Encryption\nTo seal a some data, pipe it to `cryptobox`' StdIn and redirect the StdOut to your target location:\n```sh\ncryptobox \u003c /path/to/secret.file \u003e /path/to/sealed.file\n```\n\n__Important: Store the displayed key somewhere safe! Without this key it's probably COMPLETELY IMPOSSIBLE to recover\nyour data from the sealed file.__\n\n\n## Decryption\nTo decrypt some data, export the key as environment variable and pipe it to `cryptobox`' StdIn and redirect the StdOut\nto your target location:\n```sh\nexport CRYPTOBOX_KEY=0197ac79-e307baf7-facd0c5c-9b1b3951-990d7dd5-4cffc259-fd6ac95c-2f3b1a1c\ncryptobox \u003c /path/to/sealed.file \u003e /path/to/secret.file\n```\n\n(Cryptobox detects your exported key automatically and switches to decryption mode – to delete the key from the\nenvironment, use `unset CRYPTOBOX_KEY`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fcryptobox-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkizzycode%2Fcryptobox-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkizzycode%2Fcryptobox-rust/lists"}