Timeline for How to validate a private key?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
S Mar 10, 2019 at 8:29 | history | suggested | Fabiano Soriani | CC BY-SA 4.0 |
concept correction
|
Mar 8, 2019 at 22:34 | review | Suggested edits | |||
S Mar 10, 2019 at 8:29 | |||||
Mar 4, 2016 at 15:57 | comment | added | Advanced | Oki, maybe edit your reply so I can upvote. My usecase: scan a QR, return true if its a valid private key for ethereum. For unencrypted keys I achieved it with ` var patt = new RegExp(/^[a-f0-9]{64}$/i); var res = patt.test(privateKey);` For encrypted keys, well, depends on how they are encrypted. I asked also myetherwallet.com guys. What do you suggest? Is there a regex to detect it? | |
Mar 4, 2016 at 8:50 | comment | added | Péter Szilágyi | Ah, indeed you are right, I missed the private part. Still, the answer is more or less the same. The raw private key is a simple 256 bit random binary blob. So if you want to validate the raw keys, everything is valid. However sending around the raw keys is extremely dangerous, so people tend to create key files and use those to transport the encrypted keys. The spec for that is in github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition . However to fully validate the content of the file you'd need the password to decrypt it + a client than can handle it. What's your use case? | |
Mar 3, 2016 at 15:23 | vote | accept | Advanced | ||
Mar 3, 2016 at 15:23 | |||||
Mar 3, 2016 at 15:22 | comment | added | Advanced | From your response it seems like you are talking about public addresses. Private keys seems to be 64 in length. Am I misreading it? | |
Mar 3, 2016 at 12:36 | history | answered | Péter Szilágyi | CC BY-SA 3.0 |