<p>I am looking for a simple unpatented one-way encryption algorithm, preferably in c.
I would like to use it to validate passwords.</p>

[{'answer_id': 69634, 'author': 'mike511', 'author_id': 9593, 'author_profile': 'https://Stackoverflow.com/users/9593', 'pm_score': 1, 'selected': False, 'text': '<p>just use the crypt(3) function</p>\n\n<p>here\'s the <a href="http://en.wikipedia.org/wiki/Crypt_(Unix)" rel="nofollow noreferrer">background</a></p>\n'}, {'answer_id': 69635, 'author': 'nickf', 'author_id': 9021, 'author_profile': 'https://Stackoverflow.com/users/9021', 'pm_score': 0, 'selected': False, 'text': '<p>MD5 has suited me fine so far.</p>\n'}, {'answer_id': 69639, 'author': 'Jeremy', 'author_id': 1114, 'author_profile': 'https://Stackoverflow.com/users/1114', 'pm_score': 5, 'selected': True, 'text': '<p><a href="http://en.wikipedia.org/wiki/SHA-1" rel="nofollow noreferrer">SHA-1 and the rest of its family</a>  were patented by the US government which "has released the patent under a royalty free license". Many public-domain implementations <a href="http://www.google.ca/search?q=sha+c+implementation" rel="nofollow noreferrer">may be found through Google</a>. <code>:-)</code></p>\n'}, {'answer_id': 69649, 'author': 'Brent.Longborough', 'author_id': 9634, 'author_profile': 'https://Stackoverflow.com/users/9634', 'pm_score': 1, 'selected': False, 'text': '<p>SHA-1 seems like a good suggestion, or, if you believe that SHA-1 is close to being cracked, one of the SHA-2 family.</p>\n\n<p>You may feel that MD5 isn\'t "safe" enough.</p>\n'}, {'answer_id': 70315, 'author': 'Roel', 'author_id': 11449, 'author_profile': 'https://Stackoverflow.com/users/11449', 'pm_score': 2, 'selected': False, 'text': '<p>The correct name for \'one-way encryption algorithm\' is \'hashing algorithm\' (you did mean a way to \'scramble\' a password so that it can never be recovered, right?)</p>\n\n<p>Do not use md5 in modern applications, successful attacks on it have been showing up since 2004 (see <a href="http://www.doxpara.com/md5_someday.pdf" rel="nofollow noreferrer">http://www.doxpara.com/md5_someday.pdf</a> for references). Use the SHA family.</p>\n'}, {'answer_id': 250106, 'author': 'pipTheGeek', 'author_id': 28552, 'author_profile': 'https://Stackoverflow.com/users/28552', 'pm_score': 0, 'selected': False, 'text': '<p>MD5 and SHA512 (or another SHA-2 variant) both have theoretical vulnerabilities identified in them.  I don\'t think SHA has yet been demonstrated as broken but the possability exists.  Whirlpool is a royalty free hash algorithm that has (as yet) not shown any weakness.\n<a href="http://paginas.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html" rel="nofollow noreferrer">This page</a> has a link to the C reference implementation.</p>\n'}, {'answer_id': 8196581, 'author': 'Xavier Combelle', 'author_id': 128629, 'author_profile': 'https://Stackoverflow.com/users/128629', 'pm_score': 2, 'selected': False, 'text': '<p>In fact using a hash is not enought. you should use a <a href="https://en.wikipedia.org/wiki/Salt_%28cryptography%29" rel="nofollow">salt</a> to limit them and a more advanced technique such as <a href="https://en.wikipedia.org/wiki/Bcrypt" rel="nofollow">bcrypt</a> limits the possibilities of guessing the password </p>\n'}]
['https://Stackoverflow.com/questions/69627', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3740/']