elliptic-curve

.NET implementation (libraries) of elliptic curve cryptography

徘徊边缘 提交于 2019-12-03 06:07:51
Please can you suggest any implementation of elliptical curve cryptography to be used on .NET platform? Also if you have used them, can you tell me the recommended curves that should be used? [EDIT] As @FatCat mentioned, its implementation is available in .NET framework 3.5 but that is only available on windows vista. Can you please suggest another way/library to use it? Check out the Bouncy Castle library for C#, it has ECDH and ECDSA. The .NET Framework already includes Diffie-Hellman, which is an elliptic curve crypto algorithm. Look under System.Security.Cryptography.ECDiffieHellmanCng .

Encrypting/decrypting text strings using OpenSSL ECC

浪尽此生 提交于 2019-12-03 03:49:38
问题 How can I use OpenSSL's ECC support to encrypt or decrypt a text string? I am able to generate ECC private/public keys using OpenSSL APIs, but I don't know how to encrypt plain text using those keys. 回答1: Since its so hard to find examples showing how to use ECC to encrypt data I thought I'd post some code for others to use. For the complete listing, check out my openssl-dev posting: http://www.mail-archive.com/openssl-dev@openssl.org/msg28042.html Basically its a flushed out usable version

Codes to generate a public key in an elliptic curve algorithm using a given private key

这一生的挚爱 提交于 2019-12-03 01:47:24
I need to implement ECC (Elliptic Curve Cryptography) algorithm using jdk 1.7. I tried using bouncy castle, sunEC, but all of them gave errors and errors. My target is to generate an elliptic curve using the private key, I will be given to the system. Thus, I need to get a accurate code to generate a public key using a given private key using jdk1.7. The IDE I use is ecllipse. And I need to know, what are the other parameters I should be given other than a private key? Is it enough to provide just a curve point and the private key? Can someone help me to generate public key from private key??

How does one access the raw ECDH public key, private key and params inside OpenSSL's EVP_PKEY structure?

五迷三道 提交于 2019-12-02 20:42:17
I'm using OpenSSL's c library to generate an elliptic curve Diffie-Hellman (ECDH) key pair, following the first code sample here . It glosses over the actual exchange of public keys with this line: peerkey = get_peerkey(pkey); The pkey variable and the return value are both of type EVP * . pkey contains the public key, private key, and params generated earlier, and the return value only contains the peer's public key. So this raises three questions: How would get_peerkey() actually extract just the public key from pkey for sending to the peer? How would the code extract the private key and

ECC private key is longer than public key

僤鯓⒐⒋嵵緔 提交于 2019-12-02 16:00:41
问题 I have generated ECC public and private key using secp192r1 curve. I get 75 for public and 125 for private encoded key array length. Why private key is longer than public key? Why private key is not longer two times than public? Why private key is not 192 bits = 24 bytes because of secp192r1? Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); ECNamedCurveParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("secp192r1"); KeyPairGenerator g = KeyPairGenerator

How to find the matching curve name from an ECPublicKey

别说谁变了你拦得住时间么 提交于 2019-12-02 13:14:50
问题 Currently i'm updating my x.509 certificate library to support ECC. Most of the builders that are implemented take a publicKey and derive the algorithm and such from the key. In RSA this is simple, you check the algorithm of the key and you can verify the bit length. However with ECC the key is based on a curve, and the curve name (of course) needs to be specified in the certificate (as OID). The issue i'm working on right now is finding a way to come from either a java.security.interfaces

Does OpenSSL -sign for ECDSA apply ASN1 encoding to the hash before signing?

十年热恋 提交于 2019-12-02 12:07:13
This SO question ECDSA sign using OpenSSL without ASN1 encoding the hash states the OpenSSL perfoms ASN1 encoding to the hash before signing it. In other words it states that OpenSSL performs the following steps when for an Elliptic curve key -sign is called: a. Calculate H = Hash(M) b. Encode H into ASN1 standard- H’ c. Sign H’ And thus to avoid applyting step b it's neccessary to first calculate the digest, and then sign the digest using raw signing - pkeyutl for elliptic curver keys However when I run BOTH -sign and -dgst+ -pkeyutl I am able to verify the signature using -verify in both

Scalar multiplication on secp521r1 using Crypto++

给你一囗甜甜゛ 提交于 2019-12-02 09:03:09
问题 I am writing the following code for scalar multiplication in elliptic curve in c++. The code runs when i don't initialize the value of the point. But when i do, it gives me the nullptr error. I have tried the below code: ECP r1; ECPPoint basepoint = ECPPoint(2,3); ECPPoint point; ECPPoint s1= ecp.ScalarMultiply(basepoint, x1); Error: CryptoPP::ECP::GetField(...) returned nullptr. 回答1: ERROR: CryptoPP::ECP::GetField(...) returned nullptr. For Crypto++ you need to load a curve. Based on the

ECC private key is longer than public key

旧城冷巷雨未停 提交于 2019-12-02 07:44:51
I have generated ECC public and private key using secp192r1 curve. I get 75 for public and 125 for private encoded key array length. Why private key is longer than public key? Why private key is not longer two times than public? Why private key is not 192 bits = 24 bytes because of secp192r1? Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); ECNamedCurveParameterSpec ecSpec = ECNamedCurveTable.getParameterSpec("secp192r1"); KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA", "BC"); g.initialize(ecSpec, new SecureRandom()); KeyPair pair = g.generateKeyPair()

Scalar multiplication on secp521r1 using Crypto++

自古美人都是妖i 提交于 2019-12-02 07:28:20
I am writing the following code for scalar multiplication in elliptic curve in c++. The code runs when i don't initialize the value of the point. But when i do, it gives me the nullptr error. I have tried the below code: ECP r1; ECPPoint basepoint = ECPPoint(2,3); ECPPoint point; ECPPoint s1= ecp.ScalarMultiply(basepoint, x1); Error: CryptoPP::ECP::GetField(...) returned nullptr. ERROR: CryptoPP::ECP::GetField(...) returned nullptr. For Crypto++ you need to load a curve. Based on the code you posted it does not look like that has been done. Loading the curve loads the domain parameters for the