Top-rated recipes tagged "password"http://code.activestate.com/recipes/tags/password/top/2016-01-13T00:46:40-08:00ActiveState Code RecipesLeft-handed password generator (Python) 2011-10-31T12:51:14-07:00Alexhttp://code.activestate.com/recipes/users/4179771/http://code.activestate.com/recipes/577930-left-handed-password-generator/ <p style="color: grey"> Python recipe 577930 by <a href="/recipes/users/4179771/">Alex</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/lefthand/">lefthand</a>, <a href="/recipes/tags/lefthanded/">lefthanded</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/passwords/">passwords</a>). Revision 2. </p> <p>Generate passwords that can easily be typed with only the left hand, very simple script</p> System Authentication against /etc/shadow or /etc/passwd (Python) 2013-03-11T12:40:10-07:00James Millshttp://code.activestate.com/recipes/users/4167757/http://code.activestate.com/recipes/578489-system-authentication-against-etcshadow-or-etcpass/ <p style="color: grey"> Python recipe 578489 by <a href="/recipes/users/4167757/">James Mills</a> (<a href="/recipes/tags/authentication/">authentication</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/system/">system</a>). </p> <p>Sometimes it's useful to perform System Authentication against a Local System using the /etc/shadow or /etc/passwd password databases. This recipe provides a simple function that does exactly that.</p> Password Generator (Python) 2011-10-14T13:35:21-07:00Alexander Thomas Cruzhttp://code.activestate.com/recipes/users/4179528/http://code.activestate.com/recipes/577905-password-generator/ <p style="color: grey"> Python recipe 577905 by <a href="/recipes/users/4179528/">Alexander Thomas Cruz</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/randomization/">randomization</a>). Revision 4. </p> <p>Generates a really strong and secure password. It uses multiple characters and symbols. Remember to score please! It really means a lot to me. Revision 4 includes an input so you can choose how many characters you want your password to have. It is also faster due to a suggestion by Garel Alex. Thanks!</p> Secure Password Generator (Python) 2011-06-17T15:25:20-07:00amir naghavihttp://code.activestate.com/recipes/users/4177294/http://code.activestate.com/recipes/577759-secure-password-generator/ <p style="color: grey"> Python recipe 577759 by <a href="/recipes/users/4177294/">amir naghavi</a> (<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/random/">random</a>). </p> <p>A password generator that uses OS facilities to generate none pseudo random numbers. the SystemRandom uses CryptGenRandom in Windows and /dev/random in linux and it is so better to use this to create random numbers in cryptography or any other security areas.</p> Random Passwords (Python) 2010-07-27T20:28:17-07:00Danillo Souzahttp://code.activestate.com/recipes/users/4174445/http://code.activestate.com/recipes/577339-random-passwords/ <p style="color: grey"> Python recipe 577339 by <a href="/recipes/users/4174445/">Danillo Souza</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/random/">random</a>). </p> <p>Generate strong random passwords of specified length.</p> A nicer password container than str (Python) 2012-06-23T18:00:21-07:00david.gaarenstroomhttp://code.activestate.com/recipes/users/4168848/http://code.activestate.com/recipes/576905-a-nicer-password-container-than-str/ <p style="color: grey"> Python recipe 576905 by <a href="/recipes/users/4168848/">david.gaarenstroom</a> (<a href="/recipes/tags/passwd/">passwd</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/passwords/">passwords</a>, <a href="/recipes/tags/security/">security</a>). Revision 3. </p> <p>Because I did not want to expose my passwords in plain text whenever an exception was thrown or inside the debugger, I wrote this simple snippet. It's very simple, but can be quite useful nonetheless...</p> add password masking ability to getpass.getpass() (Python) 2016-01-13T00:46:40-08:00KingMakhttp://code.activestate.com/recipes/users/4193393/http://code.activestate.com/recipes/579148-add-password-masking-ability-to-getpassgetpass/ <p style="color: grey"> Python recipe 579148 by <a href="/recipes/users/4193393/">KingMak</a> (<a href="/recipes/tags/character/">character</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/getpass/">getpass</a>, <a href="/recipes/tags/hiding/">hiding</a>, <a href="/recipes/tags/masking/">masking</a>, <a href="/recipes/tags/msvcrt/">msvcrt</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>adding the ability to display a password masking character of the programmer's choice</p> Random Password Generation (Python) 2014-08-10T15:50:40-07:00Paul Wolfhttp://code.activestate.com/recipes/users/4190553/http://code.activestate.com/recipes/578920-random-password-generation/ <p style="color: grey"> Python recipe 578920 by <a href="/recipes/users/4190553/">Paul Wolf</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/random/">random</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/strong/">strong</a>). </p> <p>Generate a password (or other secure token) using a pattern language similar to regular expressions. We'll use the <code>strgen</code> module that enables a user to generate test data, unique ids, passwords, vouchers or other randomized data very quickly using a template language. The template language is superficially similar to regular expressions but instead of defining how to match or capture strings, it defines how to generate randomized strings.</p> Password Generator (mkpasswd) (Python) 2013-07-31T23:23:02-07:00James Millshttp://code.activestate.com/recipes/users/4167757/http://code.activestate.com/recipes/578468-password-generator-mkpasswd/ <p style="color: grey"> Python recipe 578468 by <a href="/recipes/users/4167757/">James Mills</a> (<a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/mkpasswd/">mkpasswd</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/secure/">secure</a>). Revision 3. </p> <p>Since everyone is posting one of these, I thought I'd post mine. I wrote this many years ago and use it everywhere.</p> Set windows 7 to lock itself (upon timeout) if no internet connection found - security measure (Python) 2012-07-09T20:56:22-07:00commentator8http://code.activestate.com/recipes/users/4182761/http://code.activestate.com/recipes/578200-set-windows-7-to-lock-itself-upon-timeout-if-no-in/ <p style="color: grey"> Python recipe 578200 by <a href="/recipes/users/4182761/">commentator8</a> (<a href="/recipes/tags/lock/">lock</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/windows/">windows</a>, <a href="/recipes/tags/windows_registry/">windows_registry</a>). Revision 2. </p> <p>This script (or exe if using web2py with """setup(windows=['locker2.py']))""") can be run as a task in windows every x minutes and will test for the presence of an internet connection and depending on whether it is found will set windows to lock after a given timeout without user activity.</p> <p>This was made with help from random code snippets from around the web.</p> <p>Tested only on windows 7.</p> Password Generator (Short Code) (Python) 2011-11-18T03:02:13-08:00Alexander James Wallarhttp://code.activestate.com/recipes/users/4179768/http://code.activestate.com/recipes/577949-password-generator-short-code/ <p style="color: grey"> Python recipe 577949 by <a href="/recipes/users/4179768/">Alexander James Wallar</a> (<a href="/recipes/tags/alphabet/">alphabet</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/lambda/">lambda</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/passwords/">passwords</a>, <a href="/recipes/tags/password_generator/">password_generator</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/secure/">secure</a>, <a href="/recipes/tags/security/">security</a>, <a href="/recipes/tags/short_code/">short_code</a>). Revision 2. </p> <p>This recipe generates a pseudo-random password of a prescribed length. It also lets you specify what characters are not permitted in the password or specify what characters are.</p> Next Lexographic Word (Java) 2010-07-18T11:33:38-07:00st0lehttp://code.activestate.com/recipes/users/4174421/http://code.activestate.com/recipes/577315-next-lexographic-word/ <p style="color: grey"> Java recipe 577315 by <a href="/recipes/users/4174421/">st0le</a> (<a href="/recipes/tags/bruteforce/">bruteforce</a>, <a href="/recipes/tags/java/">java</a>, <a href="/recipes/tags/password/">password</a>). </p> <p>Generates next lexographically occuring word, say "aaa" -> "aab" -> "aac"</p> <p>Can be used for password cracking....</p> Generate an alpha-numeric password salt (PHP) 2010-02-25T14:07:08-08:00Jayesh Shethhttp://code.activestate.com/recipes/users/4173165/http://code.activestate.com/recipes/577071-generate-an-alpha-numeric-password-salt/ <p style="color: grey"> PHP recipe 577071 by <a href="/recipes/users/4173165/">Jayesh Sheth</a> (<a href="/recipes/tags/md5/">md5</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/random_number/">random_number</a>, <a href="/recipes/tags/salt/">salt</a>). </p> <p>Generate an alpha-numeric password salt (with a default of 32 characters)</p> Generate a salt (PHP) 2012-07-10T19:52:17-07:00Xavier L.http://code.activestate.com/recipes/users/4171602/http://code.activestate.com/recipes/576894-generate-a-salt/ <p style="color: grey"> PHP recipe 576894 by <a href="/recipes/users/4171602/">Xavier L.</a> (<a href="/recipes/tags/crypt/">crypt</a>, <a href="/recipes/tags/generation/">generation</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/hash/">hash</a>, <a href="/recipes/tags/pass/">pass</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/salt/">salt</a>, <a href="/recipes/tags/secure/">secure</a>, <a href="/recipes/tags/security/">security</a>, <a href="/recipes/tags/string/">string</a>). Revision 6. </p> <p>This function will generate a salt for use with passwords ranging using characters in range a to z, A to Z, 0 to 9 and !@#$%&amp;<em>?. The characters are sorted in a random value and can appear more than one time in the string. This way, this function is more powerful than the *shuffle()</em> function. This means that the salt could also be longer than the character list.</p> Code To Store Encrypted Password in a File (Python) 2013-01-19T04:07:50-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578430-code-to-store-encrypted-password-in-a-file/ <p style="color: grey"> Python recipe 578430 by <a href="/recipes/users/4184772/">Captain DeadBones</a> (<a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>This snippet of code was written as part of an article - <a href="http://thelivingpearl.com/2013/01/18/password-protecting-your-python-application/">Password Protecting You Python Application</a></p> Password Request Code + Reading Password from File (Python) 2013-01-19T04:06:45-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578429-password-request-code-reading-password-from-file/ <p style="color: grey"> Python recipe 578429 by <a href="/recipes/users/4184772/">Captain DeadBones</a> (<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>This snippet of code was written as part of an article - <a href="http://thelivingpearl.com/2013/01/18/password-protecting-your-python-application/">Password Protecting You Python Application</a></p> Very Simple Password Generator in Python (Python) 2013-01-02T14:28:34-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578395-very-simple-password-generator-in-python/ <p style="color: grey"> Python recipe 578395 by <a href="/recipes/users/4184772/">Captain DeadBones</a> (<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/password_generator/">password_generator</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>A one liner password generator in python. Was writen as part of an article I wrote on <a href="http://thelivingpearl.com/2013/01/02/generating-and-checking-passwords-in-python/">generating password</a>.</p> Just Another Password Generator (Python) 2012-06-21T15:41:10-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578171-just-another-password-generator/ <p style="color: grey"> Python recipe 578171 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/passwords/">passwords</a>, <a href="/recipes/tags/password_generator/">password_generator</a>, <a href="/recipes/tags/utility/">utility</a>). </p> <p>The following two programs are simple examples of how one might go about creating a password generator. The first one was created several years ago and was designed to return passwords where similarly classed characters would not appear beside each other. It works but gets unbearably slow when passwords exceed about forty characters. The second program was designed with similar requirements runs considerably better. Eight-character passwords appear to have the same randomness to their construction, and this program is considerably faster than the first. Hopefully, these program design differences will be helpful to others trying to write their own password generator.</p> Password Card Generator (Python) 2012-01-26T02:37:30-08:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/578027-password-card-generator/ <p style="color: grey"> Python recipe 578027 by <a href="/recipes/users/4179007/">userend</a> (<a href="/recipes/tags/card/">card</a>, <a href="/recipes/tags/create/">create</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/passwd/">passwd</a>, <a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/secret/">secret</a>). </p> <p>This project was inspired by the <a href="http://passwordcard.org" rel="nofollow">passwordcard.org</a> website. I wanted to see if I could do the same thing using Python. Select a password using this convenient card that you carry with you. </p> Verify Username and Password Using a File for Storage (Python) 2013-01-31T02:11:24-08:00Captain DeadBoneshttp://code.activestate.com/recipes/users/4184772/http://code.activestate.com/recipes/578446-verify-username-and-password-using-a-file-for-stor/ <p style="color: grey"> Python recipe 578446 by <a href="/recipes/users/4184772/">Captain DeadBones</a> (<a href="/recipes/tags/password/">password</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/usernames/">usernames</a>). </p> <p>This script was written for an article I wrote to check user passwords. It stores data using SHA one-way function. For more information <a href="http://thelivingpearl.com/2013/01/29/authentication-of-users-and-passwords-in-python/">Authentication Of Users And Passwords In Python</a></p>