问题标签 [ecdsa]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - Bouncy Castle ECDSA 从私钥创建公钥
我正在尝试在 c# 中签署比特币交易。我有 2 位代码要完成。我可以使用 Bouncy castle 创建一组私钥和公钥。我可以将其转换为钱包导入格式。
我还可以从 ECDSA 公钥生成比特币地址。
但是,我想签署一笔交易,而我所拥有的只是我的私钥。我不想导入钱包并签名。那么如何生成公钥,只给私钥呢?
我找到了一个执行此操作的 javascript 方法:
我在 Bouncy Castle 中看到的唯一方法是生成一个随机对。
android - java.security.SignatureException:错误解码签名字节
尝试验证 Android KitKat 设备(Nexus 5)中的签名时出现此异常。
使用KeyFactory
作为 EC 算法和签名实例作为NONEwithECDSA
.
异常日志:
谁能解释如何克服这个错误?
ruby - Ruby/openssl:将椭圆曲线点八位字节字符串转换为 OpenSSL::PKey::EC::Point
我正在尝试编写 Ruby 代码来检查我在此处找到的特定消息的椭圆曲线数字签名算法 (ECDSA) 签名。
问题是我不知道如何将公钥的八位字节字符串转换为OpenSSL::PKey::EC::Point对象。如果我在 C 中编写此代码,我只需将八位字节字符串传递给 OpenSSL 的o2i_ECPublicKey
,它的功能与我想要的很接近,实际上已被参考实现使用。但是,我搜索了Ruby (MRI) 的源代码,它不包含对的调用,o2i_ECPublicKey
所以我不知道如何在不编写 C 扩展的情况下从 Ruby 中使用该函数。
这是八位字节字符串,以十六进制表示。它只是一个 0x04 字节,后跟两个 32 字节整数,表示椭圆曲线上点的 x 和 y 坐标:
那么有人知道如何将该字符串转换为OpenSSL::PKey::EC::Point
Ruby 中的 in 吗?获得点对象后,我将在以下代码中使用它,我相信这将验证签名:
更新:
感谢 Jay-Ar Polidario,我得到了它的工作。这是我使用 OpenSSL 验证签名的完整代码。我还编写了一个名为ecdsa的 gem ,并包含了显示如何使用我的 gem 来做同样事情的代码。
我认为 OpenSSL 让您将公钥暂时表示为单个 BN(大数字)很奇怪,因为它实际上是两个大数字。我的 gem 可以直接将八位字节字符串(在 SEC2 标准中定义)转换为ECDSA::Point
对象。
.net - Importing ECC-based certificate from the Windows Certificate Store into CngKey
How can I get the public/private keys from an ECC-based X509Certificate2
's into CngKey
's for use with ECDsaCng
and ECDiffieHellmanCng
?
I'm currently using RSA 2048 bit key pairs to sign/encrypt stuff. I'm doing this by pulling the certificates from the X509Store
where they are securely stored with private keys marked as non-exportable. I would like to convert the current implementation to use ECDSA and ECDH so that I can use smaller key sizes for equivalent security.
I've successfully generated ECC certs using openssl:
openssl ecparam -out private.pem -name prime256v1 -genkey
openssl req -new -key private.pem -x509 -nodes -days 365 -out public.cer
openssl pkcs12 -export -in public.cer -inkey private.pem -out export.pfx
I've successfully installed the above generated certs in to the cert store. I can retrieve them by thumbprint, but the crypto providers for the private and public keys throw "Algorithm not supported" exceptions. Instead, I understand I'm supposed to use ECDsaCng
and ECDiffieHellmanCng
to sign/encrypt. But these deal in CngKey
's.
Bouncy Castle isn't an option because it requires the private keys to be exportable.
CLR Security will return me a CngKey
pair via GetCngPrivateKey
but it cannot be used with ECDsa because the key returned by CLRSecurity is an ECDH key. Furthermore CLR Security doesn't give me a way to get just the public key from an X509Certificate2
for signature verification (where I don't even have or need the private key of the signer).
Any ideas? I'm at my wits end... Any help would be much appreciated.
cryptography - OpenSSL ECDSA 签名和验证文件
我想用椭圆曲线签署和验证一个 pdf。我得到了一些代码,但它不起作用。
创建私钥:
创建公钥:
签名文件:
验证文件:
签名和验证的部分不起作用。
key - 我需要一些帮助来对付 sha256 中的金钱错误
拥有私有 ECDSA 密钥 18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725
1 - 获取相应的公钥 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA6
2 - 对公钥 600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408 执行 SHA-256 散列
但是当我在 0450863AD64A87AE8A2FE83C1AF1A8403CB53F53E486D8511DAD8A04887E5B23522CD470243453A299FA9E77237716103ABC11A1DF38855ED6F2EE187E9C582BA 上运行 sha256
我不明白
600FFE422B4E00731A59557A5CCA46CC183944191006324A447BDB2D98D4B408
我得到的是
32511e82d56dcea68eb774094e25bab0f8bdd9bc1eca1ceeda38c7a43aceddce
我究竟做错了什么?
python - 没有带有 Paramiko 的名为 ecdsa 的模块
no module named ecdsa
当我使用 Paramiko 运行程序时,我不断出现错误。我已经使用pip安装了它,它说它已经安装了,但是当我再次运行程序时,它又出现了错误!
我能做些什么?顺便说一句,我正在使用 Linux。
php - ECC PHP 库
我花了几天时间试图找到有关特定 PHP 库的更多信息,但没有成功: https ://github.com/mdanter/phpecc
有没有人有关于如何使用它的信息?我想做的就是:
- 生成私钥和公钥对。
- 从给定的私钥中获取公钥。
- 验证签名消息。
基本上,PHP 相当于: http: //kjur.github.io/jsrsasign/sample-ecdsa.html
go - 如何使用 golang 加密写出 ecdsa 密钥?
我有一些 Go 代码来生成 ECDSA 密钥并将其写入文件:
这有效并生成一个“BEGIN EC PRIVATE KEY”块。但是,当您在 openssl 中写出密钥时,您还会得到一个“BEGIN EC PARAMETERS”块,指定使用的曲线。有没有办法将 EC PARAMETERS 写入 Go 中的 pem 文件?
signing - 如何在 Javacard 中使用 ECDSA 进行签名
我正在尝试使用 ECDSA 实现签名代码。但我在安装阶段总是收到错误 SW (6F00)。我尝试了多次更改参数。(例如 ALG_EC_FP / ALG_EC_F2M,LENGTH_EC_FP_xxx / LENGTH_EC_F2M_xxx)你能告诉我我在下面的代码中的错误吗?(版本 - JCDK 2.2.1,JDK 1.4.2)
我得到了一张 JCOP 卡及其规范,并且我读到该卡在规范中支持 ECC。但我怀疑规格是卡的规格,卡是否真的支持 ECC。有什么方法可以检查吗???
先感谢您。