Author

Topic: Re: BIP38 python problem (Read 43 times)

legendary
Activity: 3472
Merit: 10611
January 21, 2025, 11:35:26 PM
#2
It is difficult to say without seeing the code and debugging it. My suggestion is to either take a look at the reference implementation of BIP38[1] which is written in C# or use GitHub to find an implementation in python[2]. Then either go through the code to find where you made the mistake in your code or if that didn't work try modifying one of those implementations to get the intermediary values out to see where the problem is (eg. the correct value for factorb, factorb*G, XOR results, AES256Encrypt result for each chunk, etc.) by checking them against your own values you can find the bug.
Sometimes you may be looking at why your AES doesn't give the correct result while the mistake is in something simple like the very beginning where you used 1 SHA256 to compute factorb instead of 2.

[1] https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki#user-content-Reference_implementation
[2] https://github.com/search?q=bip38+language%3APython&type=repositories&l=Python
newbie
Activity: 0
Merit: 0
January 21, 2025, 12:14:12 AM
#1
This off topic , but relative with BIP38  standard . I tried to test multiply used protocol but it is not matching even I know 100% input value and output  value as well
I am using Cyberchef for scrypt 1024,1,1,64
Do AES256Encrypt(block = (pointb[1...16] xor derivedhalf1[0...15]), key = derivedhalf2) and call the result pointbx1.
Do AES256Encrypt(block = (pointb[17...32] xor derivedhalf1[16...31]), key = derivedhalf2) and call the result pointbx2.
In you explanation scrypt 16384,8,8,64 in testing works fine but I could not calculate derivedhalf1 and derivedhalf2  I test a lot off combination but no result. I don't know where is my mistake
Jump to: