ecdsa

PHP: openssl_verify not working with ECDSA keys

随声附和 提交于 2019-12-25 18:27:25
问题 I need some help with the following "pseudo" code: <?php $stringToVerify = '50.009781OK101092014125505'; $ECDSA = '3045022100b4b4064158cb12f5b3d902e1e4487e0c6dfafd96b5bb5ab9765fc088e054d67e0220153 f9bb5da20441c68ff0c3e8ba28cfe048e5c3152fc8c890def156cf09d5540'; $publicKey = "-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaq6djyzkpHdX7kt8DsSt6IuSoXjp WVlLfnZPoLaGKc/2BSfYQuFIO2hfgueQINJN3ZdujYXfUJ7Who+XkcJqHQ== -----END PUBLIC KEY-----"; var_dump(openssl_verify($stringToVerify,

Elliptic curve addition in Jacobian coordinates

╄→尐↘猪︶ㄣ 提交于 2019-12-23 20:24:53
问题 I try to add two points on an elliptic curve over a prime field, converting these points from affine/to-affine coordinates, but do not manage to get a correct result (the curve I am testing has a=0). Anyone can see what's wrong? // From Affine BigInteger X1=P.x; BigInteger Y1=P.y; BigInteger Z1=BigInteger.ONE; BigInteger X2=Q.x; BigInteger Y2=Q.y; BigInteger Z2=BigInteger.ONE; // Point addition in Jacobian coordinates for a=0 // see http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0

Bouncy Castle ECDSA Create Public Key from Private Key

谁说我不能喝 提交于 2019-12-23 18:18:50
问题 I am trying to sign a bitcoin transaction in c#. I have 2 bits of code I am trying to complete. I can create a set of private and public keys using Bouncy castle. I can convert this to wallet import format ok. I can also generate a bitcoin address from the ECDSA public key. However, I want to sign a transaction and all I have is my private key. I don't want to have to import into a wallet and sign. So how can I generate the public key, given only the private key? I have found a javascript

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

ぃ、小莉子 提交于 2019-12-22 07:36:37
问题 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

Encode publicKey on Java Card

浪尽此生 提交于 2019-12-21 21:43:20
问题 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. 回答1: You can implement this function like this: Card side: 1 KeyPair.getPublicKey() --> publicKey; 2 publicKey.getW() --> W; 3 Send W to

Using openssh public key (ecdsa-sha2-nistp256) with Java Security

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 04:47:27
问题 Is there a Java library/example to read an openssh format ecdsa public key to a JCE PublicKey in Java? I want to use EC for JWT . The format I'm trying to read is as per authorized_keys, or Github API (e.g. https://api.github.com/users/davidcarboni/keys): ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8hPtB72/sfYgNw1WTska2DNOJFx+QhUxuV6OLINSD2ty+6gxcM8yZrvMqWdMePGRb2cGh8L/0bGOk+64IQ/pM= I've found this answer, which is fine for RSA and DSS: Using public key from

Using openssh public key (ecdsa-sha2-nistp256) with Java Security

自闭症网瘾萝莉.ら 提交于 2019-12-20 04:47:18
问题 Is there a Java library/example to read an openssh format ecdsa public key to a JCE PublicKey in Java? I want to use EC for JWT . The format I'm trying to read is as per authorized_keys, or Github API (e.g. https://api.github.com/users/davidcarboni/keys): ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK8hPtB72/sfYgNw1WTska2DNOJFx+QhUxuV6OLINSD2ty+6gxcM8yZrvMqWdMePGRb2cGh8L/0bGOk+64IQ/pM= I've found this answer, which is fine for RSA and DSS: Using public key from

How to sign and verify signature with ecdsa in python

最后都变了- 提交于 2019-12-19 12:49:30
问题 I need to sign a hash of 256 bits with ECDSA using a private key of 256 bits, just as bitcoin does, and I am reaching desperation because of the lack of documentation of ecdsa in python. I found a lot of codes on the internet, but there was nothing as easy as just ecdsa.sign(msg, privkey) or similar, everything I found is a lot of code of mathematical stuff I don't understand, but yet they use the ecdsa library (I don't know why they wouldn't add a signing function in a library that is going

SSH fingerprint verification for Amazon AWS EC2 server with ECDSA?

て烟熏妆下的殇ゞ 提交于 2019-12-18 10:39:40
问题 When I create a new Amazon EC2 server, I connect to it using ssh as usual. I see the typical warning: $ ssh myserver The authenticity of host 'ec2-12-34-567-890.compute-1.amazonaws.com (12.34.567.890)' can't be established. ECDSA key fingerprint is 31:66:15:d2:19:41:2b:09:8a:8f:9f:bd:de:c6:ff:07. Are you sure you want to continue connecting (yes/no)? How do I verify the fingerprint before I sign in? Ideally an answer is based on something besides the original creation console log -- because

UWP ECDSP Signature

巧了我就是萌 提交于 2019-12-18 07:23:12
问题 I want to make a ECDSA signature with this code : AsymmetricKeyAlgorithmProvider objAsymmAlgProv = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithmNames.EcdsaSha256); CryptographicKey keypair = objAsymmAlgProv.CreateKeyPairWithCurveName(EccCurveNames.SecP256r1); BinaryStringEncoding encoding = BinaryStringEncoding.Utf8; buffMsg = CryptographicBuffer.ConvertStringToBinary("Test Message", encoding); IBuffer buffSIG = CryptographicEngine.Sign(keypair, buffMsg); byte []