{"id":2130,"date":"2018-09-23T21:47:12","date_gmt":"2018-09-23T12:47:12","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=2130"},"modified":"2018-09-23T21:47:12","modified_gmt":"2018-09-23T12:47:12","slug":"try-cloak-of-cli-one-time-password-manager","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2018\/09\/23\/try-cloak-of-cli-one-time-password-manager\/","title":{"rendered":"CLI \u306a\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u306e cloak \u3092\u8a66\u3059"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div id=\"__asciidoctor-preview-1__\" class=\"paragraph\">\n<p>Rust\u88fd\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u52d5\u4f5c\u3059\u308b\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u3067\u3059\uff0eTOTP\/HOTP \u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-2__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/evansmurithi\/cloak\">evansmurithi\/cloak: A Command Line OTP Authenticator application.<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div id=\"toc\" class=\"toc\">\n<div id=\"toctitle\">Table of Contents<\/div>\n<ul class=\"sectlevel1\">\n<li><a href=\"#_\u5c0e\u5165\">\u5c0e\u5165<\/a><\/li>\n<li><a href=\"#_\u8a66\u3057\u3066\u307f\u308b\">\u8a66\u3057\u3066\u307f\u308b<\/a><\/li>\n<li><a href=\"#_\u74b0\u5883\">\u74b0\u5883<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u5c0e\u5165\">\u5c0e\u5165<\/h2>\n<div class=\"sectionbody\">\n<div id=\"__asciidoctor-preview-3__\" class=\"listingblock\">\n<div class=\"title\">Rust package manager\u306ecargo\u3092\u5c0e\u5165<\/div>\n<div class=\"content\">\n<pre>$ sudo apt install cargo<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-4__\" class=\"listingblock\">\n<div class=\"title\">cargo\u3067cloak\u3092\u5c0e\u5165<\/div>\n<div class=\"content\">\n<pre>$ cargo install cloak<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-5__\" class=\"paragraph\">\n<p><code style=\"font-family: monospace;\">~\/.cargo\/<\/code> \u4ee5\u4e0b\u306b\u5c0e\u5165\u3055\u308c\u308b<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u8a66\u3057\u3066\u307f\u308b\">\u8a66\u3057\u3066\u307f\u308b<\/h2>\n<div class=\"sectionbody\">\n<div id=\"__asciidoctor-preview-6__\" class=\"listingblock\">\n<div class=\"title\">help<\/div>\n<div class=\"content\">\n<pre>$ ~\/.cargo\/bin\/cloak --help\r\ncloak 0.1.0\r\nEvans Murithi &lt;murithievans80@gmail.com&gt;\r\nA Command Line OTP Authenticator application.\r\n\r\nUSAGE:\r\n\tcloak [SUBCOMMAND]\r\n\r\nFLAGS:\r\n\t-h, --help       Prints help information\r\n\t-V, --version    Prints version information\r\n\r\nSUBCOMMANDS:\r\n\tadd               Add a new account\r\n\tdelete            Delete an account\r\n\thelp              Prints this message or the help of the given subcommand(s)\r\n\tlist              List OTP for all accounts\r\n\trecovery_codes    View recovery codes for an account\r\n\tview              View the OTP for an account<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-7__\" class=\"listingblock\">\n<div class=\"title\"><code style=\"font-family: monospace;\">add<\/code> \u30b5\u30d6\u30b3\u30de\u30f3\u30c9\u3067\u767b\u9332\u3059\u308b<\/div>\n<div class=\"content\">\n<pre>$ ~\/.cargo\/bin\/cloak add --help\r\ncloak-add\r\nAdd a new account\r\n\r\nUSAGE:\r\n\tcloak add [FLAGS] [OPTIONS] &lt;account&gt; &lt;key&gt;\r\n\r\nFLAGS:\r\n\t-h, --help       Prints help information\r\n\t\t--hotp       Counter based account\r\n\t\t--totp       Time based account (default)\r\n\t-V, --version    Prints version information\r\n\r\nOPTIONS:\r\n\t-a, --algorithm &lt;ALGORITHM&gt;    Algorithm to use to generate the OTP code [possible values: SHA1, SHA256, SHA384,\r\n\t\t\t\t\t\t\t\t   SHA512, SHA512_256]\r\n\r\nARGS:\r\n\t&lt;account&gt;    Name of the account\r\n\t&lt;key&gt;        Secret key of the OTP\r\n$ ~\/.cargo\/bin\/cloak add matoken@home.nextcloud M0KMYFVOZY7AGX47\r\nAccount successfully created<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-8__\" class=\"listingblock\">\n<div class=\"title\">\u767b\u9332\u60c5\u5831\u78ba\u8a8d<\/div>\n<div class=\"content\">\n<pre>$ ~\/.cargo\/bin\/cloak list\r\nAccount: matoken@home.nextcloud\r\nTOTP: 538273<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-9__\" class=\"listingblock\">\n<div class=\"title\">\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u6307\u5b9a\u3057\u3066TOTP\u30c8\u30fc\u30af\u30f3\u8868\u793a<\/div>\n<div class=\"content\">\n<pre>$ ~\/.cargo\/bin\/cloak view matoken@home.nextcloud\r\n370696<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-10__\" class=\"listingblock\">\n<div class=\"title\">\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u306f\u751f\u3067\u60c5\u5831\u304c\u683c\u7d0d\u3055\u308c\u308b\u306e\u3067\u53d6\u6271\u6ce8\u610f<\/div>\n<div class=\"content\">\n<pre>$ cat ~\/.cloak\/accounts\r\n[\"matoken@home.nextcloud\"]\r\nkey = \"M0KMYFVOZY7AGX47\"\r\ntotp = true\r\nhash_function = \"SHA1\"<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-11__\" class=\"listingblock\">\n<div class=\"title\">\u30a2\u30af\u30bb\u30b9\u6a29\u3082\u305d\u306e\u307e\u307e\u3067\u306f\u5371\u306a\u3044\u306e\u3067\u6ce8\u610f<\/div>\n<div class=\"content\">\n<pre>$ ls -l ~\/.cloak\/accounts\r\n-rw-r--r-- 1 matoken matoken 87  9\u6708 22 06:19 \/home\/matoken\/.cloak\/accounts\r\n$ chmod -R go-rx ~\/.cloak\r\n$ chattr +s ~\/.cloak\/accounts\r\n$ ls -la ~\/.cloak\r\n\u5408\u8a08 12\r\ndrwx------  2 matoken matoken 4096  9\u6708 22 06:19 .\r\ndrwxr-xr-x 62 matoken matoken 4096  9\u6708 23 19:58 ..\r\n-rw-------  1 matoken matoken   87  9\u6708 22 06:19 accounts<\/pre>\n<\/div>\n<\/div>\n<div id=\"__asciidoctor-preview-12__\" class=\"paragraph\">\n<p>\u79d8\u5bc6\u9375\u304c\u5e73\u6587\u3067\u305d\u306e\u307e\u307e\u30d5\u30a1\u30a4\u30eb\u306b\u683c\u7d0d\u3055\u308c\u308b\u306e\u3067\u6700\u4f4e\u3067\u3082ecryptfs\u306f\u8a2d\u5b9a\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u304b\u306a\u306a\u611f\u3058?<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-13__\" class=\"paragraph\">\n<p>\u79c1\u306f\u73fe\u5728\u306foathtool\u3092\u4f7f\u3063\u305fscript\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\uff0e\u79d8\u5bc6\u9375\u306f\u30d5\u30a1\u30a4\u30eb\u306b\u624b\u3067\u66f8\u3044\u3066\u6697\u53f7\u5316\u3057\u3066\u304a\u304dscript\u5b9f\u884c\u6642\u306b\u5fa9\u53f7\u3057\u3066oathtool\u306b\u6e21\u3057\u3066TOTP\u8868\u793a\u3068\u3044\u3046\u611f\u3058\uff0e\u82e5\u3057\u304f\u306fKeePassCX\uff0e<\/p>\n<\/div>\n<div id=\"__asciidoctor-preview-14__\" class=\"ulist\">\n<ul>\n<li>\n<p><a href=\"https:\/\/matoken.org\/blog\/2018\/09\/09\/try-keepassxc-steam-totp\/\">KeePassXC \u306e Steam TOTP \u3092\u8a66\u3059 \u2013 matoken\u2019s meme<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u74b0\u5883\">\u74b0\u5883<\/h2>\n<div class=\"sectionbody\">\n<div id=\"__asciidoctor-preview-15__\" class=\"listingblock\">\n<div class=\"content\">\n<pre>$ ~\/.cargo\/bin\/cloak -V\r\ncloak 0.1.0\r\n$ dpkg-query -W cargo\r\ncargo   0.29.0-1\r\n$ lsb_release -d\r\nDescription:    Debian GNU\/Linux unstable (sid)\r\n$ uname -m\r\nx86_64<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Rust\u88fd\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u52d5\u4f5c\u3059\u308b\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u3067\u3059\uff0eTOTP\/HOTP \u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\uff0e evansmurithi\/cloak: A Command Line OTP Authenticator a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[407,406,408,298],"class_list":["post-2130","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-cloak","tag-otp","tag-rust","tag-totp"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=2130"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/2130\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=2130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=2130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=2130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}