diff options
Diffstat (limited to 'packages/meshbay-common/src/meshbay_common/crypto.py')
| -rw-r--r-- | packages/meshbay-common/src/meshbay_common/crypto.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/meshbay-common/src/meshbay_common/crypto.py b/packages/meshbay-common/src/meshbay_common/crypto.py index 2104469..6066f5f 100644 --- a/packages/meshbay-common/src/meshbay_common/crypto.py +++ b/packages/meshbay-common/src/meshbay_common/crypto.py @@ -145,7 +145,7 @@ def derive_keystore_key(password: str, salt: bytes) -> bytes: def encrypt_keystore(plaintext: bytes, key: bytes) -> tuple[bytes, bytes, bytes]: """Encrypt keystore blob with AES-256-GCM. Returns (iv, ciphertext, tag).""" - iv = os.urandom(16) + iv = os.urandom(12) enc = Cipher(algorithms.AES(key), modes.GCM(iv)).encryptor() ct = enc.update(plaintext) + enc.finalize() return iv, ct, enc.tag |