Skip to content

Commit

Permalink
Use new salt and iv for every credential
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 committed Nov 18, 2024
1 parent f1a2706 commit ce8f02f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/common/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from functools import cached_property
from multiprocessing import Pool
from os import path
from secrets import randbits

import click
import milagro_bls_binding as bls
Expand Down Expand Up @@ -63,7 +64,11 @@ def withdrawal_credentials(self) -> Bytes32:

def encrypt_signing_keystore(self, password: str) -> Keystore:
return ScryptKeystore.encrypt(
secret=self.private_key_bytes, password=password, path=self.path
secret=self.private_key_bytes,
password=password,
path=self.path,
kdf_salt=randbits(256).to_bytes(32, 'big'),
aes_iv=randbits(128).to_bytes(16, 'big'),
)

def save_signing_keystore(
Expand Down

0 comments on commit ce8f02f

Please sign in to comment.