Can we change the password of an existing account through web3.js ?


you can't update the password using web3.js check the documentation https://github.com/ethereum/wiki/wiki/JavaScript-API https://github.com/ethereum/web3.js/blob/e4eb9606aa0aa10fd3eeb0a5e5d67c4fff43e814/lib/web3/methods/personal.js there is no function for updating your password.


you can use keythereum, it's also a JavaScript tool. When you modify the password of a wallet file, the key pair doesn't change.

 var params = {
        keyBytes: 32,
        ivBytes: 16

    var options = {
        kdf: "scrypt",
        cipher: "aes-128-ctr",
        kdfparams: {
            n: (1 << 4),
            dklen: 32,
            p: 1,
            r: 8,
            prf: "hmac-sha256"

var dk = keythereum.create(params);
dk.privateKey = "";//privateKey that recoveried by keythereum.
var keyObject = keythereum.dump(newPassword, dk.privateKey, dk.salt, dk.iv, options);
var obj = JSON.stringify(keyObject);
return obj;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.