How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







24















There are built-in functionalities to encrypt a storage on OS X (FileVault) and Android.



On OS X: to enable encryption current user must have a password protected account. After enabling the encryption, recovery key is generated (something like HHWj-Y8DK-ODO4-BQEN-FQ4V-M4O8). After the encryption is finished (and in all probability before that as well) user is able to change his password, without the need to re-encrypt the storage.



On Android: user is required to set lockscreen protection to either pin or password. After storage encryption is done (again, probably before that as well), user is able to change password, and even switch from password to pin and vice versa.



Now here is what puzzles me: my understanding is that when storage is encrypted, it is done with current user password (sort of like encrypting an archive) and if password is changed — the whole storage must be re-encrypted. This (apparently incorrect) understanding brings me to following questions:




  1. Based on what "key" (since it is not the password itself) encryption is done then?


    • For OS X, I am guessing, it's the recovery key, but how is it connected to the user's password then?



  2. If password is not the basis for encryption, why is it required to set one before encrypting your storage?

  3. How is ability to decrypt storage is maintained (without re-encrypting) after password is changed?










share|improve this question









New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2





    I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

    – forest
    yesterday











  • @forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

    – mbomb007
    14 hours ago













  • Related (Superuser): Does changing the encryption password imply rewriting all the data?

    – Marc.2377
    5 hours ago


















24















There are built-in functionalities to encrypt a storage on OS X (FileVault) and Android.



On OS X: to enable encryption current user must have a password protected account. After enabling the encryption, recovery key is generated (something like HHWj-Y8DK-ODO4-BQEN-FQ4V-M4O8). After the encryption is finished (and in all probability before that as well) user is able to change his password, without the need to re-encrypt the storage.



On Android: user is required to set lockscreen protection to either pin or password. After storage encryption is done (again, probably before that as well), user is able to change password, and even switch from password to pin and vice versa.



Now here is what puzzles me: my understanding is that when storage is encrypted, it is done with current user password (sort of like encrypting an archive) and if password is changed — the whole storage must be re-encrypted. This (apparently incorrect) understanding brings me to following questions:




  1. Based on what "key" (since it is not the password itself) encryption is done then?


    • For OS X, I am guessing, it's the recovery key, but how is it connected to the user's password then?



  2. If password is not the basis for encryption, why is it required to set one before encrypting your storage?

  3. How is ability to decrypt storage is maintained (without re-encrypting) after password is changed?










share|improve this question









New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2





    I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

    – forest
    yesterday











  • @forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

    – mbomb007
    14 hours ago













  • Related (Superuser): Does changing the encryption password imply rewriting all the data?

    – Marc.2377
    5 hours ago














24












24








24


2






There are built-in functionalities to encrypt a storage on OS X (FileVault) and Android.



On OS X: to enable encryption current user must have a password protected account. After enabling the encryption, recovery key is generated (something like HHWj-Y8DK-ODO4-BQEN-FQ4V-M4O8). After the encryption is finished (and in all probability before that as well) user is able to change his password, without the need to re-encrypt the storage.



On Android: user is required to set lockscreen protection to either pin or password. After storage encryption is done (again, probably before that as well), user is able to change password, and even switch from password to pin and vice versa.



Now here is what puzzles me: my understanding is that when storage is encrypted, it is done with current user password (sort of like encrypting an archive) and if password is changed — the whole storage must be re-encrypted. This (apparently incorrect) understanding brings me to following questions:




  1. Based on what "key" (since it is not the password itself) encryption is done then?


    • For OS X, I am guessing, it's the recovery key, but how is it connected to the user's password then?



  2. If password is not the basis for encryption, why is it required to set one before encrypting your storage?

  3. How is ability to decrypt storage is maintained (without re-encrypting) after password is changed?










share|improve this question









New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












There are built-in functionalities to encrypt a storage on OS X (FileVault) and Android.



