<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>password bash python md5 &#8211; VeriTeknik</title>
	<atom:link href="https://www.veriteknik.net.tr/en/tag/password-bash-python-md5/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.veriteknik.net.tr/en/</link>
	<description>VeriTeknik Bilişim &#124; VeriTeknik Bilişim</description>
	<lastBuildDate>Thu, 17 May 2012 09:35:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Password Generation in UNIX</title>
		<link>https://www.veriteknik.net.tr/en/password-generation-in-unix/</link>
					<comments>https://www.veriteknik.net.tr/en/password-generation-in-unix/#respond</comments>
		
		<dc:creator><![CDATA[Mustafa Emre Aydın]]></dc:creator>
		<pubDate>Thu, 17 May 2012 09:35:41 +0000</pubDate>
				<category><![CDATA[LINUX Help]]></category>
		<category><![CDATA[Programmin]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[password bash python md5]]></category>
		<guid isPermaLink="false">http://www.plugged.in/?p=410</guid>

					<description><![CDATA[<p>Below I&#8217;ll describe a couple of nice methods to generate passwords using Python and Bash. Actually there are a lot of ways you can accomplish this especially with bash, but using the /dev/urandom file seems to be the most clever one. The /dev/urandom device doesn&#8217;t only generate read-friendly characters, so it&#8217;s best to filter out [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/password-generation-in-unix/">Password Generation in UNIX</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Below I&#8217;ll describe a couple of nice methods to generate passwords using Python and Bash.</p>
<p>Actually there are a lot of ways you can accomplish this especially with bash, but using the <strong>/dev/urandom</strong> file seems to be the most clever one.</p>
<p>The <strong>/dev/urandom</strong> device doesn&#8217;t only generate read-friendly characters, so it&#8217;s best to filter out the ones we&#8217;d like. The best tool for that would be <strong>tr</strong>.</p>
<p><strong>$ cat /dev/urandom | tr -dc [:alnum:] | head -c 10</strong></p>
<p>This will generate a password from 10 alphanumeric characters.</p>
<p>It will not include some characters though, such as <strong>. ! &#8211; _</strong> which are useful for passwords. So this line would be a little more &#8220;secure&#8221;.</p>
<p><strong>$ cat /dev/urandom | tr -cd &#8220;[:alnum:]\.\-_\!&#8221; | head -c 10<br />
</strong><br />
To generate a password in Python, using the <strong>string</strong> and <strong>random</strong> module would be a clever touch. Let&#8217;s try something like this,</p>
<pre class="brush: python; gutter: true; first-line: 1">&gt;&gt;&gt; import string, random
 &gt;&gt;&gt; def passgen(length) :
 ... keys = list(string.ascii_letters + string.digits)
 ... return "".join(random.choice(keys) for i in range(length)</pre>
<p>With this definition of the passgen function, we can generate alphanumeric passwords with whatever length we want. If you&#8217;d like to include all characters available, try the one below:</p>
<pre class="brush: python; gutter: true; first-line: 1">&gt;&gt;&gt; import string, random
 &gt;&gt;&gt; def passgen(length) :
 ... keys = list(string.ascii_letters + string.digits + ".,;:-_()@\"\\[]?!'^+*$%&amp;/=~`&lt;&gt;|")
 ... return "".join(random.choice(keys) for i in range(length)</pre>
<p>A sample output :</p>
<pre class="brush: python; gutter: true; first-line: 1">&gt;&gt;&gt; passgen(16)
 'pP!3p"(-uxdIqpAK'</pre>
<p>You can find some methods of password generation using MD5 algorithms. For example for password generation in MySQL some people prefer this method;</p>
<p><strong>&gt;SELECT SUBSTRING(MD5(RAND()) FROM 1 FOR 5)</strong></p>
<p>But this will generate very very weak passwords, no uppercase characters and a lot of characters missing, not even to mention the non-alpha numeric characters. Also you&#8217;ll have a limit for maximum character number since the MD5 algorithm has a limit for it. So it&#8217;s best to stay away from the md5 approach for password generation. Some people also use it for bash password generation too (which is wrong! due to same reasons)</p>
<p>The post <a rel="nofollow" href="https://www.veriteknik.net.tr/en/password-generation-in-unix/">Password Generation in UNIX</a> appeared first on <a rel="nofollow" href="https://www.veriteknik.net.tr/en/">VeriTeknik</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.veriteknik.net.tr/en/password-generation-in-unix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">410</post-id>	</item>
	</channel>
</rss>
