0

I know with RSA there are a few ways you can encrypt and decrypt data, meaning you can encrypt with either the public or private key (or both), and you can also decrypt with just a private or public key, or both.

With Triple Des, do you need both key and iv to decrypt? Or can you do it somehow with just a key? (public key?)

loyalflow
  • 14,275
  • 27
  • 107
  • 168

3 Answers3

2

Being a symmetric algorithm, DES (and 3DES) uses a shared secret key. It doesn't have public keys. And IV must be known to decryptor if this IV was used during encryption.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
2

RSA is a public-key (or asymmetric) encryption algorithm – which means that there are key pairs of public and private keys, where you encrypt with one of them and decrypt with the other.

DES and Triple-DES are block ciphers. You use them together with a mode of operation to encrypt or decrypt a message – you use the same key for encryption as for decryption. This is known as a symmetric algorithm.

Some modes of operation (all good ones) need an initialization vector, so identical plaintexts don't lead to identical ciphertexts (and sometimes other weaknesses as well). Normally this initialization vector should be send/stored together with the ciphertext, it doesn't have to be secret. Depending on the mode of operation and the usage scenario, the IV should be used only once, be random, or non-predictable.

Also, nowadays you should not use DES (it has a too small key size to be secure). Triple-DES is okay, but much slower (and not more secure) than modern algorithms like AES.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
1

3DES is no different than any other block cipher. If you are using a cipher mode which requires an IV, and you are not including the IV in the message header, you will need it to decrypt the message.

  • Ok if I am using IV that will also have to be shared, otherwise it looks like 3DES doesn't have the concept of both private and public keys right? It is a single key that will be shared? – loyalflow Jun 03 '13 at 18:00
  • Correct. 3DES is a symmetric block cipher; it has a single key which must be known by both parties. –  Jun 03 '13 at 18:37