On OS X: to enable encryption current user must have a password protected account. After enabling the encryption, recovery key is generated (something like HHWj-Y8DK-ODO4-BQEN-FQ4V-M4O8). After the encryption is finished (and in all probability before that as well) user is able to change his password, without the need to re-encrypt the storage.



On Android: user is required to set lockscreen protection to either pin or password. After storage encryption is done (again, probably before that as well), user is able to change password, and even switch from password to pin and vice versa.



Now here is what puzzles me: my understanding is that when storage is encrypted, it is done with current user password (sort of like encrypting an archive) and if password is changed — the whole storage must be re-encrypted. This (apparently incorrect) understanding brings me to following questions:




  1. Based on what "key" (since it is not the password itself) encryption is done then?


    • For OS X, I am guessing, it's the recovery key, but how is it connected to the user's password then?



  2. If password is not the basis for encryption, why is it required to set one before encrypting your storage?

  3. How is ability to decrypt storage is maintained (without re-encrypting) after password is changed?







encryption passwords android disk-encryption macosx






share|improve this question









New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 22 hours ago







Filipp W.













New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Filipp W.Filipp W.

22828




22828




New contributor




Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Filipp W. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2





    I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

    – forest
    yesterday











  • @forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

    – mbomb007
    14 hours ago













  • Related (Superuser): Does changing the encryption password imply rewriting all the data?

    – Marc.2377
    5 hours ago














  • 2





    I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

    – forest
    yesterday











  • @forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

    – mbomb007
    14 hours ago













  • Related (Superuser): Does changing the encryption password imply rewriting all the data?

    – Marc.2377
    5 hours ago








2




2





I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

– forest
yesterday





I'm pretty sure this is a duplicate, but I can't find the question I'm thinking of...

– forest
yesterday













@forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

– mbomb007
14 hours ago







@forest It could be a duplicate of this, but honestly I think that this question is better than that one. I also think I remember a question about why a user's encrypted drive was "deleted" so quickly, and it's because just the key was deleted, but I can't find it.

– mbomb007
14 hours ago















Related (Superuser): Does changing the encryption password imply rewriting all the data?

– Marc.2377
5 hours ago





Related (Superuser): Does changing the encryption password imply rewriting all the data?

– Marc.2377
5 hours ago










2 Answers
2






active

oldest

votes


















42














At a high level, disk encryption is implemented using a data encryption key (DEK) and a key encryption key (KEK). The DEK is generated randomly and used to encrypt the drive, the KEK is derived from the user's password using a KDF like PBKDF2 or Argon2 and then used to encrypt the DEK.



When changing the password, the DEK is simply encrypted with a new KEK derived from the new password.



Encrypting without a password is likely prohibited to avoid a false sense of security. It'd be a bit like locking your door but leaving the key in the lock.



Of course, if you're changing your password because you believe someone figured it out, and that person also had access to the encrypted device, it's possible they stored a copy of the DEK. In this case it may be necessary to re-encrypt the entire drive, though doing so will likely take some time.






share|improve this answer



















  • 20





    It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

    – vidarlo
    yesterday






  • 4





    @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

    – AndrolGenhald
    yesterday











  • That, I do not disagree with :)

    – vidarlo
    yesterday











  • They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

    – user71659
    13 hours ago



















11














I completely agree with AndrolGenhald's high-level answer. In case you are interested in a complementary low-level walk-through of Android's storage encryption implementation:



