Package: passwordManagerByAscii
passwordManagerByAscii PackageA pacakge that can generate, validate, encode, and decode passwords. built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.Checkout our packageat pypiAuthorsVictoria Zhang:GithubJenny Shen:GithubTiffany Lee:GithubSeok Tae Kim:GithubKhalifa AlFalasi:GithubFunctionsValidate PasswordThe 'validate_password' function can test if the user generated password is valid.In this package, there are two ways for users to generate password.Users can use the generate password function to generate a random password that meets the requirementUsers can type in their own password and check if the user generated password is valid.Validate function is applicable for #2.When users generate a password, it checks if the password is at least 6 characters, contains at least 1 special character, 1 number, and 1 capital alphabet to maintain security.frompasswordManagerByAsciiimportvalidate# the parameter would take the user inputvalidate=validate.validate_pasword('Password123@')Generate PasswordThegenerate_passwordfunction can generate a random password within length 6 to 15. The password is guarantee meet the requirement above.Generate a password given a length. Note: if the length is greater than 15 or lower than 6. It will generate a random password  within the 6 and 15 range.frompasswordManagerByAsciiimportgeneratorpassword=generator.generate_password(10)Generate a password without specifying length. Will generate a password with random length within 6 and 15 range.frompasswordManagerByAsciiimportgeneratorpassword=generator.generate_password()Encode PasswordTheencode_passwordfunction can encrypt a password with any length.The encryption follows the following rules given a string:reverse the stringswap the char pairsadd dec by their (index+1), then (2(index+1), then 3(index+1) 3 times (3 character per string)
Note: if the calculated value is over 126 then loop to 33 again by adding on the remainder.frompasswordManagerByAsciiimportencryptencrypted=encrypt.encode_password("hello")Decode PasswordThedecode_passwordfunction can decrypt an encrypted password that is created by theencode_passwordfunction.Function takes in a string type and will raise error if unmatched types are given.Function will also raise error if the value in the string either does not match encryption format, or if any of the character is not in the decimal range of 33 to 126.Function returns a decoded string.frompasswordManagerByAsciiimportdecoder,encryptencrypted_password=encrypt.encode_password('hello')decoded_password=decoder.decode_password(encrypted_password)#decoded_password is 'hello'How to Install and use the PackageCreate apipenv-managed virtual environment and install the latest version of the packagepipenv install -i https://pypi.org/project/passwordManagerByAscii/0.2.2/(Note that if you've previously created a pipenv virtual environment in the same directory, you may have to delete the old one first. Find out where it is located with thepipenv --venvcommand.)Activate the virtual environment using this commandpipenv shellCreate a Python program file that imports the package and uses it. Check thefunctionssection to see implementation in program.Run the program using this commandpython3 my_program_filename.pyExit the virtual environment with the commandexitHow to test packageSet up virtual enviroment following stepsnumber 1Activate the virtual enviromentpipenv shellInstall required packages to test and build the packagepipenv install pytest
pipenv install buildBuild the packagepython -m buildTest the package from main directory!python3 -m pytestExit the virtual environment with the commandexitExample programExample application:a password management programThe example application prompts the user to choose one of the five options by entering a number from 1 - 5:Generate Password: which prompts the user to enter a length between 6 to 15 characters. If the length was less than 6 characters or greater than 15 characters, thegenerate_passwordfunction will randomly generate a password in the range of 6 to 15. The generated password will be printed.Encrypt Password: which prompts the user to input a password which will be encrypted using theencode_passwordfunction. Both the password provided by the user and the encrypted password will be printed.Decrypt Password: which prompts the user to input a password which will be decrypted using thedecode_password. Both the password provided by the user and the decrypted password will be printed.Validate password: which prompts the user to enter a password which will be passed to thevalidate_passwordfunction. A message stating whether the password is valid or not will be printed.Exit program: which will end the program.The program will keep prompting the user to choose an option unless the user enters the integer 5 which will end the program. Any input less than 1 or greater than 5 when choosing an option will result in an error message being printed and prompting the user to try again.To access, click on the following linka password management programTo run the program, follow the instructions found above under theHow to Install and use the Packagesection.