3

I have my very private RSA key:

-----BEGIN PRIVATE KEY-----
MIIJQQIBADANBgkqhkiG9w0BAQEFAASCCSswggknAgEAAoICAQDI0vCkxjyJQ7b7
MVJKKXVTFSH3yN5xWozV1pZ8grTTr6dL90bmeCHIw9PnsZRJWsAhstnSnLm1v7KE
kkNqFi2s+sBf1BSBDZ5onoWE0dtb3R2dG25AsYRj54Sd6rtX9U/2aF ... uNjei
sMA0VQ2av7J60ulAz2AYMHoMrEOznhUpgOM7Op7hR3WE0XFkmL4wmcovboCXTtp8
tMK8EN5Hp4YasJp4Hw9Rc50EluiXMsCuc9Uwr41FZhQQJGtWPGImxoiPU6jJfZUP
yja709eeToSrwU6xoYArh7RnN3Qx
-----END PRIVATE KEY-----

I use keythereum to generate an ethereum wallet:

const privateKey = fs.readFileSync('my_private_key_file', 'utf8')
const password = 'myVerySecretPassword'

function generateWallet(privateKey, password){

    const dk = {
        privateKey: Buffer.from(privateKey, 'utf8'),
        salt: crypto.randomBytes(32),
        iv: crypto.randomBytes(16)
    }

    const options = {
        kdf: "pbkdf2",
        cipher: "aes-128-ctr",
        kdfparams: {
            c: 262144,
            dklen: 32,
            prf: "hmac-sha256"
        }
    }

    return keythereum.dump(
        password,
        dk.privateKey,
        dk.salt,
        dk.iv,
        options
    )
}

That's what I get back:

{
    address: 'c1cfd69deab90015dd456164d058f73abe3b80f4',
    crypto: {...},
    id: 'd94389ec-1e8a-4e95-a386-0a3be0900e13',
    version: 3
}

Now I want to start transacting from the address 0xc1cfd69deab90015dd456164d058f73abe3b80f4. How can I unlock it and set as a desired coinbase? The JSON RPC method parity_newAccountFromSecret accepts only hex, no more than 64-character long.

0

1 Answer 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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