diff --git a/src/service/security.js b/src/service/security.js index a67e3513..c4788d6d 100644 --- a/src/service/security.js +++ b/src/service/security.js @@ -14,7 +14,7 @@ const uint8ArrayToHex = (arr) => function stdAESKey(key) { const tKey = new TextEncoder().encode(key); let sk = tKey; - if (key.length < 32) { + if (tKey.length < 32) { sk = new Uint8Array(32); sk.set(tKey); sk.set(defaultAESKey.slice(key.length, 32), key.length);