要从HDWALLET的12字密码中生成种子,应使用HMAC-512重复的PBKDF2公式。我已经从。
该句子的以下代码:“一年而不是电缆响应转移滥用淡出淡入淡出的颜色地铁” is:
Private Sub Command77_Click()
Dim crypt As New ChilkatCrypt2
Dim wpaHexKey As String
' The "ps" is the WPA passphrase
Dim pw As String
pw = ""
Dim pwCharset As String
pwCharset = "ansi"
' Hash algorithms may be: sha1, md2, md5, etc.
Dim hashAlg As String
hashAlg = "HMAC-SHA512"
' Specify the SSID in hex:
' For example, if the SSID is "ABC", then the
Dim ssidHex As Variant
ssidHex = crypt.EncodeString("year rather cable response transfer abuse fade
attend make multiply color subway", "utf-8", "hex")
'MsgBox HexToBytes(CStr(TXTDEC))
' The WPA key calculation will always use 4096 iterations.
Dim iterationCount As Long
' The WPA hex output should be 256 bits.
Dim outputBitLen As Long
outputBitLen = 512
' Indicate that "hex" is to be returned.
Dim enc As String
enc = "hex"
TXTPBKDF2 = crypt.Pbkdf2(pw, pwCharset, hashAlg, ssidHex, iterationCount,
outputBitLen, enc)
' The output should have this value:
' 284C82D68B4E5A244507A858851215344140FC401421E615A10E067BE4CE27C7FF54E037EEA93BCEE50FF337AAE167B5D482260DFD170889865E9169CEF0847B
End Sub
1
,但是对于seed bip39而言,此功能的结果是不正确的,但是当我们在网站上输入相同的12字代码 https://iancoleman.io/bip39/ ,种子Bip39的结果是:
"a364230f7c915db7a36ed31ff8e23ad34d99694b012fb85b6592d2aa630fdc017a1c5a596293101966d73143f53eb2d1d4a0547640d3cfd29fc42012581f62c8"
2
网站上的结果
您能帮我为什么结果在 chilkatcrypt2
代码中是错误的,这是我正在做的方式产生BIP39错误?
To generate seed from HDWallet's 12-word password, PBKDF2 formula with 2048 repetitions in HMAC-512 should be used. I have taken this formula from https://www.example-code.com/vb6/crypt2_pbkdf2.asp .
The following code for the sentence: "year rather cable response transfer abuse fade attend make multiply color subway" is:
Private Sub Command77_Click()
Dim crypt As New ChilkatCrypt2
Dim wpaHexKey As String
' The "ps" is the WPA passphrase
Dim pw As String
pw = ""
Dim pwCharset As String
pwCharset = "ansi"
' Hash algorithms may be: sha1, md2, md5, etc.
Dim hashAlg As String
hashAlg = "HMAC-SHA512"
' Specify the SSID in hex:
' For example, if the SSID is "ABC", then the
Dim ssidHex As Variant
ssidHex = crypt.EncodeString("year rather cable response transfer abuse fade
attend make multiply color subway", "utf-8", "hex")
'MsgBox HexToBytes(CStr(TXTDEC))
' The WPA key calculation will always use 4096 iterations.
Dim iterationCount As Long
' The WPA hex output should be 256 bits.
Dim outputBitLen As Long
outputBitLen = 512
' Indicate that "hex" is to be returned.
Dim enc As String
enc = "hex"
TXTPBKDF2 = crypt.Pbkdf2(pw, pwCharset, hashAlg, ssidHex, iterationCount,
outputBitLen, enc)
' The output should have this value:
' 284C82D68B4E5A244507A858851215344140FC401421E615A10E067BE4CE27C7FF54E037EEA93BCEE50FF337AAE167B5D482260DFD170889865E9169CEF0847B
End Sub
1
But the result of this function is not correct for the term Seed bip39, but when we enter the same 12-word code on the site https://iancoleman.io/bip39/, the result of seed bip39 is :
"a364230f7c915db7a36ed31ff8e23ad34d99694b012fb85b6592d2aa630fdc017a1c5a596293101966d73143f53eb2d1d4a0547640d3cfd29fc42012581f62c8"
2
The result on the site https://iancoleman.io/bip39/ is correct
Can you help me why the result is wrong in the ChilkatCrypt2
codes, is the way I am doing to generate bip39 wrong?
发布评论
评论(1)
请参阅此处的bip39计算示例: https://www.example-code.com/ vb6/bip39_computation_of_binary_seed.asp
See the example for BIP39 computation here: https://www.example-code.com/vb6/bip39_computation_of_binary_seed.asp