Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I want to encrypt a small amount (few kilobytes) of data and be fairly confident it will be secure against brute force decryption and advances in cryptanalysis for at least a a few decades (or more). I am flexible on the amount of time it takes (even a minute is reasonable) to encrypt as this will run on the client machine, and not on a server.

My thought was to combine a few encryption algorithms over an iterative process - each iteration with a fresh key. The reasoning being:

  1. Multiple iterations increases the time necessary for each brute force attempt.
  2. Multiple algorithms means a failure in any one algorithm doesn't compromise the whole encryption.
  3. Multiple key effectively increases the key size to astronomical.

So it might look like this:

CipherText = AES(TwoFish(Serpent(PlainText)));

Except with many more layers of nesting (repeating the selected algorithms). Each layer will have a CSRNG generated Key and IV and use CBC.

  • Is this a good idea?
  • Does the nesting increase the security, or does it somehow introduce a new vulnerability?
  • If this is a good idea, which algorithms would be best to use?
  • Would it be better to use asymmetrical algorithms instead of symmetrical ones?
  • How many iterations is enough?

I'm fine with it being overkill. Just want to make sure it isn't going to make things worse.

Updated to specify resistance to cryptanalysis, use of CSPRNG for Key and IV and using CBC. Also removed references to outdated algorithms.

share|improve this question
1  
The main issue is, From where do you get the keys? Do you expect the user to enter 1000 key bits manually? If you use a normal password, that is most likely the weakpoint in your scheme. And you didn't specify a chaining mode, or if you're suing a MAC. –  CodesInChaos Sep 2 '12 at 10:54
1  
Do you want to be secure only from brute force (then everything with a 128 bit key size should be enough), or also save from advances in cryptanalysis? The latter is harder. –  Paŭlo Ebermann Sep 2 '12 at 10:59
2  
But where does your user keep the key? Does he print it? Does he memorize 1000 bits? –  CodesInChaos Sep 2 '12 at 15:30
1  
It helps against crypto-analysis, and brute-force is irrelevant for ciphers with 256 bit keys. But a cryptographic system is only as strong as its weakest part. It's unlikely that the actual cipher is the weakest part in your system. –  CodesInChaos Sep 2 '12 at 15:43
3  
@JimMcKeeth: if that's the case, why not use a secret sharing scheme. In the specific case where there are two parties, and you need both to recover the text, you can do this simply by generating a truly random string $S$, and give one party $S$, and the other party $S \oplus Plaintext$. –  poncho Sep 2 '12 at 16:25

3 Answers 3

up vote 3 down vote accepted

Is this a good idea?

Not really.

It is rare to find attacks against vetted designs that allow a complete break with a tiny amount of cipher-text.

Assuming you plan to have a unique key (which isn't used anywhere else) for just this few kilobytes of plaintext, it's very unlikely any cryptographic attack could be mounted against any modern cipher that would recover the plain-text.

Honestly, your message is likely to be absolutely fine encrypted with AES.

It's very unlikely someone's missed a key-recovery attack on AES that can be conducted with a few kilobytes of cipher-text.

Does the nesting increase the security, or does it somehow introduce a new vulnerability?

It is possible to do this badly and introduce a new vulnerability, yes.

If this is a good idea, which algorithms would be best to use?

Just use AES in GCM mode.

Would it be better to use asymmetrical algorithms instead of symmetrical ones?

No.

How many iterations is enough?

One iteration of AES in GCM mode is enough.

share|improve this answer
    
Thanks Simon. Good advice. Was not familiar with GCM but will do some research and see if I can find an implementation. Was going to use CBC. –  Jim McKeeth Sep 3 '12 at 2:30

Serpent alone should be safe for a few decades, infact most of the last AES finalists will be secure for that amount of time. I would say you can be sure that the data would be secure with a combination of Serpent and Twofish, Twofish isn't even remotely theoretically broken and Serpent has had much juice over it saying how secure it is. Also, I wouldn't recommend using Blowfish and Triple-DES with the other ciphers due to their 64-bit block size, compared to the other's 128-bit block.

EDIT: Be careful how you generate the keys, use a CSPRNG, or even multiple CSPRNGs who's out put have been XOR'd with eachother. If the keys have any sort of obvious relationship, it will probably be drastically easier to crack the rest.

share|improve this answer
    
"Serpent alone should be safe for a few decades" That's one bold claim, and past history doesn't really support this conclusion. Care for some references? As for CSPRNG's, it would be better to hash their outputs together, as XOR'ing them can destroy entropy and in general do more harm than good. –  Thomas Sep 2 '12 at 12:11
1  
Yes, I'd support the hashing idea. However, Serpent really is secure. Even the XLS attack won't weaken it much. After all, the AES submissions were expected to last for a long time, if I can remember right ( don't hold this against me, my memory is less effective than a goldfish's ) it was more than "a few decades". –  Erkling Sep 2 '12 at 12:21
1  
Also, the estimate of the time it would take to break Serpent came from an official document, it said that Rijndael would probably be secure for at least twenty years. Serpent, which is widely considered more secure than Rijndael as far as I can tell, would therefore ( according to common sense ) last longer, by how much, I am not sure. –  Erkling Sep 2 '12 at 12:37
    
Like I said, I'm fine with overkill. Does combining Serpent and Rijndael like I'm describing improve the strength? –  Jim McKeeth Sep 2 '12 at 15:31
1  
When combining multiple ciphers, ( provided their keys do not have a strong linear relationship ) security increase greatly. Also, I thought about what I said with the two 64-bit block ciphers, and this might actually be a good idea to introduce more key material to the block, since Blowfish has a maximum of 448-bits ( I think? ) wide key. –  Erkling Sep 3 '12 at 17:04

(1) Where are you going to keep the key for those decades? That is the point of attack.

(2) Regardless the answer to 1, for such a small amount of data use a one time pad. However you planned to keep the key secure for the intervening decades, use it to keep the pad safe.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.