Boost C++ Libraries: Ticket #4183: Crypto/password generator example https://svn.boost.org/trac10/ticket/4183 <p> Could you include an example to use the lib to generate a password? I've no idea what generator is best for this purpose and how to seed it properly and I think this is a common practise for this lib. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4183 Trac 1.4.3 Steven Watanabe Tue, 04 May 2010 16:32:22 GMT <link>https://svn.boost.org/trac10/ticket/4183#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4183#comment:1</guid> <description> <p> The only choice if you need security is random_device. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sat, 05 Jun 2010 21:11:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4183#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4183#comment:2</guid> <description> <pre class="wiki">#include &lt;boost/nondet_random.hpp&gt; #include &lt;boost/random/variate_generator.hpp&gt; #include &lt;boost/random/uniform_int.hpp&gt; int main() { std::string chars( "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "1234567890" "!@#$%^&amp;*()" "`~-_=+[{]{\\|;:'\",&lt;.&gt;/?"); boost::random_device rng; boost::variate_generator&lt;boost::random_device&amp;, boost::uniform_int&lt;&gt; &gt; gen(rng, boost::uniform_int&lt;&gt;(0, chars.size())); for(int i = 0; i &lt; 8; ++i) { std::cout &lt;&lt; chars[gen()]; } std::cout &lt;&lt; std::endl; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Wed, 09 Jun 2010 02:33:43 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4183#comment:3 https://svn.boost.org/trac10/ticket/4183#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/62629" title="Add an example of generating a random password. Fixes #4183">[62629]</a>) Add an example of generating a random password. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4183" title="#4183: Support Requests: Crypto/password generator example (closed: fixed)">#4183</a> </p> Ticket JRSmith73@… Mon, 06 Aug 2012 01:12:07 GMT <link>https://svn.boost.org/trac10/ticket/4183#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4183#comment:4</guid> <description> <p> To whom it may concern: </p> <p> I believe there is a typographical error within your recommended code password.cpp. Specifically, the last line defining the character string contains two open curly braces { and no close curly brace }. (<a href="http://www.boost.org/doc/libs/1_50_0/libs/random/example/password.cpp">http://www.boost.org/doc/libs/1_50_0/libs/random/example/password.cpp</a>): </p> <pre class="wiki">"`~-_=+[{]{\\|;:'\",&lt;.&gt;/? "); </pre><p> I believe the correct entry should be: </p> <pre class="wiki">"`~-_=+[{]}\\|;:'\",&lt;.&gt;/? "); </pre><p> However, the impact of this on random password generation is minimal. </p> <p> Respectfully, </p> <p> JRSmith </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Thu, 28 Feb 2013 22:24:14 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4183#comment:5 https://svn.boost.org/trac10/ticket/4183#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> It's really better to file a new ticket instead of tacking this onto an existing (closed) ticket. I almost missed this. </p> Ticket Steven Watanabe Tue, 11 Mar 2014 17:47:12 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4183#comment:6 https://svn.boost.org/trac10/ticket/4183#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="ext-link" href="http://github.com/boostorg/random/commit/c69514060fc0fa8556f8fc1ab188f6b067dad05c"><span class="icon">​</span>http://github.com/boostorg/random/commit/c69514060fc0fa8556f8fc1ab188f6b067dad05c</a> </p> Ticket