0% found this document useful (0 votes)
73 views

Password Generator - Mini Project 3

Uploaded by

a7618928510
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Password Generator - Mini Project 3

Uploaded by

a7618928510
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

PASSWORD GENERATOR

A Project Report Submitted in Partial Fulfillment of the Requirements for


the Degree

of

Bachelor of Technology

In

COMPUTER SCIENCE

By

Student Name Roll Number Branch and Section

1 ADVAITA GAUTAM 2201650100010 CS -A

2 AMIT KUMAR 2201650100020 CS -A

3 FAIZAN AHMAD ANSARI 2201650100064 CS -A

Under the Supervision of

Mr. Suraj Srivastav (Assistant Professor)

Kanpur Institute of Technology, Kanpur

Dr. A.P.J Abdul Kalam Technical University, Lucknow


CERTIFICATE
This is to certify that the Project Report entitled “PASSWORD
GENERATOR” which is submitted by Amit Kumar, Advaita
Gautam, Faizan Ahmad Ansari of the 5th semester, in the year
2023-2024.

In partial fulfillment of the requirement for the award of


degree of B.Tech in department of Information Technology of
Dr. APJ Abdul Kalam Technical University is a record of the
candidate own work carried out by him/her under my
supervision. The matter embodied in this thesis is original
and is not been submitted for the award of any degree.

Signature Signature

(Mr. Rahul Singh) (Mr. Suraj Srivastav)

(Head of Department) (Assistant Professor)

CSE Department CSE Department

KIT Kanpur KIT Kanpur

Date: 11/12/24
DECLARATION
We hereby declare that this submission of our own work
and that, to the best of our knowledge and belief, it contains
no material previously published or written by another
person nor material which to a substantial extent has been
accepted for the award of any other degree or diploma or the
university or other institute of higher learning, except where
due acknowledgement has been made in the text.

Signature: Signature:

Name: Advaita Gautam Name: Amit Kumar

Roll no: 2201650100010 Roll no: 2201650100020

Date: 11/12/24 Date: 11/12/24

Signature:

Name: Faizan Ahmad Ansari

Roll no: 2201650100064

Date: 11/12/24
Team Acknowledgement

We, the team behind this college website project, would like to
extend our heartfelt thanks and acknowledge the contributions of
several individuals and groups who made this project possible.

Project Team:

● Advaita Gautam – Project Head


Responsible for overseeing the entire project, designing
the website architecture using HTML.
● Amit Kumar – JavaScript Developer
Worked on designing the interactive and dynamic
behaviour to web page using JavaScript.
● Faizan Ahmad Ansari – CSS Developer
Worked on styling of the webpage, including colours, fonts,
layout, and positioning.

This project would not have been possible without the collective
efforts of the team, guidance from our mentor, and the support of
the college community. We hope this website serves as a
valuable tool and resource for students, faculty, and staff alike.
Purpose of the Password Generator

The main goal of this project is to help users create secure


passwords easily, eliminating the need for them to manually
think of complex and unique combinations. By using a Password
Generator, users can ensure that they are following best
practices for online security, such as using:

● Randomness to prevent guessable passwords.


● Complexity (letters, numbers, symbols) to make passwords
more resistant to brute force and dictionary attacks.
● Uniqueness, so passwords aren't reused across different
websites.

This tool addresses common problems like weak passwords,


password reuse, and user forgetfulness while making password
management more convenient.

Uses of a Password Generator

1. Creating Strong Passwords: A password generator creates


complex, random passwords that include a mix of
uppercase and lowercase letters, numbers, and special
characters. These strong passwords are far more secure
than simple, easily guessable ones.
2. Ensuring Unique Passwords: Many people reuse passwords
across multiple accounts, which poses a security risk if one
account is breached. A password generator ensures each
password is unique, making it harder for hackers to access
multiple accounts.
3. Reducing Human Error: Users often struggle to create
secure passwords. A generator automatically creates strong
passwords, removing the risk of weak or repetitive
passwords.
4. Convenience: Manually coming up with secure passwords
can be time-consuming. A password generator quickly
creates strong passwords, saving time and effort while
maintaining security.
5. Integration with Password Managers: Many password
generators work with password managers, allowing users to
generate, store, and autofill passwords securely. This
eliminates the need to remember complex passwords.
6. Preventing Phishing Attacks: Since password generators
create complex passwords for each account, they protect
against phishing attempts that rely on reusing or guessing
weak passwords.

Advantages of Using a Password Generator

1. Improved Security: The key advantage of using a password


generator is enhanced security. By creating random,
complex passwords, it makes it significantly harder for
attackers to crack accounts through brute force or other
methods.
2. Prevention of Password Guessing: Generating random
passwords ensures that attackers can’t easily guess
passwords based on common patterns, personal
information, or predictable combinations.
3. Prevention of Password Reuse: Password generators help
users avoid reusing the same password across multiple
accounts, which significantly reduces the risk if one
account is compromised.
4. Simplicity and Convenience: Creating strong passwords
manually can be challenging. A password generator does
this quickly, offering an easy way to ensure secure, unique
passwords without the effort of coming up with them on
your own.
5. Compliance with Security Standards: Many websites have
password requirements (e.g., minimum length, special
characters). Password generators create passwords that
meet these standards automatically, ensuring compliance
with security guidelines.
6. Protection Against Data Breaches: Since a password
generator creates unique passwords for every site, even if
one site experiences a breach, other accounts remain safe.
This limits the damage of a potential data breach.
7. Improved Password Hygiene: By encouraging strong,
unique passwords, password generators promote good
password hygiene. This makes it easier for users to
maintain secure practices across all their accounts.
HTML CODE

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN
3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous" />

