I've set up a fresh installation of Ubuntu 16.04 and enabled full disk encryption using LUKS during installation.

Since the correct key map for my locale was not available yet, I entered a really weak password that was easy to type, with the intent of changing it after successful installation.

Now I'm starting to wonder whether this is a good idea at all. My question is about the strength of the encryption key and the effect of changing my password retroactively. Which of the following two scenarios is true?

  1. The strength of the encryption key is completely unrelated to the strength of the password that the user chose. The encryption key is always of similar strength and is generated randomly, with the user's password simply acting as some kind of "salt". What attackers will try to crack is not the encryption key but the user's password. So changing the user's password from a weak one to a strong one retroactively does significantly improve security.

  2. The strength of the encryption key is directly dependent on the strength of the original password that the user chose. The encryption key significantly varys in strength and is derived from the user's password (in a deterministic way). What attackers will try to crack is either the user's password or the encryption key itself. Changing the user's password from a weak one to a strong one retroactively does not really improve security because attackers will not try to crack the (now strong) password but the (still weak) encryption key whose strength didn't change through the password change and which is weak because the initial password was weak.

2 Answers 2


#1 is correct

The encryption key is always generated randomly and will have the same length no matter the password. An attacker would always attack the password, as it is far weaker than the encryption key.

The encryption key will be encrypted separately using the password, so changing the password to a stronger one will improve security.

  • Thank you! Is there any authoritative source for this, perhaps somewhere in the documentation, which I didn't find?
    – caw
    Nov 23, 2016 at 0:47
  • @caw There is community documentation on encrypted filesystems at help.ubuntu.com/community/… On number 4 of "I decided on the key size now. How do I protect the key?" It says "You can encrypt the key. The encrypted key is stored on the computer with the encrypted device. You can change the passphrase by reencrypting the key with a different one and you can have several copies of the same key encrypted for several people. "
    – Evan Chen
    Nov 23, 2016 at 2:22

I believe 1 is correct.

I'm not an expert on LUKS, but I do know that for Android's full device encryption (which uses dm-crypt), the actual encryption key is randomly generated, and that key is then in turn encrypted with the password the user chose. That way, the user can change the password without requiring a complete re-encryption of the disk. Therefore, the strength of the user's password directly affects the strength of the key.

  • 1
    Thanks for providing further confirmation and hinting at the Android implementation! From the Android docs: "Upon first boot, the device creates a randomly generated 128-bit master key [...] When the user sets the PIN/pass or password on the device, only the 128-bit key is re-encrypted and stored." However, that step of generating the key (which is done randomly here) is critical, I'd say, and similar documentation for Ubuntu would be great :)
    – caw
    Nov 23, 2016 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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