diff --git a/templates/bottom.htm b/templates/bottom.htm
index 90e40b5..2a5f068 100644
--- a/templates/bottom.htm
+++ b/templates/bottom.htm
@@ -1,6 +1,6 @@
     <!-- Optional JavaScript -->
     <!-- jQuery first, then Popper.js, then Bootstrap JS -->
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
 
diff --git a/templates/header.htm b/templates/header.htm
index 8c8411f..256613e 100644
--- a/templates/header.htm
+++ b/templates/header.htm
@@ -9,9 +9,12 @@
     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
     <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
     <link rel="stylesheet" href="<?php echo $BASE_URL?>/static/main.css" >
-    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/core.min.js" integrity="sha512-t8vdA86yKUE154D1VlNn78JbDkjv3HxdK/0MJDMBUXUjshuzRgET0ERp/0MAgYS+8YD9YmFwnz6+FWLz1gRZaw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/enc-hex.min.js" integrity="sha512-jDU0YCduSP8z0cvjfPFm7/zN/viOcmNWlq0GUIcjVhuv4WoKcMppghamg4aeuBtJaA0wjtYfxwQjPpVuYGEsBA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/sha1.min.js" integrity="sha512-NHw1e1pc4RtmcynK88fHt8lpuetTUC0frnLBH6OrjmKGNnwY4nAnNBMjez4DRr9G1b+NtufOXLsF+apmkRCEIw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
     <script src="<?php echo $BASE_URL?>/static/main.js"></script>
 
     <style>
diff --git a/templates/register.htm b/templates/register.htm
index 4f116d2..624a0cf 100644
--- a/templates/register.htm
+++ b/templates/register.htm
@@ -58,17 +58,18 @@
     </div>
 
     <!-- Password input -->
-    <div class="form-outline mb-3">
+    <div id="password-div" class="form-outline mb-3">
         <label class="form-label font-weight-bold" for="pw1">Password*</label>
-        <input pattern="[^\s]{<?php echo $VAL_USER->min_password.','.$VAL_USER->max_password;?>}" required
-            title="At least 8 not whitespace characters" name="password" type="password" id="pw1"
-            class="form-control <?php if(isset($error) && $error && !isset($_POST['password'])){echo 'border-danger';}?>"
+        <input required
+            title="Combination of upper and lowercase letters, numbers, punctuation, and special symbols" name="password" type="password" id="pw1"
+            class="form-control"
             placeholder="********"  oninput="check_password_match()"
             value="<?php echo isset($_POST['password']) ? htmlspecialchars($_POST['password']) : '' ?>" />
         <div class="progress mt-2">
             <div class="progress-bar bg-danger" role="progressbar" id="pwqbar" aria-valuenow="0" aria-valuemin="0"
                 aria-valuemax="100"></div>
         </div>
+        <input class="form-control" type="text" name="pwqinfo" id="pwqinfo" readonly>
     </div>
     <!--
     <div class="form-group">
@@ -80,11 +81,11 @@
         </div>
     </div>
     -->
-    <!-- Password input -->
+    <!-- Password confirmation input -->
     <div id="pwconfirm" class="form-outline mb-3">
         <label class="form-label font-weight-bold" for="pw2">Confirm your Password*</label>
-        <input pattern="[^\s]{<?php echo $VAL_USER->min_password.','.$VAL_USER->max_password;?>}" required
-            title="At least 8 not whitespace characters" name="password_confirm" type="password" id="pw2"
+        <input  required
+            name="password_confirm" type="password" id="pw2"
             class="form-control <?php if(isset($error) && $error && !isset($_POST['password_confirm'])){echo 'border-danger';}?>"
             placeholder="********" oninput="check_password_match()" />
             <div class="invalid-feedback">
@@ -147,260 +148,3 @@
 
 </form>
 </div>
