elliptic-curve

Way to enumerate all elliptic curve names available in Java?

夙愿已清 提交于 2021-02-10 03:27:45
问题 Is there some way to enumerate all of the elliptic curve names that can be given to the ECGenParameterSpec constructor? Or do you have to just throw a big list of curve names at the wall and see which ones do or don't throw execeptions when you try to use them? 回答1: It depends very much on the provider you want to use. As stated by user69513, you'll want to consult the documentation. And there lies the most basic of problems. For the SunEC provider, the documentation is nowhere to be found,

ECDSA with SHA256 in Bouncy castle throws No Such Algorithm Exception

我只是一个虾纸丫 提交于 2021-02-07 08:50:41
问题 I am trying to generate a signature using ECDSA with SHA256 in Bouncy Castle as follows, I add the provider in the begining I have built the ECPrivatekey Signature s_oSignature = Signature.getInstance("SHA256withECDSA", BouncyCastleProvider.PROVIDER_NAME); but step 3 throws "java.security.NoSuchAlgorithmException: no such algorithm: SHA256withECDSA for provider BC" . But same "SHA256withECDSA" thing when replaced with "SHA1withECDSA" prceeds without any exception. How is it possible? I am

ECDSA with SHA256 in Bouncy castle throws No Such Algorithm Exception

此生再无相见时 提交于 2021-02-07 08:47:20
问题 I am trying to generate a signature using ECDSA with SHA256 in Bouncy Castle as follows, I add the provider in the begining I have built the ECPrivatekey Signature s_oSignature = Signature.getInstance("SHA256withECDSA", BouncyCastleProvider.PROVIDER_NAME); but step 3 throws "java.security.NoSuchAlgorithmException: no such algorithm: SHA256withECDSA for provider BC" . But same "SHA256withECDSA" thing when replaced with "SHA1withECDSA" prceeds without any exception. How is it possible? I am

ECDSA with SHA256 in Bouncy castle throws No Such Algorithm Exception

我的梦境 提交于 2021-02-07 08:45:12
问题 I am trying to generate a signature using ECDSA with SHA256 in Bouncy Castle as follows, I add the provider in the begining I have built the ECPrivatekey Signature s_oSignature = Signature.getInstance("SHA256withECDSA", BouncyCastleProvider.PROVIDER_NAME); but step 3 throws "java.security.NoSuchAlgorithmException: no such algorithm: SHA256withECDSA for provider BC" . But same "SHA256withECDSA" thing when replaced with "SHA1withECDSA" prceeds without any exception. How is it possible? I am

ECDSA with SHA256 in Bouncy castle throws No Such Algorithm Exception

我是研究僧i 提交于 2021-02-07 08:44:51
问题 I am trying to generate a signature using ECDSA with SHA256 in Bouncy Castle as follows, I add the provider in the begining I have built the ECPrivatekey Signature s_oSignature = Signature.getInstance("SHA256withECDSA", BouncyCastleProvider.PROVIDER_NAME); but step 3 throws "java.security.NoSuchAlgorithmException: no such algorithm: SHA256withECDSA for provider BC" . But same "SHA256withECDSA" thing when replaced with "SHA1withECDSA" prceeds without any exception. How is it possible? I am

Digitally sign a hex string in command line using elliptic curve secp256k1

房东的猫 提交于 2021-01-28 06:51:40
问题 I'm trying to figure out the most simple way to digitally sign a string of hex values using a private key also represented by a string of hex values. I'm open to command line, or a script, but preferably using openssl cli. Example: string to sign: 1333183ddf384da83ed49296136c70d206ad2b19331bf25d390e69b222165e37 private key: a675c86089e0622c112379906f5cf19ee336575af1bfa1de558051312db9afdc Hoping there is a command like: $ openssl sign -msg

Elliptic Curve Point Arithmetic in Crypto++

断了今生、忘了曾经 提交于 2021-01-28 06:31:35
问题 #include "include/cryptopp/oids.h" #include "include/cryptopp/eccrypto.h" #include <cstdio> #include <iostream> using namespace std; using namespace CryptoPP; void init() { ECDH<ECP>::Domain ecdhc(ASN1::secp256k1()); auto g_p = ecdhc.GetGroupParameters(); auto g_ec = g_p.GetSubgroupGenerator(); auto g_ec_ = g_p.GetCurve().Subtract(g_p.GetCurve().Add(g_ec, g_ec), g_ec); if(g_p.GetCurve().Equal(g_ec_, g_ec)) printf("P\n"); else printf("NP\n"); } int main() { init(); return 0; } As an example

Why does Curve25519 calculate key pair correctly even though its parameters are wrong?

半腔热情 提交于 2021-01-28 06:16:00
问题 It seems that .NET (Core 3.1) supports custom curves in ECC. So I've defined the Curve25519, and generated key pair by below code: using System; using System.Security.Cryptography; namespace Curve25519 { class Program { static void Main(string[] args) { ECCurve ecCurve = new ECCurve() // Curve25519, 32 bytes, 256 bit { CurveType = ECCurve.ECCurveType.PrimeMontgomery, B = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, A = new byte