使用2048位java进行DES加密和解密

时间:2022-03-18 18:22:18

Is there any way of encryption and decryption using DEC/ECB 2048 bit and can we generate 2048 bit key using DES. I found that DES supports 64 bit, AES support 256 bits and If you want 2048 bit we can use RSA encryption and decryption. Also, I know that we use triple DES but it supports 168-bit encryption and decryption.

有没有使用DEC / ECB 2048位加密和解密的方法,我们可以使用DES生成2048位密钥。我发现DES支持64位,AES支持256位,如果你想要2048位,我们可以使用RSA加密和解密。另外,我知道我们使用三重DES,但它支持168位加密和解密。

But I want to know that is it possible 2048 bit encryption and decryption Using DES.

但我想知道是否可能使用DES进行2048位加密和解密。

Can anyone please suggest me on this or any different approach for this?

任何人都可以建议我这个或任何不同的方法吗?

1 个解决方案

#1


1  

No. DES allows only 56-bit keys, but is insecure due to the short key. Triple DES (3DES) is also judged insecure. (Source: Wikipedia) There is no provision in DES for other key lengths.

DES号只允许使用56位密钥,但由于密钥短,因此不安全。三重DES(3DES)也被认为是不安全的。 (来源:*)DES中没有规定其他密钥长度。

If you want a secure symmetric cipher scheme, I suggest you look into modern ciphers like AES-256 instead of pursuing old, insecure, ciphers.

如果你想要一个安全的对称密码方案,我建议你研究像AES-256这样的现代密码,而不是追求旧的,不安全的密码。

Possibly, your demand for a bigger encryption key stems from a misunderstanding of how crypto works. SSL uses the RSA cipher because it is a good public-key cryptosystem. This is useful in other situations than a symmetric cipher like DES. To quote Wikipedia:

可能,您对更大加密密钥的需求源于对加密如何工作的误解。 SSL使用RSA密码,因为它是一个很好的公钥密码系统。这在除DES等对称密码之外的其他情况下非常有用。引用*:

RSA is a relatively slow algorithm, and because of this, it is less commonly used to directly encrypt user data. More often, RSA passes encrypted shared keys for symmetric key cryptography which in turn can perform bulk encryption-decryption operations at much higher speed.

RSA是一种相对较慢的算法,因此,它不常用于直接加密用户数据。更常见的情况是,RSA传递用于对称密钥加密的加密共享密钥,这反过来可以以更高的速度执行批量加密 - 解密操作。

So, after the key exchange is done using RSA, both parties have a shared secret key which may be used for a block cipher like AES to transmit the bulk data rapidly .

因此,在使用RSA完成密钥交换之后,双方都具有共享密钥,该密钥可以用于诸如AES的分组密码以快速传输批量数据。

#1


1  

No. DES allows only 56-bit keys, but is insecure due to the short key. Triple DES (3DES) is also judged insecure. (Source: Wikipedia) There is no provision in DES for other key lengths.

DES号只允许使用56位密钥,但由于密钥短,因此不安全。三重DES(3DES)也被认为是不安全的。 (来源:*)DES中没有规定其他密钥长度。

If you want a secure symmetric cipher scheme, I suggest you look into modern ciphers like AES-256 instead of pursuing old, insecure, ciphers.

如果你想要一个安全的对称密码方案,我建议你研究像AES-256这样的现代密码,而不是追求旧的,不安全的密码。

Possibly, your demand for a bigger encryption key stems from a misunderstanding of how crypto works. SSL uses the RSA cipher because it is a good public-key cryptosystem. This is useful in other situations than a symmetric cipher like DES. To quote Wikipedia:

可能,您对更大加密密钥的需求源于对加密如何工作的误解。 SSL使用RSA密码,因为它是一个很好的公钥密码系统。这在除DES等对称密码之外的其他情况下非常有用。引用*:

RSA is a relatively slow algorithm, and because of this, it is less commonly used to directly encrypt user data. More often, RSA passes encrypted shared keys for symmetric key cryptography which in turn can perform bulk encryption-decryption operations at much higher speed.

RSA是一种相对较慢的算法,因此,它不常用于直接加密用户数据。更常见的情况是,RSA传递用于对称密钥加密的加密共享密钥,这反过来可以以更高的速度执行批量加密 - 解密操作。

So, after the key exchange is done using RSA, both parties have a shared secret key which may be used for a block cipher like AES to transmit the bulk data rapidly .

因此,在使用RSA完成密钥交换之后,双方都具有共享密钥,该密钥可以用于诸如AES的分组密码以快速传输批量数据。