JSFiddle - React, Tailwind, and code Playground

HTML

<p>
    <canvas id='path' width='350' height='350' />
</p>
<p>
    <input id='new' type='button' value='new'></input>
</p>

CSS

.pass {
    display: inline-block;
    border-style: solid;
    border-width: 1px;
}
.part {
    background-color: #ccc;
}
p.row {
    color: #555;
    margin: 0px;
    
}
div.col {
    display: inline-block;
    margin: 0px 0px 0px 0px;
    padding: 4px 12px 4px 12px;
}
div.letter {
    display: inline;
    margin: 0px 0px 0px 0px;
    font-family: courier, monospace;
    font-size: 24pt;
}

JavaScript

var dim = 8
var size = 350
var characters = [
    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
    '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
    '-', '=', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
    '[', ']', '\\', ';', '\'', ',', '.', '/', '{', '}', '|', ':', '"', '<', '>', '?', '`', '~'
    ]



function generatePasswordPath() {
    var canvas = document.getElementById('path')
    if (canvas.getContext) {
        var ctx = canvas.getContext('2d')
        ctx.fillStyle    = '#fff'
        ctx.fillRect(0,0,size,size)
        ctx.strokeRect(0,0,size,size)
            
        ctx.fillStyle    = '#000'
        ctx.font         = '42px monospace'
            
        var len = characters.length
        var cellSize = size / dim
        for(var x = 0; x < dim; x = x+1){
            for(var y = 0; y < dim;y = y+1){           
                var i = Math.round((len - 1) * Math.random())
                var c = characters[i]
                ctx.fillStyle    = '#000'
                ctx.font         = '42px monospace'
                ctx.fillText(''+c, 8+x*cellSize, 32+y*cellSize)
            }
        }
    }
}

var newButton = document.getElementById('new')
if (typeof newButton.addEventListener != 'undefined') {
    newButton.addEventListener('click', generatePasswordPath)
}
else {
    newButton.attachEvent('onclick', generatePasswordPath)
}

generatePasswordPath()