diff --git a/passgen-py/cli-2.png b/passgen-py/cli-2.png new file mode 100644 index 0000000..086c9fe Binary files /dev/null and b/passgen-py/cli-2.png differ diff --git a/passgen-py/cli-banner.gif b/passgen-py/cli-banner.gif new file mode 100644 index 0000000..29f3c62 Binary files /dev/null and b/passgen-py/cli-banner.gif differ diff --git a/passgen-py/cli-tool/__pycache__/passgen.cpython-38.pyc b/passgen-py/cli-tool/__pycache__/passgen.cpython-38.pyc new file mode 100644 index 0000000..833afb2 Binary files /dev/null and b/passgen-py/cli-tool/__pycache__/passgen.cpython-38.pyc differ diff --git a/passgen-py/cli-tool/cli-banner.png b/passgen-py/cli-tool/cli-banner.png new file mode 100644 index 0000000..3672844 Binary files /dev/null and b/passgen-py/cli-tool/cli-banner.png differ diff --git a/passgen-py/cli-tool/passgen.py b/passgen-py/cli-tool/passgen.py new file mode 100644 index 0000000..3147f5e --- /dev/null +++ b/passgen-py/cli-tool/passgen.py @@ -0,0 +1,74 @@ +import string +import random +import argparse +import sys +import pyperclip + +parser = argparse.ArgumentParser(description="Password Generator") +parser.add_argument('-s', '--service', type = str, help = "Name of the Website where u want to use it", default='Facebook') +parser.add_argument('-l', '--len', type = int, help = "Length of the Password", default=8) +parser.add_argument('-sm', '--small', type = int, help = "Number of lower case characters", default=2) +parser.add_argument('-bg', '--big', type = int, help = "Number of upper case characters", default=2) +parser.add_argument('-nm', '--number', type = int, help = "Number of digits", default=2) +parser.add_argument('-sc', '--special', type = int, help = "Number of special characters", default=2) +args = parser.parse_args() + +def passgen(service, len, small, big, number, special): + k1 = string.ascii_lowercase + k2 = string.ascii_uppercase + k3 = string.digits + k4 = string.punctuation + + m1 = list(k1) + m2 = list(k2) + m3 = list(k3) + m4 = list(k4) + + random.shuffle(m1) + random.shuffle(m2) + random.shuffle(m3) + random.shuffle(m4) + + m5 = m1[:small] + m6 = m2[:big] + m7 = m3[:number] + m8 = m4[:special] + + p = [] + + p.extend(m5) + p.extend(m6) + p.extend(m7) + p.extend(m8) + random.shuffle(p) + + q = [] + + q.extend(m1) + q.extend(m2) + q.extend(m3) + q.extend(m4) + random.shuffle(q) + + r = [] + r.extend(p) + r.extend(q) + + pd = r[:len] + + password = "".join(pd) + + print(password) + + pyperclip.copy(password) + + file = open("passwords.txt", 'a') + file.write(service) + file.write(" : ") + file.write(password) + file.write('\n') + file.close + + +if __name__ == '__main__': + passgen(args.service, args.len, args.small, args.big, args.number, args.special) diff --git a/passgen-py/cli-tool/passgen.spec b/passgen-py/cli-tool/passgen.spec new file mode 100644 index 0000000..85b74ba --- /dev/null +++ b/passgen-py/cli-tool/passgen.spec @@ -0,0 +1,34 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(['passgen.py'], + pathex=['/Users/kunal/Desktop/passgen-py/KUNAL/cli-tool'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='passgen', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True ) diff --git a/passgen-py/cli-tool/passwords.txt b/passgen-py/cli-tool/passwords.txt new file mode 100644 index 0000000..e1ec5ea --- /dev/null +++ b/passgen-py/cli-tool/passwords.txt @@ -0,0 +1,26 @@ +Facebook : XmBIA87| +Instagram : {:+9sr5 +IGO : ^y:3a2EA +IGO : q@:3Ma1C +IGO : 4r$SGy5_ +Facebook : Q;yx5$O9 +Facebook : 27`Nw:Vr +kunal : Z$wA1r9# +Facebook : N9 +Facebook : g*D6!L3k +Facebook : urCE61]"urpbtwx +kp : nxJLP6581^?nxu +Facebook : drEC03<# +fb : chUC76>$ +fb2 : paCX219~$=paj diff --git a/passgen-py/lib/passgen/build/lib/passgen/__init__.py b/passgen-py/lib/passgen/build/lib/passgen/__init__.py new file mode 100644 index 0000000..6597749 --- /dev/null +++ b/passgen-py/lib/passgen/build/lib/passgen/__init__.py @@ -0,0 +1,64 @@ +import string +import random +import argparse +import sys +import pyperclip + +parser = argparse.ArgumentParser(description="Password Generator") +parser.add_argument('-s', '--service', type = str, help = "Name of the Website where u want to use it", default='Facebook') +parser.add_argument('-l', '--len', type = int, help = "Length of the Password", default=8) +parser.add_argument('-sm', '--small', type = int, help = "Number of lower case characters", default=2) +parser.add_argument('-bg', '--big', type = int, help = "Number of upper case characters", default=2) +parser.add_argument('-nm', '--number', type = int, help = "Number of digits", default=2) +parser.add_argument('-sc', '--special', type = int, help = "Number of special characters", default=2) +args = parser.parse_args() + +def passgen(service, len, small, big, number, special): + k1 = string.ascii_lowercase + k2 = string.ascii_uppercase + k3 = string.digits + k4 = string.punctuation + + m1 = list(k1) + m2 = list(k2) + m3 = list(k3) + m4 = list(k4) + + random.shuffle(m1) + random.shuffle(m2) + random.shuffle(m3) + random.shuffle(m4) + + m5 = m1[:small] + m6 = m2[:big] + m7 = m3[:number] + m8 = m4[:special] + + p = [] + + p.extend(m5) + p.extend(m6) + p.extend(m7) + p.extend(m8) + p.extend(m1) + p.extend(m2) + p.extend(m3) + p.extend(m4) + + pd = p[:len] + + password = "".join(pd) + + print(password) + pyperclip.copy(password) + + file = open("passwords.txt", 'a') + file.write(service) + file.write(" : ") + file.write(password) + file.write('\n') + file.close + + +if __name__ == '__main__': + passgen(args.service, args.len, args.small, args.big, args.number, args.special) diff --git a/passgen-py/lib/passgen/dist/passgen-1.0.0-py3-none-any.whl b/passgen-py/lib/passgen/dist/passgen-1.0.0-py3-none-any.whl new file mode 100644 index 0000000..ed93815 Binary files /dev/null and b/passgen-py/lib/passgen/dist/passgen-1.0.0-py3-none-any.whl differ diff --git a/passgen-py/lib/passgen/passgen.egg-info/PKG-INFO b/passgen-py/lib/passgen/passgen.egg-info/PKG-INFO new file mode 100644 index 0000000..a2e9f0b --- /dev/null +++ b/passgen-py/lib/passgen/passgen.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: passgen +Version: 1.0.0 +Summary: This is a CLI for Password Generation +Home-page: UNKNOWN +Author: Kunal +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN diff --git a/passgen-py/lib/passgen/passgen.egg-info/SOURCES.txt b/passgen-py/lib/passgen/passgen.egg-info/SOURCES.txt new file mode 100644 index 0000000..e046d49 --- /dev/null +++ b/passgen-py/lib/passgen/passgen.egg-info/SOURCES.txt @@ -0,0 +1,6 @@ +setup.py +passgen/__init__.py +passgen.egg-info/PKG-INFO +passgen.egg-info/SOURCES.txt +passgen.egg-info/dependency_links.txt +passgen.egg-info/top_level.txt \ No newline at end of file diff --git a/passgen-py/lib/passgen/passgen.egg-info/dependency_links.txt b/passgen-py/lib/passgen/passgen.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/passgen-py/lib/passgen/passgen.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/passgen-py/lib/passgen/passgen.egg-info/top_level.txt b/passgen-py/lib/passgen/passgen.egg-info/top_level.txt new file mode 100644 index 0000000..6fe038b --- /dev/null +++ b/passgen-py/lib/passgen/passgen.egg-info/top_level.txt @@ -0,0 +1 @@ +passgen diff --git a/passgen-py/lib/passgen/passgen/__init__.py b/passgen-py/lib/passgen/passgen/__init__.py new file mode 100644 index 0000000..6597749 --- /dev/null +++ b/passgen-py/lib/passgen/passgen/__init__.py @@ -0,0 +1,64 @@ +import string +import random +import argparse +import sys +import pyperclip + +parser = argparse.ArgumentParser(description="Password Generator") +parser.add_argument('-s', '--service', type = str, help = "Name of the Website where u want to use it", default='Facebook') +parser.add_argument('-l', '--len', type = int, help = "Length of the Password", default=8) +parser.add_argument('-sm', '--small', type = int, help = "Number of lower case characters", default=2) +parser.add_argument('-bg', '--big', type = int, help = "Number of upper case characters", default=2) +parser.add_argument('-nm', '--number', type = int, help = "Number of digits", default=2) +parser.add_argument('-sc', '--special', type = int, help = "Number of special characters", default=2) +args = parser.parse_args() + +def passgen(service, len, small, big, number, special): + k1 = string.ascii_lowercase + k2 = string.ascii_uppercase + k3 = string.digits + k4 = string.punctuation + + m1 = list(k1) + m2 = list(k2) + m3 = list(k3) + m4 = list(k4) + + random.shuffle(m1) + random.shuffle(m2) + random.shuffle(m3) + random.shuffle(m4) + + m5 = m1[:small] + m6 = m2[:big] + m7 = m3[:number] + m8 = m4[:special] + + p = [] + + p.extend(m5) + p.extend(m6) + p.extend(m7) + p.extend(m8) + p.extend(m1) + p.extend(m2) + p.extend(m3) + p.extend(m4) + + pd = p[:len] + + password = "".join(pd) + + print(password) + pyperclip.copy(password) + + file = open("passwords.txt", 'a') + file.write(service) + file.write(" : ") + file.write(password) + file.write('\n') + file.close + + +if __name__ == '__main__': + passgen(args.service, args.len, args.small, args.big, args.number, args.special) diff --git a/passgen-py/lib/passgen/setup.py b/passgen-py/lib/passgen/setup.py new file mode 100644 index 0000000..d0dfe47 --- /dev/null +++ b/passgen-py/lib/passgen/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup +setup( name = "passgen", version = '1.0.0', description = 'This is a CLI for Password Generation', author = 'Kunal', packages = ['passgen'], install_requires = []) + diff --git a/passgen-py/readme.md b/passgen-py/readme.md new file mode 100644 index 0000000..a17406b --- /dev/null +++ b/passgen-py/readme.md @@ -0,0 +1,145 @@ +[![MasterHead](https://raw.githubusercontent.com/kunal-mahatha/passgen-py/main/KUNAL/cli-banner.gif)](https://username.github.io) + +# This repository is a combination of two directories + - CLI tool **(cli-tool)** + - Custom Library or Module **(lib)** + +# + +# CLI tool **(cli-tool)** + +[![MasterHead](https://raw.githubusercontent.com/kunal-mahatha/passgen-py/main/KUNAL/cli-tool/cli-banner.png)](https://username.github.io) + +### Installing Dependencies + +```python +pip install argparse +``` +```python +pip install pyperclip +``` + +### About the Tool +This generates a password for your services like **Facebook, Instagram, etc.**, copy it to the **clipboard**, and stores them in a **text file** named `passwords.txt` . + +To view the saved passwords [Click Here](https://github.com/kunal-mahatha/passgen-py/blob/main/KUNAL/cli-tool/passwords.txt) + +### Features + - This tool generates an user **customized** password. User can enter the Length, number of lower and upper cases characters, number of numerals and special characters. + - After password generation it **copies** it to the clipboard, from where it can pe easily pasted anywhere. + - It uses the **Fisher-Yates shuffle** which runs in O(n) time and also proven to be a perfect shuffle, so it takes less time with high randomness. + +### Usage + To use this : + - Clone the Repository + ```python3 + git clone https://github.com/kunal-mahatha/passgen-py.git + ``` + - locate the `passgen.py` + ```python3 + cd passgen-py/KUNAL/cli-tool + ``` + - make a executable file of `passgen.py` + ```python + pyinstaller --onefile passgen.py + ``` + - locate the `passgen` exe file + ```python + cd dist/passgen + ``` + - copy the `passgen` exe file to the path variable + ```python + cp passgen-py/KUNAL/cli-tool/dist/passgen + ``` + - run the `passgen` file + ```python +passgen -s "facebook" -l 12 -sm 2 -bg 3 -nm 3 -sc 2 +``` +# + +| Arguments | Description | +| ---------------------|----------------------------------------------------------------------------------------------------| +|`-s ` or `--service ` | is about the service that user want to use the password for, example **Facebook, Instagram, etc.** | +|`-l` or `--length` | is for the length of the password | +|`-sm ` or `--small ` | is for number of lowercase characters.| +|`-bg ` or `--big ` | is for number of uppercase characters.| +|`-nm ` or `--number ` | is for number of numerals.| +|`-sc ` or `--special `| is for number of special characters.| + +# + + +### Default values of the flags +If the user uses it without using of any flags `-s` `-l` `-sm` `-bg` `-nm` `-sc `, then it will generate a password of **8 Characters** with **2 lowercase, 2 uppercase, 2 numerals, and 2 special characters.** + +| Arguments | Default Values | +|-----------|:-------:| +|`-s ` or `--service ` | Facebook | +|`-sm ` or `--small ` | 2 | +|`-bg ` or `--big ` | 2 | +|`-nm ` or `--number ` | 2 | +|`-sc ` or `--special `| 2 | + +# + +# Custom Library or Module **(lib)** + +[![MasterHead](https://raw.githubusercontent.com/kunal-mahatha/passgen-py/main/KUNAL/lib/cli.png)](https://username.github.io) + +### About the Library +This is a custom library for the random password generation. + +### Locate the module +```python3 +cd passgen-py/KUNAL/lib/passgen/dist +``` + +### Installing the module +```python +pip install passgen-1.0.0-py3-none-any.whl +``` +### Importing the module +```pythom +import passgen +``` + +### Using the module +To use this : + - import the module as desribed above. + - use it as a function by : + ```python3 + passgen.passgen(s, l, sm, bg, nm, sc) + ``` + + # + +| Arguments | Description | +| ---------------------|----------------------------------------------------------------------------------------------------| +|`-s ` or `--service ` | is about the service that user want to use the password for, example **Facebook, Instagram, etc.** | +|`-l` or `--length` | is for the length of the password | +|`-sm ` or `--small ` | is for number of lowercase characters.| +|`-bg ` or `--big ` | is for number of uppercase characters.| +|`-nm ` or `--number ` | is for number of numerals.| +|`-sc ` or `--special `| is for number of special characters.| + + +# + +### To prevent your passwords from being hacked by social engineering, brute force or dictionary attack method, and keep your online accounts safe, you should notice that: +1. Do not use the same password, security question and answer for multiple important accounts. +2. Use a password that has at least 16 characters, use at least one number, one uppercase letter, one lowercase letter and one special symbol. +3. Do not use the names of your families, friends or pets in your passwords. +4. Do not use postcodes, house numbers, phone numbers, birthdates, ID card numbers, social security numbers, and so on in your passwords. +5. Do not use any dictionary word in your passwords. Examples of strong passwords: ePYHc~dS*)8$+V-' , qzRtC{6rXN3N\RgL , zbfUMZPE6`FC%)sZ. Examples of weak passwords: qwert12345, Gbt3fC79ZmMEFUFJ, 1234567890, 987654321, nortonpassword. +6. Do not use two or more similar passwords which most of their characters are same, for example, ilovefreshflowersMac, ilovefreshflowersDropBox, since if one of these passwords is stolen, then it means that all of these passwords are stolen. +7. Do not use something that can be cloned( but you can't change ) as your passwords, such as your fingerprints. + +# + + +# +----------------------------------------------------------------------------------------------------------------------------------------------------------------- +### AUTHOR +**NAME - Kunal Mahatha** + +**GitHub Profile - [Click Here](https://github.com/kunal-mahatha)**