Package: pypasswords
Pypasswords - work with passwords easily.Pypasswords provides easy hashing, checking and generating passwords for you.OverviewHash passwords using your favourite hashing algorithmsCheck passwords for strength or validityGenerate passwords with your own parametersInstallationTo install this package you can use Pypi via pip$ pip install pypasswordsUsageFirst you need to import all methods from this packagefrompypasswordsimporthash_it,check_it,generate_it... or simplyfrompypasswordsimport*HashingYou can easily hash your password with just one line of code:hash_it('qwerty')>>>65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5hash_itmethod has the following parameters:password- (string)hash_type- (string).Optional. Use to specify hashing algorithm. Default:sha-256salting- (bool).Optional. Use to specify whether to use salt or not. Morehere. Default:False. Warning: if you specify salting=Truethen the method will generate random salt and return both the hash and the salt.static_salt- (string).Optional. Use to specify your own salt.salt_length- (int).Optional. Use to specify the length of the salt. Default:6local_parameter- (string).Optional. Use to specify local parameter. Morehere.Examples:hash_it('qwerty',hash_type='sha512')>>>d8578edf8458ce06fbc5bb76a58c5ca4hash_it('qwerty',salting=True,static_salt='some_word')>>>('c4f5d86792a50717d99fba1807d489a7f59ff7a95a293facd2b8c628a17cb722','some_word')hash_it('qwerty',salting=True,salt_length=10,local_parameter='word')>>>('bb5310271a8d927f6cf45ad5d1442e2c0d3c7f3bdb68681022688d0555724ed5','0<JM]bdTV!')CheckingYou can check your password for strength or validity:check_it('qwerty')check_itmethod has the following parameters:password- (string)check_type- (string).Optional. There are 2 check types: strength and valid. Default:strengthstrengthcheck type will return number indicating strength of your password. If strength more than 10 then the password is strong.validcheck type will return True or False whether password has 'stop chars' or not. You have to specifystop_charsto use this check type.stop_chars- (string).Optional. Use to specify stop characters to check your password for validity.Examples:check_it('123some-password321')>>>11# strong passwordcheck_it('qwerty',check_type='valid',stop_chars='0123456789')>>>TrueGeneratingYou can generate password with your own parameters:generate_it()generate_itmethod has the following parameters:strength- (int).Optional. Defalut:21-low. Using letters only.2-medium. Using letters and numbers.3-high. Using letters, numbers and symbols.length- (int).Optional. Use to specify password length. Default:12Examples:generate_it(strength=2)>>>3XXCltDo4obbgenerate_it(strength=3,length=12)>>>(W:rbP!253UYMatchingYou can match password with some password's hash:match_it('entered_password','d8578edf8458ce06fbc5bb76a58c5ca4')match_itmethod has the following parameters:password- (string). The password you want to match with your hashhash- (string). The hash you want to match with your passwordshash_type- (string).Optional. Use to specify hashing algorithm. Default:sha-256salt- (string).Optional. Use to specify password's salt. Morehere.local_parameter- (string).Optional. Use to specify local parameter. Morehere.Examples:match_it('hello',2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824)>>>Truematch_it('hello','5d41402abc4b2a76b9719d911017c592',hash_type='md5',salt='123',local_parameter='321')>>>FalseLicenseMITPypasswords uses one open source package to work properly:zxcvbn- password strength estimatorAnd of coursepypasswordsitself is open source with apublic repositoryon GitHub.