是否可以使用椭圆曲线加密来加密数据? [英] Is it possible to use elliptic curve cryptography for encrypting data?
问题描述
编辑:
我知道ECDH可以用来发送一个秘密值给某人,但你不能不决定发送什么数据。与具有ECDH的常规DH不同,所得到的秘密值总是相同的,因为它仅取决于密钥对。我想我可以使用这个值作为一个对称密码的密钥,并加密我选择的另一个密钥,并用该密钥加密数据(如果我想支持多个接收器)。这是一个好方法吗?
它可以用于ElGamal风格的构造来加密位。更现代的例子是 IES 计划,在您的情况下是ECIES。 Bouncycastle通过 IESEngine 支持此功能类。特别是第一个构造函数执行你似乎试图做的事情。
So far I have only seen it used in digital signatures and key agreement protocols. Can it be used like RSA to actually encrypt data? Are there any libraries for this?
Edited:
I need something like RSA. Encrypt the data with the recievers public key so later he can decyrpt it with his private key.
I know ECDH can be used to send a secret value to someone but you don't decide what data is sent. Unlike the "regular" DH with ECDH the resulting secret value is always the same since it only depends on the keypairs. I guess I could use this value as a key to a symmetric cipher and encrypt yet another key which is chosen by me and encrypt the data with that key (if I want to support multiple recievers). Is this a good way?
It can be used with ElGamal-style construct to encrypt the bits. A more modern instance of this is the IES scheme, ECIES in your case. Bouncycastle supports this with the IESEngine class. In particular the first constructor does what you seem to be trying to do.
这篇关于是否可以使用椭圆曲线加密来加密数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!