ecdsa

Creation of ECDSA public key given curve and public point?

泄露秘密 提交于 2019-12-06 04:12:55
I am struggling with the creation of a ECDSA public key from a string representation of a public key i.e string devicePublicKey("86FB5EB3CA0507226BE7197058B9EC041D3A3758D9D9C91902ACA3391F4E58AEF13AFF63CC4EF68942B9B94904DC1B890EDBEABD16B992110624968E894E560E"); previously I found that I had to prefix this key with '04' so not sure if this is require this time? I am trying to generate it to use in verifying a signature string ecs04b2ExpSignature("0199E984CEC75DDCA7F1DDF6E53E2E67352A2BE38A4B66F8ED596606FAB983FF300CAA76DE88CED9D563A5C03E8F3A7C000780F3F2061C611E9AA0B18B460D77"); where the data to

Generating a ECDSA Private key in bouncy castle returns a PUBLIC key

时光总嘲笑我的痴心妄想 提交于 2019-12-06 03:04:07
I am attempting to use bouncy castle to generate ECDSA keys. The code seems to work fine from the Java perspective; but, when I dump the file and try to validate the data, OpenSSL does not like the format of the data. After some research, I figured that bouncy castle is encoding the private key as public key. Here is my Java code: public class Test { public static void main(String[] args) { Security.addProvider(new BouncyCastleProvider()); System.out.println("Starting..."); String name = "prime256v1"; try { KeyPairGenerator kpg = KeyPairGenerator.getInstance("ECDSA", BouncyCastleProvider

Fixed length 64 Bytes EC P-256 Signature with JCE

末鹿安然 提交于 2019-12-05 11:12:25
I need a fixed length 64 Byte ECDSA signature with the NIST P-256 Curve. The implementation hast to use JCE. The following code sample can generate a signature and verify it. Provider provSign = new SunEC(); Provider provVerify = new SunEC(); // generate EC key KeyPairGenerator kg = KeyPairGenerator.getInstance("EC", provSign); ECGenParameterSpec ecParam = new ECGenParameterSpec("secp256r1"); kg.initialize(ecParam); KeyPair keyPair = kg.generateKeyPair(); PrivateKey privateKey = keyPair.getPrivate(); PublicKey publicKey = keyPair.getPublic(); try { // export public key KeyFactory kf =

Not sure how to generate an ECDSA signature, given a private key and a message

落花浮王杯 提交于 2019-12-05 09:02:49
I'm following Apple's guide towards composing a CloudKit Web Services request. The bit I'm having trouble with is Step 2, under "Authenticate Web Service Requests": Compute the ECDSA signature of this message with your private key. Before getting to this point, I generated my certificate, a .pem file, which when opening it in a text editor shows me my private key, so I have that in string format too. I've also followed the steps for generating what it refers to as a message, which I now have as a string. So given that I have a private key, (or the .pem file if required), and a message as a

C# ecdsa signature - Which key specification can i choose?

这一生的挚爱 提交于 2019-12-04 17:28:30
i need to generate a ECDSA signature on C# side, and after reading and verify the signature on android application using (obviously) the relative public key. Well, to get a ECDSA key pair in java (with bouncy castle provider), the code is like that kpg = KeyPairGenerator.getInstance("ECDSA", "BC"); ecSpec = new ECGenParameterSpec("secp224k1"); kpg.initialize(ecSpec, new SecureRandom()); The string "secp224k1" , is the curve name. And i can choose "secp224k1","secp224r1","secp256k1","secp256r1" and more others. My questions is: Which is the equivalent curve name in C# mentioned above? Could

Encode publicKey on Java Card

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 16:44:40
How to encode an ECDSA PublicKey on Java Card so that after I can decode it on another platform (e.g. sending the encoded key in a response APDU and processing it in a standard Java application)? keyPair.getPublic().getEncoded() on Java would do the trick with PKCS#8 encoding, but as far as I know getEncoded() is not available on the Java Card platform. You can implement this function like this: Card side: 1 KeyPair.getPublicKey() --> publicKey; 2 publicKey.getW() --> W; 3 Send W to outside; Standard java application side: 1 get W data bytes; 2 W data bytes --> ECPoint; 3 Build PublicKey with

Implementing secp256k1 (ECDSA) in PHP (for Bitcoin) [closed]

前提是你 提交于 2019-12-04 12:16:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . To keen downvoters and/or closers: If you think this is offtopic for SO, kindly point me out other StackExchange site where this question would be more appropriate. How to implement ECDSA curve secp256k1 in PHP? Or rather: Are there any solutions - ie. includable specialized classes - already done? I can see

How to create ECDSA keypair (256bit) for bitcoin curve (secp256k1) using spongy castle?

我怕爱的太早我们不能终老 提交于 2019-12-04 03:11:18
问题 Currently, I am creating keyPair using this method private KeyPair getKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException, InvalidAlgorithmParameterException { KeyPairGenerator keyGen = KeyPairGenerator.getInstance("ECDsA", "SC"); ECGenParameterSpec ecSpec = new ECGenParameterSpec("secp256k1"); keyGen.initialize(ecSpec, new SecureRandom()); return keyGen.generateKeyPair(); } KeyPairGenerator has another method, in which I can specify keySize but I am not sure how I will pass

How to store ECDSA private key in Go

只谈情不闲聊 提交于 2019-12-03 11:31:22
问题 I am using the ecdsa.GenerateKey method to generate a private/public key pair in Go. I would like to store the private key in a file on the users computer, and load it whenever the program starts. There is a method elliptic.Marshal that marshals the public key, but nothing for the private key. Should I simply roll my own, or is there a recommended way to store the private key? 回答1: Here is a code sample that demonstrates encoding and decoding of keys in Go. It helps to know that you need to

Implementing secp256k1 (ECDSA) in PHP (for Bitcoin) [closed]

筅森魡賤 提交于 2019-12-03 08:42:39
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. To keen downvoters and/or closers: If you think this is offtopic for SO, kindly point me out other StackExchange site where this question would be more appropriate. How to implement ECDSA curve secp256k1 in PHP? Or rather: Are there any solutions - ie. includable specialized classes - already done? I can see there are plenty of opensource libraries, classes and stuff available for other languages (JavaScript, Python,...)