-
-<script>
-    // Example starter JavaScript for disabling form submissions if there are invalid fields
-    (function () {
-        'use strict';
-        window.addEventListener('load', function () {
-            // Fetch all the forms we want to apply custom Bootstrap validation styles to
-            var forms = document.getElementsByClassName('needs-validation');
-            // Loop over them and prevent submission
-            var validation = Array.prototype.filter.call(forms, function (form) {
-                form.addEventListener('submit', function (event) {
-                    if (form.checkValidity() === false) {
-                        event.preventDefault();
-                        event.stopPropagation();
-                    }
-                    form.classList.add('was-validated');
-                }, false);
-            });
-        }, false);
-    })();
-
-    function check_password_match() {
-            pass =  $("#pw1").val();
-            pass2 =  $("#pw2").val();
-
-        if (pass2.length > 0) {
-            $("#pwconfirm")[0].classList.add('was-validated')
-            if (pass != pass2) {
-                $("#pw2")[0].setCustomValidity("Passwords do not match");
-            } else {
-                $("#pw2")[0].setCustomValidity(""); // is valid
-            }
-        } else {
-            $("#pwconfirm")[0].classList.remove('was-validated')
-        }
-        passUpdated();
-     }
-
-        TOO_SHORT      ='Password too short, still %% characters needed';
-        TOO_LONG       ='Password too long, please remove %% characters';
-        INVALID_CHARS  ='Password contains invalid characters';
-        QUAL_NONE      ='Password is very weak'
-        QUAL_LOW       ='Password is weak';
-        QUAL_MEDIUM    ='Password is average'
-        QUAL_GOOD      ='Password is good';
-        QUAL_STRONG    ='Password is strong';
-        REP_OK         ='Repetition ok';
-        REP_NE         ='Passwords not identical';
-        PWNED          ='Password found in public password list';
-
-        String.prototype.strReverse=function() {
-            var newstring='';
-            for (var s=0; s < this.length; s++)
-                newstring=this.charAt(s)+newstring;
-            return newstring;
-        };
-
-        //var checkTimer;
-
-        function passUpdated() {
-            var nScore=0;
-            var message='';
-
-            var pass=$('#pw1').val();
-            var pass2=$('#pw2').val();
-
-            //clearTimeout(checkTimer);
-
-            try {
-                if (!pass)
-                    throw '';
-
-                if (pass.match(/[^a-zA-Z0-9!@#$%()_+=:;",.?/-]/))
-                    throw INVALID_CHARS;
-
-                var nLength=pass.length;
-                if (nLength < 8)
-                    throw TOO_SHORT.replace('%%', 8-nLength);
-                if (nLength > 20)
-                    throw TOO_LONG.replace('%%', nLength-20);
-
-                nScore=4*nLength;
-
-                // check for upper-/lowercase, numeric and special chars pattern matches
-                var nAlphaUC=0, nAlphaLC=0, nNumber=0, nSpecial=0;
-                var nMidChar=0, nRepChar=0, nRepInc=0;
-                var nConsecAlphaUC=0, nConsecAlphaLC=0, nConsecNumber=0;
-                var nTmpAlphaUC='', nTmpAlphaLC='', nTmpNumber='';
-                for (var i=0; i < nLength; i++) {
-                    if (pass[i].match(/[A-Z]/g)) {   // uppercase characters
-                        if (nTmpAlphaUC !== '' && (nTmpAlphaUC+1) == i) {
-                            nConsecAlphaUC++;
-                        }
-                        nTmpAlphaUC=i;
-                        nAlphaUC++;
-                    } else if (pass[i].match(/[a-z]/g)) {   // lowercase characters
-                        if (nTmpAlphaLC !== '' && (nTmpAlphaLC+1) == i) {
-                            nConsecAlphaLC++;
-                        }
-                        nTmpAlphaLC=i;
-                        nAlphaLC++;
-                    } else if (pass[i].match(/[0-9]/g)) {   // numbers
-                        if (i > 0 && i < (nLength-1)) {
-                            nMidChar++;
-                        }
-                        if (nTmpNumber !== '' && (nTmpNumber+1) == i) {
-                            nConsecNumber++;
-                        }
-                        nTmpNumber=i;
-                        nNumber++;
-                    } else {   // special characters
-                        if (i > 0 && i < (nLength-1)) {
-                            nMidChar++;
-                        }
-                        nSpecial++;
-                    }
-
-                    // check for repeated characters
-                    var bCharExists=false;
-                    for (var j=0; j < nLength; j++) {
-                        if (pass[i] == pass[j] && i != j) {
-                            bCharExists=true;
-                            nRepInc+=Math.abs(nLength/(j-i));
-                        }
-                    }
-                    if (bCharExists) {
-                        nRepChar++;
-                        var nUnqChar=nLength-nRepChar;
-                        nRepInc=(nUnqChar) ? Math.ceil(nRepInc/nUnqChar) : Math.ceil(nRepInc);
-                    }
-                }
-
-                // check for sequential alpha string patterns (forward and reverse)
-                var sAlphas="abcdefghijklmnopqrstuvwxyz";
-                var nSeqAlpha=0;
-                for (var i=0; i < 23; i++) {
-                    var sFwd=sAlphas.substring(i, i+3);
-                    var sRev=sFwd.strReverse();
-                    if (pass.toLowerCase().indexOf(sFwd) != -1
-                            ||  pass.toLowerCase().indexOf(sRev) != -1)
-                        nSeqAlpha++;
-                }
-
-                // check for sequential numeric string patterns (forward and reverse)
-                var sNumerics="01234567890";
-                var nSeqNumber=0;
-                for (var i=0; i < 8; i++) {
-                    var sFwd=sNumerics.substring(i, i+3);
-                    var sRev=sFwd.strReverse();
-                    if (pass.toLowerCase().indexOf(sFwd) != -1
-                            ||  pass.toLowerCase().indexOf(sRev) != -1)
-                        nSeqNumber++;
-                }
-
-                // general point assignment
-                if (nAlphaUC > 0 && nAlphaUC < nLength)   // uppercase characters
-                    nScore+=2*(nLength-nAlphaUC);
-                if (nAlphaLC > 0 && nAlphaLC < nLength)   // lowercase characters
-                    nScore+=2*(nLength-nAlphaLC);
-                if (nNumber > 0 && nNumber < nLength)   // numbers
-                    nScore+=2*nNumber;
-                if (nSpecial > 0)   // special characters
-                    nScore+=4*nSpecial;
-                if (nMidChar > 0)   // mid numbers/special characters
-                    nScore+=2*nMidChar;
-
-                // point deductions for poor practices
-                if ((nAlphaLC > 0 || nAlphaUC > 0)
-                    && nSpecial === 0 && nNumber === 0)   // characters only
-                    nScore-=nLength;
-                if (nAlphaLC === 0 && nAlphaUC === 0
-                    && nSpecial === 0 && nNumber > 0)   // numbers only
-                    nScore-=nLength;
-                if (nRepChar > 0)   // same character exists more than once
-                    nScore-=nRepInc;
-                if (nConsecAlphaUC > 0)   // consecutive uppercase letters exist
-                    nScore-=2*nConsecAlphaUC;
-                if (nConsecAlphaLC > 0)   // consecutive lowercase letters exist
-                    nScore-=2*nConsecAlphaLC;
-                if (nConsecNumber > 0)   // consecutive numbers exist
-                    nScore-=2*nConsecNumber;
-                if (nSeqAlpha > 0)   // sequential alpha strings exist (3 chars or more)
-                    nScore-=3*nSeqAlpha;
-                if (nSeqNumber > 0)   // sequential numeric strings exist (3 chars or more)
-                    nScore-=3*nSeqNumber;
-
-                // determine if mandatory requirements have been met
-                var arrChars=[nAlphaUC, nAlphaLC, nNumber, nSpecial];
-                var nReqChar=0;
-                for (var i=0; i < arrChars.length; i++) {
-                    if (arrChars[i]) {
-                        nReqChar++;
-                    }
-                }
-                if (nReqChar >= arrChars.length)
-                    nScore+=2*nReqChar;
-                else if (nReqChar < arrChars.length-1)
-                    nScore-=2*nReqChar;
-
-                // limit points to 3..100
-                nScore=Math.max(3, Math.min(nScore, 100));
-
-                // set message according to points
-                if (nScore >= 80)
-                    message=QUAL_STRONG;
-                else if (nScore >= 60)
-                    message=QUAL_GOOD;
-                else if (nScore >= 40)
-                    message=QUAL_MEDIUM;
-                else if (nScore >= 10)
-                    message=QUAL_LOW;
-                else
-                    message=QUAL_NONE;
-            } catch (error) {
-                nScore=3;
-                message=error;
-            }
-/*
-            if (pass.length > 0 && pass2.length > 0) {
-                message+=' / ';
-                message+=(pass == pass2) ? REP_OK : REP_NE;
-            }
-*/
-            $('#pwqinfo').val(message);
-
-            var progress=$('#pwqbar');
-            progress.width(nScore + '%');
-            progress.attr('aria-valuenow', nScore);
-            if (nScore >= 60)
-                progress.removeClass('bg-danger bg-warning').addClass('bg-success');
-            else if (nScore >= 40)
-                progress.removeClass('bg-danger bg-success').addClass('bg-warning');
-            else
-                progress.removeClass('bg-warning bg-success').addClass('bg-danger');
-
-            if (nScore > 60) {
-                $('#btn_change').prop('disabled', pass !== pass2);
-            } else {
-                $('#btn_change').prop('disabled', 1);
-            }
-/*
-            if (nScore >= 60) {
-                checkTimer=setTimeout(function() {
-                    $.post('checkpass.php', 'pass='+pass, function(ret) {
-                        if (ret !== 'PWNED') {
-                            $('#btn_change').prop('disabled', pass !== pass2);
-                            return;
-                        }
-                        $('#pwqinfo').val(PWNED);
-                        progress.removeClass().addClass('low');
-                        progress.val(3);
-                    });
-                }, 300);
-            }
-*/
-        }
-</script>
\ No newline at end of file
