1 个不稳定版本
使用旧的 Rust 2015
0.2.0 | 2018年4月1日 |
---|---|
0.1.0 |
|
#6 在 #recover
27KB
510 代码行
RustySecrets CLI
rustysecrets-cli 是围绕 RustySecrets 的命令行包装,RustySecrets 是 Rust 实现的阈值 Shamir 的秘密共享.
演示
安装
$ cargo install rustysecrets-cli
用法
$ mkdir shares
$ cat > secret.txt
These programs were never about terrorism: they’re about economic spying,
social control, and diplomatic manipulation. They’re about power.
^D
$ rustysecrets split secret.txt -o shares -k 7 -n 10 -m text/plain
$ ls shares/
share_0 share_1 share_2 share_3 share_4 share_5 share_6 share_7 share_8 share_9
$ rustysecrets recover shares/share_{0-6}
info: Version: INITIAL_RELEASE
info: MIME-Type: text/plain
These programs were never about terrorism: they’re about economic spying,
social control, and diplomatic manipulation. They’re about power.
$ rustysecrets recover shares/share_{0-2}
error: Could not recover secret
caused by: Not enough shares provided!
文档
rustysecrets
USAGE:
rustysecrets <SUBCOMMAND>
OPTIONS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
recover Recover the secret from the shares [aliases: r]
split Split a secret into shares [aliases: s]
rustysecrets split
将秘密分割成份额
USAGE:
rustysecrets split [OPTIONS] <INPUT> --output <DIR> -k <k> -n <n>
OPTIONS:
-o, --output <DIR> Path to the directory to output the shares to
-m, --mime <MIME> The MIME type of the secret
-h, --help Prints help information
-k <k> Number of shares necessary to recover the secret
-n <n> Total number of generated shares
-r, --raw Include this flag to generate raw shares (ie. without a MIME type)
-t, --share-tmpl <share-tmpl> Template for the share names. Defaults to 'share_{{num}}'
-s, --sign Sign the shares
-v, --verbose Enable verbose mode
ARGS:
<INPUT> Path to the file containing the secret to split, or - to read from stdin
rustysecrets recover
从份额中恢复秘密
USAGE:
rustysecrets recover [OPTIONS] <SHARES>...
OPTIONS:
-o, --output <FILE> Path to file to output the secret to, prints to stdout if omitted
-h, --help Prints help information
-r, --raw Include this flag if the shares are raw (ie. do not contain a MIME type)
-v, --verbose Enable verbose mode
--verify Verify the shares signatures
ARGS:
<SHARES>... Paths to shares to recover the secret from
错误报告
请将错误报告作为拉取请求或作为 问题跟踪器 中的问题。 rustysecrets-cli 有一个 完全披露 的漏洞政策。 请勿尝试将任何安全漏洞私下报告给任何人。
许可证
RustySecrets CLI 在 BSD3 许可证下发布。有关更多信息,请参阅 LICENSE。
依赖关系
~12–23MB
~420K SLoC