<link rel="stylesheet" href="style.css" />

<title>Password Generator</title>

</head>

<body>

<div class="container">

<h2>Password Generator</h2>

<div class="result-container">

<span id="result"></span>

<button class="btn" id="clipboard">

<i class="far fa-clipboard"></i>

</button>

</div>

<div class="settings">
<div class="setting">

<label>Password Length</label>

<input type="number" id="length" min="4" max="20" value="20">

</div>

<div class="setting">

<label>Include uppercase letters</label>

<input type="checkbox" id="uppercase" checked>

</div>

<div class="setting">

<label>Include lowercase letters</label>

<input type="checkbox" id="lowercase" checked>

</div>

<div class="setting">

<label>Include numbers</label>

<input type="checkbox" id="numbers" checked>

</div>

<div class="setting">

<label>Include symbols</label>

<input type="checkbox" id="symbols" checked>

</div>

</div>

<button class="btn btn-large" id="generate">


Generate Password

</button>

</div>

<script src="script.js"></script>

</body>

</html>
CSS CODE

@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');

*{

box-sizing: border-box;

body {

background-color: #3b3b98;

color: #fff;

font-family: 'Muli', sans-serif;

display: flex;

flex-direction: column;

align-items: center;

justify-content: center;

height: 100vh;

overflow: hidden;

padding: 10px;

margin: 0;

}
h2 {

margin: 10px 0 20px;

text-align: center;

.container {

background-color: #23235b;

box-shadow: 0px 2px 10px rgba(255, 255, 255, 0.2);

padding: 20px;

width: 350px;

max-width: 100%;

.result-container {

background-color: rgba(0, 0, 0, 0.4);

display: flex;

justify-content: flex-start;

align-items: center;

position: relative;

font-size: 18px;

letter-spacing: 1px;

padding: 12px 10px;

height: 50px;
width: 100%;

.result-container #result {

word-wrap: break-word;

max-width: calc(100% - 40px);

overflow-y: scroll;

height: 100%;

#result::-webkit-scrollbar {

width: 1rem;

.result-container .btn {

position: absolute;

top: 5px;

right: 5px;

width: 40px;

height: 40px;

font-size: 20px;

}
.btn {

border: none;

background-color: #3b3b98;

color: #fff;

font-size: 16px;

padding: 8px 12px;

cursor: pointer;

.btn-large {

display: block;

width: 100%;

.setting {

display: flex;

justify-content: space-between;

align-items: center;

margin: 15px 0;

}
JAVASCRIPT CODE

const resultEl = document.getElementById('result')

const lengthEl = document.getElementById('length')

const uppercaseEl = document.getElementById('uppercase')

const lowercaseEl = document.getElementById('lowercase')

const numbersEl = document.getElementById('numbers')

const symbolsEl = document.getElementById('symbols')

const generateEl = document.getElementById('generate')

const clipboardEl = document.getElementById('clipboard')

const randomFunc = {

lower: getRandomLower,

upper: getRandomUpper,

number: getRandomNumber,

symbol: getRandomSymbol

clipboardEl.addEventListener('click', () => {

const password = resultEl.innerText;

if (!password) {

return;

}
navigator.clipboard.writeText(password);

alert('Password copied to clipboard!')

})

generateEl.addEventListener('click', () => {

const length = +lengthEl.value

const hasLower = lowercaseEl.checked

const hasUpper = uppercaseEl.checked

const hasNumber = numbersEl.checked

const hasSymbol = symbolsEl.checked

resultEl.innerText = generatePassword(hasLower, hasUpper, hasNumber,


hasSymbol, length)

})

function generatePassword(lower, upper, number, symbol, length) {

let generatedPassword = ''

const typesCount = lower + upper + number + symbol

const typesArr = [{lower}, {upper}, {number}, {symbol}].filter(item =>


Object.values(item)[0])

if(typesCount === 0) {

return ''

}
for(let i = 0; i < length; i += typesCount) {

typesArr.forEach(type => {

const funcName = Object.keys(type)[0]

generatedPassword += randomFunc[funcName]()

})

const finalPassword = generatedPassword.slice(0, length)

return finalPassword

function getRandomLower() {

return String.fromCharCode(Math.floor(Math.random() * 26) + 97)

function getRandomUpper() {

return String.fromCharCode(Math.floor(Math.random() * 26) + 65)

function getRandomNumber() {

return String.fromCharCode(Math.floor(Math.random() * 10) + 48)


}

function getRandomSymbol() {

const symbols = '!@#$%^&*(){}[]=<>/,.'

return symbols[Math.floor(Math.random() * symbols.length)]

}
OUTPUT
CONCLUSION

In summary, a password generator is an essential tool for

enhancing online security. It helps users create strong, unique

passwords, reducing the risk of hacking, phishing, and data

breaches. By integrating with password managers, it offers both

convenience and added protection, ensuring users can securely

manage their passwords without the hassle of remembering

them all. As online threats continue to rise, a password generator

is a simple yet powerful tool for maintaining digital security .

You might also like