I'm curious, as a green programmer, if one used layers of encryption methods, would this be more difficult to crack or impossible?


Layer 1- encryption method 1 "Encrypt this string"

Apply crypto = "encrypted mumbo jumbo"

Layer 2- encryption method 2 "encrypted mumbo jumbo"

Apply crypto layer 2 = "encrypted mumbo jumbo becomes encrypted mumbo jumbo"

And so on...

Does this heighten security and if so does would this take a long time to decrypt?

  • Are you talking about double encryption? It is not secure as one may though, See 2DES
    – kelalaka
    Commented Jan 21, 2021 at 23:43
  • @kelalaka, interesting. Well that gives me more information to research.
    – RobbB
    Commented Jan 21, 2021 at 23:52
  • I can be a bit more precise with my question now with more info; I speak of double encryption as: #1 encrypt a string with say AES, then #2 take that encrypted string and encrypt it with Triple DES, then #3 take that encrypted string and encrypt it with RSA. Also I'm most concerned with man in the middle protection. If a password for each layer is never exposed or networked then so long as the unit computer and user was secure enough from attacks, would this not be more secure from interception attacks?
    – RobbB
    Commented Jan 22, 2021 at 0:21
  • We don't analyze the homebrew algorithms, here and Crypto! It is better to define what you need, what do you want, what are your risks, etc.
    – kelalaka
    Commented Jan 22, 2021 at 0:24

2 Answers 2


would this be more difficult to crack or impossible?

If you use a modern encryption method like AES256 properly it is already effectively impossible to decrypt.

You can learn about AES256 from a variety of sources including cryptography textbooks, which are perhaps a good place to start for a self-described "green" programmer.

If you are interested in creating stronger ciphers by using multiple applications of weaker cipher you should read up on DES (weak) and 3DES "triple DES" (strong). These are also well know and well documented, so you should be able to find plenty of learning material online and in basic textbooks.

That being said... Yeah, sure, if you (as you propose in the comments to your OP) encrypt with AES, and then with 3DES, and then with RSA, then sure it will be more difficult to crack... but who cares since it is already impossible to crack AES...


While it is possible to gain an improvement in security by encrypting data with multiple algorithms in this way, it's generally not needed and not a good idea.

  • If you are using a secure 256-bit AEAD algorithm with a securely generated key and nonce (that is, using a KDF or both randomly generated on each use), such as AES-GCM or ChaCha20-Poly1305, you're already getting the best available level of security available. 256-bit symmetric encryption is suitable for protecting US government data at the top secret level and is the gold standard for encryption.
  • It is much easier to reason about your design and inspect it for defects if it uses a single, strong algorithm rather than a custom hodgepodge of nested encryption. It is much easier to explain to other developers, auditors, and customers that you use AES256-GCM than that you use a custom design. Moreover, nobody really wants you to be using Triple DES these days, so using that in addition to AES would make you seem a little questionable.

It is fine if you need to take the key for your symmetric algorithm and store it using RSA encryption if you need to distribute it amongst multiple users or want to store the encryption key offline.

However, in general, you're better off using something that someone competent has written for your encrypted cloud data needs. There are solutions which are well-known and robust and which prevent you from needing to implement cryptographic techniques. While the techniques I've described here are all secure, it's easy to make a mistake in implementation which destroys all of that security, so using existing, trusted software is best.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .