Skip to content

Instantly share code, notes, and snippets.

@davidhq
Last active March 17, 2016 22:23
Show Gist options
  • Save davidhq/5413e67213f3c297db7b to your computer and use it in GitHub Desktop.
Save davidhq/5413e67213f3c297db7b to your computer and use it in GitHub Desktop.
package main
// "Fork" Geth
// add:
// func DecryptKeyFromFile(keysDirPath string, keyAddr common.Address, auth string) (keyBytes []byte, keyId []byte, err error) {
// return decryptKeyFromFile(keysDirPath, keyAddr, auth)
// }
// to crypto/key_store_passphrase.go
import (
"fmt"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/common"
)
func main() {
var address = common.HexToAddress("6b2474fb5b7203acc098f5186e6bf5beacde9364")
var plainText, _, _ = crypto.DecryptKeyFromFile("/Users/david/Library/Ethereum/keystore/", address, "password")
fmt.Println(crypto.ToECDSA(plainText).D)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment