password .strength
password.strength
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password Strength Checker</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div class="container">
<h2>Password Strength Checker</h2>
<div class="inputBox">
<input type="password" placeholder="Enter your password" id="password" oninput="checkPasswordStrength()">
</div>
<div class="strengthMeter" id="result"></div>
</div>
<script>
function checkPasswordStrength() {
var password = document.getElementById("password").value;
$.ajax({
url: '/generate_password',
type: 'GET',
data: { password: password },
success: function(response) {
document.getElementById("result").innerText = response.strength;
},
error: function(xhr, status, error) {
console.error('Error:', error);
}
});
}
</script>
</body>
</html>
python-app.py
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/generate_password', methods=['GET'])
def generate_password():
password = request.args.get('password')
nonAlphaChars = []
numericChars = []
chars = []
for char in password:
if not char.isalnum():
nonAlphaChars.append(char)
if char.isnumeric():
numericChars.append(char)
if char.isalnum() and not char.isnumeric():
chars.append(char)
if len(nonAlphaChars) > 0 and len(numericChars) > 0 and len(chars) > 0:
strength = 'Strong password'
elif len(nonAlphaChars) == 0 and len(numericChars) > 0 and len(chars) > 0:
strength = 'Good password'
elif len(nonAlphaChars) == 0 and len(numericChars) == 0 and len(chars) > 0:
strength = 'Weak password'
elif len(nonAlphaChars) == 0 and len(numericChars) == 0 and len(chars) == 0:
strength = 'Error!!! Enter the password'
return jsonify({'strength': strength})
if __name__ == '__main__':
app.run(debug=True)
javascript-app.js
function checkPasswordStrength() {
var password = document.getElementById("password").value;
$.ajax({
url: '/generate_password',
type: 'GET',
data: { password: password },
success: function(response) {
document.getElementById("result").innerText = response.strength;
},
error: function(xhr, status, error) {
console.error('Error:', error);
}
});
}
created the project for password strength check using python,javascript and html to make the website
created a program with the count of strength using python
created code by verifying whether the code is good ,weak or moderate
created a new code for the program by using html
created password strength code to vheck the strength
python code is developing for the project. verified the output whether the password contains uppercase lower case and numbers .
Project created by Hridya Balram