Commit Graph

5 Commits

Author SHA1 Message Date
Ryan X. Charles
9f9e2f1d41 k should be 32 bytes, not 8 bytes
This is a bug with security implications. It is much easier to guess the value
of k within a 64 byte range. This would lead to compromised private keys.

The cryptography interface of bitcore is extremely poor. I recommend:
* Get rid of the C++ code, since it makes everything more difficult with little benefit
* Refactor all crypto, and have easily auditable bignum, point, ecdsa, and key classes
* Then actually audit the crypto
2014-08-10 21:25:52 -04:00
Ryan X. Charles
f87da3b5ba add support for signing messages in compressed format
...this is the standard way to sign messages in bitcoin-qt. Note that the
format of a compressed signature, for messages, is quite distinct from DER
format, which is used in transactions. This commit also adds support for
recovering the public key from a signature, which is necessary for this. The
code for public key recover is taken from bitcoinjs-lib.
2014-07-25 14:07:03 -07:00
Ryan X. Charles
bfe5877ee7 require SecureRandom and Point ... woops 2014-07-17 16:30:22 -07:00
Ryan X. Charles
57a55d0863 expose signature internal functions
"sign" and "genk" ... and add some signature tests
2014-07-17 15:24:19 -07:00
Ryan X. Charles
5f6d02f5de add proper DER signature support to Key
both creating DER signature from the r and s values, and parsing a DER
signature into the r, s, and other properties.
2014-07-17 13:09:35 -07:00