是否可以使用椭圆曲线加密来加密数据? [英] Is it possible to use elliptic curve cryptography for encrypting data?

查看:148
本文介绍了是否可以使用椭圆曲线加密来加密数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我只看到它用于数字签名和密钥协议协议。它可以像RSA实际加密数据吗?是否有任何图书馆?



编辑:





我知道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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