{"id":238,"date":"2015-08-25T09:46:02","date_gmt":"2015-08-25T09:46:02","guid":{"rendered":"http:\/\/tuxlabs.com\/?p=238"},"modified":"2015-11-03T18:09:39","modified_gmt":"2015-11-03T18:09:39","slug":"introducing-vault","status":"publish","type":"post","link":"https:\/\/tuxlabs.com\/?p=238","title":{"rendered":"Introducing Vault"},"content":{"rendered":"<h2>Vault<\/h2>\n<p>Vault is a command line utility for encrypting &amp; decrypting things. Those things are stored on disk in\u00a0<em>hidden<\/em> files, meaning in *nix they simply have a &#8216;.&#8217; in front and don&#8217;t show up unless you type ls -la \ud83d\ude09 But anyway, who cares if someone can locate the files ! They are AES encrypted !<\/p>\n<p>I wrote Vault for a couple of reasons.<\/p>\n<ol>\n<li>To learn how to use encryption in Python<\/li>\n<li>To store passwords for stuff<\/li>\n<li>To turn Vault into methods in my Utilities class that I use for my daily programming activities. First write a command line utility, then write a class \ud83d\ude42<\/li>\n<\/ol>\n<h3>Vault Usage<\/h3>\n<p>I literally wrote vault earlier today and even though it is super simple, I still find it cool &amp; useful so I had to share. Here&#8217;s a demo on it&#8217;s simple usage !<\/p>\n<h4>Keys<\/h4>\n<p>AES \/ Vault supports 16, 24, or 32 byte encryption keys. A byte is one character. Your key should be something ambiguous that you can remember and you should not use the &#8216;0123&#8230;&#8217; example below. What would really be paranoid is to encrypt your keys in a separate vault somewhere \ud83d\ude42 Note, you will need to use the same key to encrypt as decrypt for a given stored piece of encrypted data.<\/p>\n<h4>Encrypting<\/h4>\n<pre class=\"lang:default decode:true\">\u279c  vault git:(master) python store.py --name tuxlabs -t 'Well I could store a password or b00bs, cause everyone likes b00bs even the newbs' --key 01234567890987654321abcd\r\np\/hvz1hf9RIyBeyMmgL2CILvlM20vU72E075K+32tysNU8dIJOcX\/gVmRISYQTp0tHZ\/W+qL2mCvMFrMP3rGAV2kCNNjGQNnbUSgPibPGiqfwMrQm3\/EhH\/f18dZofDGTwcMmHZ3LiERuIZt1toU0w== was stored as tuxlabs\r\n\u279c  vault git:(master) \u2717<\/pre>\n<h4>Can You Read The File Contents ?<\/h4>\n<pre class=\"lang:default decode:true\">\u279c  vault git:(master) \u2717 cat .tuxlabs \r\np\/hvz1hf9RIyBeyMmgL2CILvlM20vU72E075K+32tysNU8dIJOcX\/gVmRISYQTp0tHZ\/W+qL2mCvMFrMP3rGAV2kCNNjGQNnbUSgPibPGiqfwMrQm3\/EhH\/f18dZofDGTwcMmHZ3LiERuIZt1toU0w==%                                                                                                                     \u279c  vault git:(master) \u2717<\/pre>\n<h4>Decrypting<\/h4>\n<pre class=\"lang:default decode:true\">\u279c  vault git:(master) \u2717 python retrieve.py --name tuxlabs --key 01234567890987654321abcd\r\nWell I could store a password or b00bs, cause everyone likes b00bs even the newbs\r\n\u279c  vault git:(master) \u2717<\/pre>\n<p><strong>Alternatively, you can hide the key from the command line, by not specifying it.\u00a0<\/strong><\/p>\n<pre class=\"lang:default decode:true\">\u279c  vault  python store.py --name JimmyJohns --text 'Really Fast'\r\nKey:\r\n1HHF5TPl0cklDU\/TXjMQ8nFeqK4zULQ50dVpJ+apgzQ= was stored as JimmyJohns\r\n\u279c  vault  python retrieve.py --name JimmyJohns\r\nKey:\r\nReally Fast\r\n\u279c  vault  cat .JimmyJohns \r\n1HHF5TPl0cklDU\/TXjMQ8nFeqK4zULQ50dVpJ+apgzQ=%                                                                                                                                                                                                                                 \u279c  vault<\/pre>\n<p>Clone Vault on <a href=\"https:\/\/github.com\/tuxninja\/vault\">github<\/a><\/p>\n<p>Enjoy !<br \/>\nJason Riedel<\/p>\n","protected":false},"excerpt":{"rendered":"<a href=\"https:\/\/tuxlabs.com\/?p=238\" rel=\"bookmark\" title=\"Permalink to Introducing Vault\"><p>Vault Vault is a command line utility for encrypting &amp; decrypting things. Those things are stored on disk in\u00a0hidden files, meaning in *nix they simply have a &#8216;.&#8217; in front and don&#8217;t show up unless you type ls -la \ud83d\ude09 But anyway, who cares if someone can locate the files ! They are AES encrypted [&hellip;]<\/p>\n<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,8,9,78],"tags":[64,65,63,62,77,69,70,68,67,55,66],"class_list":{"0":"post-238","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-encryption","7":"category-programming","8":"category-python","9":"category-security","10":"tag-aes","11":"tag-cbc","12":"tag-decryption","13":"tag-encryption","14":"tag-getpass","15":"tag-keypass","16":"tag-password-gorilla","17":"tag-password-safe","18":"tag-password-vault","19":"tag-python","20":"tag-vault","21":"h-entry","22":"hentry"},"_links":{"self":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=238"}],"version-history":[{"count":7,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=\/wp\/v2\/posts\/238\/revisions\/304"}],"wp:attachment":[{"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tuxlabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}