{"id":1067,"date":"2009-10-12T13:06:05","date_gmt":"2009-10-12T12:06:05","guid":{"rendered":"http:\/\/www.devco.net\/?p=1067"},"modified":"2009-10-20T17:13:31","modified_gmt":"2009-10-20T16:13:31","slug":"ruby_password_creation_library_released","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2009\/10\/12\/ruby_password_creation_library_released.php","title":{"rendered":"Ruby password creation library released"},"content":{"rendered":"

Continuing to move a few bits of unimportant code into the public I’ve released a ruby library called passmakr<\/em> that assists in creating passwords in various useful formats.<\/p>\n

Mostly it takes some key bits of code from another password library<\/a> and re-uses it in a new way that has fewer dependencies etc.<\/p>\n

It supports creating phonemic passwords – that humans should find easier to remember than random ones – as well as random ones using Ruby’s random function as well a mode for reading \/dev\/urandom<\/em>.<\/p>\n

Using it is trivial, the code has rdoc in it as well to show you the other modes.<\/p>\n

\n
\nrequire 'passmakr'\nrequire 'pp'\n\npw = Passmakr.new(:phonemic, 8)\n\npp pw.password\n<\/pre>\n<\/blockquote>\n
\n
\n{:rot13=>\"trrtrrFb\",\n :crypt=>\"qmRSIJG2fy7Yg\",\n :string=>\"geegeeSo\",\n :nato=>\"golf echo echo golf echo echo Sierra oscar\",\n :md5=>\"$1$NwZQhCce$sBvOWjLEVOjSyp89HORcv\/\"}\n<\/pre>\n<\/blockquote>\n

You can pass it modes of :phonemic<\/em>, :random<\/em> and :urandom<\/em>.<\/p>\n

There’s also a little cli tool included that works like this:<\/p>\n

\n
\n% passmakr -p -l 8\n8 character phonemic password:\n\n   Password: ooHivahn\n   Crypt:    gDxSAc\/ewkTzg\n   MD5:      $1$TcwcAexC$nNxMbU5CTQTt4I.JSNRhx0\n   Rot 13:   bbUvinua\n   NATO:     oscar oscar Hotel india victor alfa hotel november\n<\/pre>\n<\/blockquote>\n

The various modes printed are some often found in Unix systems, I’ll add other modes if people send me requests. Rot 13 is there just for laughs.<\/p>\n

This code also extends the normal String class with a to_nato method that can be used on all strings:<\/p>\n

\n
\n\"Foo Bar\".to_nato\n=> \"Foxtrot oscar oscar   Bravo alfa romeo\"\n<\/pre>\n<\/blockquote>\n

The code and a gem to install it can be found at http:\/\/code.google.com\/p\/passmakr\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Continuing to move a few bits of unimportant code into the public I’ve released a ruby library called passmakr that assists in creating passwords in various useful formats. Mostly it takes some key bits of code from another password library and re-uses it in a new way that has fewer dependencies etc. It supports creating […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,13,63],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1067"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=1067"}],"version-history":[{"count":8,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1067\/revisions"}],"predecessor-version":[{"id":1100,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/1067\/revisions\/1100"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=1067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=1067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=1067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}