Wednesday, February 8, 2023
HomeBitcoinbitcoind - producing bitcoin core -rpcauth argument utilizing gloang

bitcoind – producing bitcoin core -rpcauth argument utilizing gloang


we’re creating a Blockchain deployment resolution kotal, and producing -rpcauth argument from the provided person identify and password.
The issue is once we attempt to use the identical person and password utilizing curl, it writes ThreadRPCServer incorrect password try from 127.0.0.1:55566.

This is how we’re producing -rpcauth from password in golang.

person := "kotal"
password = "s3cr3t"

salt := make([]byte, 16)
rand.Learn(salt)

hash := hmac.New(sha256.New, salt)
hash.Write([]byte(password))

rpcauth := fmt.Sprintf("%s:%x$%x", person, salt, hash.Sum(nil))

what’s fallacious with our golang implementation ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments