<?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>Linux, MySQL, PhP, Perl... &#187; password linux perl encrypt hash loop</title>
	<atom:link href="http://linux.bgsnow.com/tag/password-linux-perl-encrypt-hash-loop/feed" rel="self" type="application/rss+xml" />
	<link>http://linux.bgsnow.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 16:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Strong Password Generator in Perl</title>
		<link>http://linux.bgsnow.com/strong-password-generator-in-perl.php</link>
		<comments>http://linux.bgsnow.com/strong-password-generator-in-perl.php#comments</comments>
		<pubDate>Sat, 01 Aug 2009 10:09:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[password linux perl encrypt hash loop]]></category>

		<guid isPermaLink="false">http://linux.bgsnow.com/?p=129</guid>
		<description><![CDATA[Here is a simple and strong password generator in Perl. #!/usr/bin/perl print "Script PASS: "; chomp(my $salt = &#60;STDIN&#62;); { print "Enter keyword: "; chomp(my $string = &#60;STDIN&#62;); #Take the input from the user and remove the n last if $string eq 'q'; my $encrypted_string = crypt($string,$salt); #take the string and the salt and put [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple and <strong>strong</strong> password generator in Perl.</p>
<p><span style="color: #333399;">#!/usr/bin/perl</span></p>
<p><span style="color: #333399;">print "Script PASS: ";</span></p>
<p><span style="color: #333399;">chomp(my $salt = &lt;STDIN&gt;);</span></p>
<p><span style="color: #333399;">{</span></p>
<p><span style="color: #333399;">print "Enter keyword: ";</span></p>
<p><span style="color: #333399;">chomp(my $string = &lt;STDIN&gt;); #Take the input from the user and remove the n</span></p>
<p><span style="color: #333399;">last if $string eq 'q';</span></p>
<p><span style="color: #333399;">my $encrypted_string = crypt($string,$salt); #take the string and the salt and put through crypt()</span></p>
<p><span style="color: #333399;">print $encrypted_string.'Z'."\n\n"; #Change Z to something else for additional security.</span></p>
<p><span style="color: #333399;">redo;</span></p>
<p><span style="color: #333399;">}</span></p>
<p>How does it work. First, we have assumed you are on Linux, of course <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If not, you will probably require <a href="http://www.activestate.com/activeperl/">ActivePerl</a>.</p>
<p>First, the script asks you for the script password. This password will be the Salt for the hash generation.  This means that without the main password the generated hashes will be incorrect. However, if someone knows your main password, it is not enough. He will also need the script.</p>
<p>Once your enter the main password, you will be asked for a keyword to generate the hash for. For example, if you have an account in example.org you can generate its password with the keyword 'example.org'.</p>
<p>Needless to say, you will be generating / using different passwords for the different accounts / sites. This is a good practice but can be quite confusing if your don't automate it <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In the hash generation, there is a Z added. This is like a personal token which must be customized for better protection.</p>
<p>This script will ensure your passwords (generated hashes) are <strong>very</strong> strong, still easily retrievable <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Even if someone finds a password for your account, it will be absolutely impossible to find another one. An attacker will need to gain at least a few passwords and chances are not big to reproduce a password for a different account.</p>
<p>Also the script will leave no traces / history about the job. So you will not expose your hyper-turbo-ultra secure password to someone who can just read your bash history for example.</p>
<p>Last but not least, you don't have to run the script anew each time you need a password for something. It is stuck in a loop until you press 'q' of course <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The only drawback is that it shows the main password and someone could peek over your shoulders <img src='http://linux.bgsnow.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This could be resolved but will require additional perl modules and makes it hard to port the script to a new system...</p>
]]></content:encoded>
			<wfw:commentRss>http://linux.bgsnow.com/strong-password-generator-in-perl.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