Android can do File-Based Encryption (FBE) and Full-Disc Encryption (FDE), with "disc" referring to the /data partition. I will focus on FDE to illustrate the principle. The set-up is done by the Volume Daemon (Vold), specifically in system/vold/cryptfs.cpp.





  • cryptfs_enable_internal(int crypt_type, const char* passwd, ...) starts the storage encryption, with crypt_type specifying if a pin or password is used (to determine which keyboard to show on the unlock screen) and passwd giving the actual user pin/password. It will set up a footer crypt_ftr to be stored along the encrypted partition, then it calls create_encrypted_random_key to populate the crypt_ftr.





    • create_encrypted_random_key generates a random master key and a random salt and passes them on to encrypt_master_key.


    • encrypt_master_key uses a key-derivation function (e.g. scrypt), that takes the salt and the user pin/password as an input and deterministically derives an intermediate key. The master key is then encrypted with the intermediate key using AES-128-CBC. The encrypted master key and the salt are stored in crypt_ftr, but not the user pin/password.

    • Back in cryptfs_enable_internal, the crypt_ftr is written to the disc. Then the actual storage encryption via Linux' dm-crypt is triggered using the decrypted master key.



  • cryptfs_check_passwd(const char* passwd) starts storage decryption by backtracking the above steps to obtain the decrypted master key. The crypt_ftr has to be read from the disc, containing the encrypted master key and the salt. The user-supplied pin/password plus salt are fed into the key derivation function. This results in an intermediate key that can decrypt the master key (most of this happens in decrypt_master_key_aux).



  • cryptfs_changepw(int crypt_type, const char* newpw) handles changing the user pin/password. It will not generate a new master key, it just encrypts the existing master key via encrypt_master_key using the new user pin/password.


Based on this information, the answers to your questions would be:




  1. The randomly generated master key is used for the actual storage encryption.


  2. We need a user pin/password to encrypt the master key. Thus the user pin/password is needed to later retrieve the master key for decrypting the storage.


  3. Changing the user pin/password will not change the master key, only the encryption of the master key.







share|improve this answer










New contributor




