function persistEncrypted(key, input) {
if (hash == "") { return input }
input.addEventListener("input", function (params) {
encrypt(input.value).then(encrypted => {
localStorage.setItem(key, encrypted)
})
})
let encrypted = localStorage.getItem(key)
if (encrypted) {
decrypt(encrypted).then(decrypted => {
set(input, decrypted)
})
}
return input
}