Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recreated gocryptfs.conf using masterkey have different EncryptedKey and Salt #847

Closed
WXZhao7 opened this issue May 17, 2024 · 1 comment

Comments

@WXZhao7
Copy link

WXZhao7 commented May 17, 2024

Hi, I'm new to gocryptfs.

I follow the guide Recreate gocryptfs.conf using masterkey and find that the recreated gocryptfs.conf using masterkey have different EncryptedKey and Salt.

Just change step (2) rm a/gocryptfs.conf to mv a/gocryptfs.conf ., and finally compare the config file.

Both of config files keep the same masterkey as below. I'm curious about this meet expectations?

Thanks!

❯ diff a/gocryptfs.conf gocryptfs.conf
3c3
<       "EncryptedKey": "HBeBzmpiT2g2Hwx4gYjFWjDnRd+I3mTlqjCtBJ4jwzYEKvj3U7apBToXI2ouk/COXwuxMWxk0r6083E73i4rFg==",
---
>       "EncryptedKey": "j02SX8uCSq4Tahw0dZf2uvA7Sy9wtdcq0S7Uq2v7pNtLupme+4ot+ariSBYuDFAhFXp4rSinMEe/3DIaWh10Yw==",
5c5
<               "Salt": "u13rcCTaLWEDJSmcU+pC6nDirkOKF9X0y8dqiNlXKao=",
---
>               "Salt": "l9Vltw86WMTQmqsxTUBRPK5P/F0+KTNzdujUpS/9sPg=",
❯ gocryptfs-xray -dumpmasterkey gocryptfs.conf
Password:
3a106405bd54b05ce6f2a415728de53743c6d9d25fef07c464d17a171f7f538c
❯ gocryptfs-xray -dumpmasterkey a/gocryptfs.conf
Password:
3a106405bd54b05ce6f2a415728de53743c6d9d25fef07c464d17a171f7f538c
@rfjakob
Copy link
Owner

rfjakob commented May 17, 2024

Yes looks good.

The differences you see are because a new random Key Encryption Key has been used to encrypt the master key (KEK, https://nuetzlich.net/gocryptfs/forward_mode_crypto/#master-key-storage ).

@rfjakob rfjakob closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants