Skip to content

Random Password Generator with CLI tool #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added passgen-py/cli-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added passgen-py/cli-banner.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added passgen-py/cli-tool/cli-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions passgen-py/cli-tool/passgen.py
Original file line number Diff line number Diff line change
@@ -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)
34 changes: 34 additions & 0 deletions passgen-py/cli-tool/passgen.spec
Original file line number Diff line number Diff line change
@@ -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 )
26 changes: 26 additions & 0 deletions passgen-py/cli-tool/passwords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Facebook : XmBIA87|
Instagram : {:+9s<?H]4QO
Facebook : op4X(3?Q
Git : 'SN6!oa4
IG : N7Q"|bj4
Facebook : 4)zCo,0P
Facebook : 6P#Jw;9l
Facebook : {Bl)9Xy2
Facebook : zPN`o87$
5 : sZ^1%5Yn
5 : #H)5f2Es
Facebook : w5+gGt3L
m5 : k2U'L>r5
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
64 changes: 64 additions & 0 deletions passgen-py/lib/passgen/build/lib/passgen/__init__.py
Original file line number Diff line number Diff line change
@@ -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)
Binary file not shown.
10 changes: 10 additions & 0 deletions passgen-py/lib/passgen/passgen.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions passgen-py/lib/passgen/passgen.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions passgen-py/lib/passgen/passgen.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
passgen
64 changes: 64 additions & 0 deletions passgen-py/lib/passgen/passgen/__init__.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions passgen-py/lib/passgen/setup.py
Original file line number Diff line number Diff line change
@@ -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 = [])

Loading