f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "162"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Filipp W. is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206979%2fhow-is-it-possible-for-users-password-to-be-changed-after-storage-was-encrypted%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    42














    At a high level, disk encryption is implemented using a data encryption key (DEK) and a key encryption key (KEK). The DEK is generated randomly and used to encrypt the drive, the KEK is derived from the user's password using a KDF like PBKDF2 or Argon2 and then used to encrypt the DEK.



    When changing the password, the DEK is simply encrypted with a new KEK derived from the new password.



    Encrypting without a password is likely prohibited to avoid a false sense of security. It'd be a bit like locking your door but leaving the key in the lock.



    Of course, if you're changing your password because you believe someone figured it out, and that person also had access to the encrypted device, it's possible they stored a copy of the DEK. In this case it may be necessary to re-encrypt the entire drive, though doing so will likely take some time.






    share|improve this answer



















    • 20





      It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

      – vidarlo
      yesterday






    • 4





      @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

      – AndrolGenhald
      yesterday











    • That, I do not disagree with :)

      – vidarlo
      yesterday











    • They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

      – user71659
      13 hours ago
















    42














    At a high level, disk encryption is implemented using a data encryption key (DEK) and a key encryption key (KEK). The DEK is generated randomly and used to encrypt the drive, the KEK is derived from the user's password using a KDF like PBKDF2 or Argon2 and then used to encrypt the DEK.



    When changing the password, the DEK is simply encrypted with a new KEK derived from the new password.



    Encrypting without a password is likely prohibited to avoid a false sense of security. It'd be a bit like locking your door but leaving the key in the lock.



    Of course, if you're changing your password because you believe someone figured it out, and that person also had access to the encrypted device, it's possible they stored a copy of the DEK. In this case it may be necessary to re-encrypt the entire drive, though doing so will likely take some time.






    share|improve this answer



















    • 20





      It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

      – vidarlo
      yesterday






    • 4





      @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

      – AndrolGenhald
      yesterday











    • That, I do not disagree with :)

      – vidarlo
      yesterday











    • They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

      – user71659
      13 hours ago














    42












    42








    42







    At a high level, disk encryption is implemented using a data encryption key (DEK) and a key encryption key (KEK). The DEK is generated randomly and used to encrypt the drive, the KEK is derived from the user's password using a KDF like PBKDF2 or Argon2 and then used to encrypt the DEK.



    When changing the password, the DEK is simply encrypted with a new KEK derived from the new password.



    Encrypting without a password is likely prohibited to avoid a false sense of security. It'd be a bit like locking your door but leaving the key in the lock.



    Of course, if you're changing your password because you believe someone figured it out, and that person also had access to the encrypted device, it's possible they stored a copy of the DEK. In this case it may be necessary to re-encrypt the entire drive, though doing so will likely take some time.






    share|improve this answer













    At a high level, disk encryption is implemented using a data encryption key (DEK) and a key encryption key (KEK). The DEK is generated randomly and used to encrypt the drive, the KEK is derived from the user's password using a KDF like PBKDF2 or Argon2 and then used to encrypt the DEK.



    When changing the password, the DEK is simply encrypted with a new KEK derived from the new password.



    Encrypting without a password is likely prohibited to avoid a false sense of security. It'd be a bit like locking your door but leaving the key in the lock.



    Of course, if you're changing your password because you believe someone figured it out, and that person also had access to the encrypted device, it's possible they stored a copy of the DEK. In this case it may be necessary to re-encrypt the entire drive, though doing so will likely take some time.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered yesterday









    AndrolGenhaldAndrolGenhald

    12.2k53138




    12.2k53138








    • 20





      It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

      – vidarlo
      yesterday






    • 4





      @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

      – AndrolGenhald
      yesterday











    • That, I do not disagree with :)

      – vidarlo
      yesterday











    • They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

      – user71659
      13 hours ago














    • 20





      It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

      – vidarlo
      yesterday






    • 4





      @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

      – AndrolGenhald
      yesterday











    • That, I do not disagree with :)

      – vidarlo
      yesterday











    • They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

      – user71659
      13 hours ago








    20




    20





    It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

    – vidarlo
    yesterday





    It should be noted that encryption without encrypting the DEK may be useful. It allows for extremely quick secure deletion of content of the drive. Wipe they DEK, and the information stored is effectively wiped as well.

    – vidarlo
    yesterday




    4




    4





    @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

    – AndrolGenhald
    yesterday





    @vidarlo True, but I wouldn't expect the average user to understand this, or to need it.

    – AndrolGenhald
    yesterday













    That, I do not disagree with :)

    – vidarlo
    yesterday





    That, I do not disagree with :)

    – vidarlo
    yesterday













    They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

    – user71659
    13 hours ago





    They don't need to understand it, but they experience crypto data wipe when they reset their iOS device, even if they don't have a passcode set. It is also useful to encrypt before a password is set to ensure that when the user enables encryption, there isn't any residual unencrypted data on disk, and the enablement is much faster. This is what Windows Bitlocker does when compatible hardware encryption is available.

    – user71659
    13 hours ago













    11














    I completely agree with AndrolGenhald's high-level answer. In case you are interested in a complementary low-level walk-through of Android's storage encryption implementation:



    Android can do File-Based Encryption (FBE) and Full-Disc Encryption (FDE), with "disc" referring to the /data partition. I will focus on FDE to illustrate the principle. The set-up is done by the Volume Daemon (Vold), specifically in system/vold/cryptfs.cpp.





    • cryptfs_enable_internal(int crypt_type, const char* passwd, ...) starts the storage encryption, with crypt_type specifying if a pin or password is used (to determine which keyboard to show on the unlock screen) and passwd giving the actual user pin/password. It will set up a footer crypt_ftr to be stored along the encrypted partition, then it calls create_encrypted_random_key to populate the crypt_ftr.





      • create_encrypted_random_key generates a random master key and a random salt and passes them on to encrypt_master_key.


      • encrypt_master_key uses a key-derivation function (e.g. scrypt), that takes the salt and the user pin/password as an input and deterministically derives an intermediate key. The master key is then encrypted with the intermediate key using AES-128-CBC. The encrypted master key and the salt are stored in crypt_ftr, but not the user pin/password.

      • Back in cryptfs_enable_internal, the crypt_ftr is written to the disc. Then the actual storage encryption via Linux' dm-crypt is triggered using the decrypted master key.



    • cryptfs_check_passwd(const char* passwd) starts storage decryption by backtracking the above steps to obtain the decrypted master key. The crypt_ftr has to be read from the disc, containing the encrypted master key and the salt. The user-supplied pin/password plus salt are fed into the key derivation function. This results in an intermediate key that can decrypt the master key (most of this happens in decrypt_master_key_aux).



    • cryptfs_changepw(int crypt_type, const char* newpw) handles changing the user pin/password. It will not generate a new master key, it just encrypts the existing master key via encrypt_master_key using the new user pin/password.


    Based on this information, the answers to your questions would be:




    1. The randomly generated master key is used for the actual storage encryption.


    2. We need a user pin/password to encrypt the master key. Thus the user pin/password is needed to later retrieve the master key for decrypting the storage.


    3. Changing the user pin/password will not change the master key, only the encryption of the master key.







    share|improve this answer










    New contributor




    f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      11














      I completely agree with AndrolGenhald's high-level answer. In case you are interested in a complementary low-level walk-through of Android's storage encryption implementation:



      Android can do File-Based Encryption (FBE) and Full-Disc Encryption (FDE), with "disc" referring to the /data partition. I will focus on FDE to illustrate the principle. The set-up is done by the Volume Daemon (Vold), specifically in system/vold/cryptfs.cpp.





      • cryptfs_enable_internal(int crypt_type, const char* passwd, ...) starts the storage encryption, with crypt_type specifying if a pin or password is used (to determine which keyboard to show on the unlock screen) and passwd giving the actual user pin/password. It will set up a footer crypt_ftr to be stored along the encrypted partition, then it calls create_encrypted_random_key to populate the crypt_ftr.





        • create_encrypted_random_key generates a random master key and a random salt and passes them on to encrypt_master_key.


        • encrypt_master_key uses a key-derivation function (e.g. scrypt), that takes the salt and the user pin/password as an input and deterministically derives an intermediate key. The master key is then encrypted with the intermediate key using AES-128-CBC. The encrypted master key and the salt are stored in crypt_ftr, but not the user pin/password.

        • Back in cryptfs_enable_internal, the crypt_ftr is written to the disc. Then the actual storage encryption via Linux' dm-crypt is triggered using the decrypted master key.



      • cryptfs_check_passwd(const char* passwd) starts storage decryption by backtracking the above steps to obtain the decrypted master key. The crypt_ftr has to be read from the disc, containing the encrypted master key and the salt. The user-supplied pin/password plus salt are fed into the key derivation function. This results in an intermediate key that can decrypt the master key (most of this happens in decrypt_master_key_aux).



      • cryptfs_changepw(int crypt_type, const char* newpw) handles changing the user pin/password. It will not generate a new master key, it just encrypts the existing master key via encrypt_master_key using the new user pin/password.


      Based on this information, the answers to your questions would be:




      1. The randomly generated master key is used for the actual storage encryption.


      2. We need a user pin/password to encrypt the master key. Thus the user pin/password is needed to later retrieve the master key for decrypting the storage.


      3. Changing the user pin/password will not change the master key, only the encryption of the master key.







      share|improve this answer










      New contributor




      f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        11












        11








        11







        I completely agree with AndrolGenhald's high-level answer. In case you are interested in a complementary low-level walk-through of Android's storage encryption implementation:



        Android can do File-Based Encryption (FBE) and Full-Disc Encryption (FDE), with "disc" referring to the /data partition. I will focus on FDE to illustrate the principle. The set-up is done by the Volume Daemon (Vold), specifically in system/vold/cryptfs.cpp.





        • cryptfs_enable_internal(int crypt_type, const char* passwd, ...) starts the storage encryption, with crypt_type specifying if a pin or password is used (to determine which keyboard to show on the unlock screen) and passwd giving the actual user pin/password. It will set up a footer crypt_ftr to be stored along the encrypted partition, then it calls create_encrypted_random_key to populate the crypt_ftr.





          • create_encrypted_random_key generates a random master key and a random salt and passes them on to encrypt_master_key.


          • encrypt_master_key uses a key-derivation function (e.g. scrypt), that takes the salt and the user pin/password as an input and deterministically derives an intermediate key. The master key is then encrypted with the intermediate key using AES-128-CBC. The encrypted master key and the salt are stored in crypt_ftr, but not the user pin/password.

          • Back in cryptfs_enable_internal, the crypt_ftr is written to the disc. Then the actual storage encryption via Linux' dm-crypt is triggered using the decrypted master key.



        • cryptfs_check_passwd(const char* passwd) starts storage decryption by backtracking the above steps to obtain the decrypted master key. The crypt_ftr has to be read from the disc, containing the encrypted master key and the salt. The user-supplied pin/password plus salt are fed into the key derivation function. This results in an intermediate key that can decrypt the master key (most of this happens in decrypt_master_key_aux).



        • cryptfs_changepw(int crypt_type, const char* newpw) handles changing the user pin/password. It will not generate a new master key, it just encrypts the existing master key via encrypt_master_key using the new user pin/password.


        Based on this information, the answers to your questions would be:




        1. The randomly generated master key is used for the actual storage encryption.


        2. We need a user pin/password to encrypt the master key. Thus the user pin/password is needed to later retrieve the master key for decrypting the storage.


        3. Changing the user pin/password will not change the master key, only the encryption of the master key.







        share|improve this answer










        New contributor




        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        I completely agree with AndrolGenhald's high-level answer. In case you are interested in a complementary low-level walk-through of Android's storage encryption implementation:



        Android can do File-Based Encryption (FBE) and Full-Disc Encryption (FDE), with "disc" referring to the /data partition. I will focus on FDE to illustrate the principle. The set-up is done by the Volume Daemon (Vold), specifically in system/vold/cryptfs.cpp.





        • cryptfs_enable_internal(int crypt_type, const char* passwd, ...) starts the storage encryption, with crypt_type specifying if a pin or password is used (to determine which keyboard to show on the unlock screen) and passwd giving the actual user pin/password. It will set up a footer crypt_ftr to be stored along the encrypted partition, then it calls create_encrypted_random_key to populate the crypt_ftr.





          • create_encrypted_random_key generates a random master key and a random salt and passes them on to encrypt_master_key.


          • encrypt_master_key uses a key-derivation function (e.g. scrypt), that takes the salt and the user pin/password as an input and deterministically derives an intermediate key. The master key is then encrypted with the intermediate key using AES-128-CBC. The encrypted master key and the salt are stored in crypt_ftr, but not the user pin/password.

          • Back in cryptfs_enable_internal, the crypt_ftr is written to the disc. Then the actual storage encryption via Linux' dm-crypt is triggered using the decrypted master key.



        • cryptfs_check_passwd(const char* passwd) starts storage decryption by backtracking the above steps to obtain the decrypted master key. The crypt_ftr has to be read from the disc, containing the encrypted master key and the salt. The user-supplied pin/password plus salt are fed into the key derivation function. This results in an intermediate key that can decrypt the master key (most of this happens in decrypt_master_key_aux).



        • cryptfs_changepw(int crypt_type, const char* newpw) handles changing the user pin/password. It will not generate a new master key, it just encrypts the existing master key via encrypt_master_key using the new user pin/password.


        Based on this information, the answers to your questions would be:




        1. The randomly generated master key is used for the actual storage encryption.


        2. We need a user pin/password to encrypt the master key. Thus the user pin/password is needed to later retrieve the master key for decrypting the storage.


        3. Changing the user pin/password will not change the master key, only the encryption of the master key.








        share|improve this answer










        New contributor




        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer








        edited yesterday





















        New contributor




        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered yesterday









        f9c69e9781fa194211448473495534f9c69e9781fa194211448473495534

        1194




        1194




        New contributor




        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        f9c69e9781fa194211448473495534 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






















            Filipp W. is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Filipp W. is a new contributor. Be nice, and check out our Code of Conduct.













            Filipp W. is a new contributor. Be nice, and check out our Code of Conduct.












            Filipp W. is a new contributor. Be nice, and check out our Code of Conduct.
















            Thanks for contributing an answer to Information Security Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsecurity.stackexchange.com%2fquestions%2f206979%2fhow-is-it-possible-for-users-password-to-be-changed-after-storage-was-encrypted%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Masuk log Menu navigasi

            Identifying “long and narrow” polygons in with PostGISlength and width of polygonWhy postgis st_overlaps reports Qgis' “avoid intersections” generated polygon as overlapping with others?Adjusting polygons to boundary and filling holesDrawing polygons with fixed area?How to remove spikes in Polygons with PostGISDeleting sliver polygons after difference operation in QGIS?Snapping boundaries in PostGISSplit polygon into parts adding attributes based on underlying polygon in QGISSplitting overlap between polygons and assign to nearest polygon using PostGIS?Expanding polygons and clipping at midpoint?Removing Intersection of Buffers in Same Layers

            Старые Смолеговицы Содержание История | География | Демография | Достопримечательности | Примечания | НавигацияHGЯOLHGЯOL41 206 832 01641 606 406 141Административно-территориальное деление Ленинградской области«Переписная оброчная книга Водской пятины 1500 года», С. 793«Карта Ингерманландии: Ивангорода, Яма, Копорья, Нотеборга», по материалам 1676 г.«Генеральная карта провинции Ингерманландии» Э. Белинга и А. Андерсина, 1704 г., составлена по материалам 1678 г.«Географический чертёж над Ижорскою землей со своими городами» Адриана Шонбека 1705 г.Новая и достоверная всей Ингерманландии ланткарта. Грав. А. Ростовцев. СПб., 1727 г.Топографическая карта Санкт-Петербургской губернии. 5-и верстка. Шуберт. 1834 г.Описание Санкт-Петербургской губернии по уездам и станамСпецкарта западной части России Ф. Ф. Шуберта. 1844 г.Алфавитный список селений по уездам и станам С.-Петербургской губернииСписки населённых мест Российской Империи, составленные и издаваемые центральным статистическим комитетом министерства внутренних дел. XXXVII. Санкт-Петербургская губерния. По состоянию на 1862 год. СПб. 1864. С. 203Материалы по статистике народного хозяйства в С.-Петербургской губернии. Вып. IX. Частновладельческое хозяйство в Ямбургском уезде. СПб, 1888, С. 146, С. 2, 7, 54Положение о гербе муниципального образования Курское сельское поселениеСправочник истории административно-территориального деления Ленинградской области.Топографическая карта Ленинградской области, квадрат О-35-23-В (Хотыницы), 1930 г.АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1933, С. 27, 198АрхивированоАдминистративно-экономический справочник по Ленинградской области. — Л., 1936, с. 219АрхивированоАдминистративно-территориальное деление Ленинградской области. — Л., 1966, с. 175АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1973, С. 180АрхивированоАдминистративно-территориальное деление Ленинградской области. — Лениздат, 1990, ISBN 5-289-00612-5, С. 38АрхивированоАдминистративно-территориальное деление Ленинградской области. — СПб., 2007, с. 60АрхивированоКоряков Юрий База данных «Этно-языковой состав населённых пунктов России». Ленинградская область.Административно-территориальное деление Ленинградской области. — СПб, 1997, ISBN 5-86153-055-6, С. 41АрхивированоКультовый комплекс Старые Смолеговицы // Электронная энциклопедия ЭрмитажаПроблемы выявления, изучения и сохранения культовых комплексов с каменными крестами: по материалам работ 2016-2017 гг. в Ленинградской области