how to decrypt ecryptfs file with private key instead of passphrase
I have an encrypted share folder on my synology NAS DS413 (which uses ecryptfs). I can manually mount the encrypted folder and read the decrypted files without issue, using synologies GUI. For some reason, I have never been able to mount the encrypted folder using my passphrase . But I can always do it by using the private key generated during ecryptfs setup.
So I have since been doing some research on decrypting the encrypted files without a synology (for example if this thing catches fire or is stolen and I need to restore from backup). I've read several threads and howto's on decrypting synology/ecryptfs encrypted shares using linux and encryptfs-utils. But the howto always tells you to provide the passphrase and never mention the use of the key for decryption. So my question is how do I decrypt using the key (which works to mount and decrypt with synology's software)? The key I have is 80 bytes and is binary. The first 16 bytes are integers only and the remaining bytes appear to be random hex.
Thanks for any tips!
linux encryption ecryptfs
add a comment |
I have an encrypted share folder on my synology NAS DS413 (which uses ecryptfs). I can manually mount the encrypted folder and read the decrypted files without issue, using synologies GUI. For some reason, I have never been able to mount the encrypted folder using my passphrase . But I can always do it by using the private key generated during ecryptfs setup.
So I have since been doing some research on decrypting the encrypted files without a synology (for example if this thing catches fire or is stolen and I need to restore from backup). I've read several threads and howto's on decrypting synology/ecryptfs encrypted shares using linux and encryptfs-utils. But the howto always tells you to provide the passphrase and never mention the use of the key for decryption. So my question is how do I decrypt using the key (which works to mount and decrypt with synology's software)? The key I have is 80 bytes and is binary. The first 16 bytes are integers only and the remaining bytes appear to be random hex.
Thanks for any tips!
linux encryption ecryptfs
1
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23
add a comment |
I have an encrypted share folder on my synology NAS DS413 (which uses ecryptfs). I can manually mount the encrypted folder and read the decrypted files without issue, using synologies GUI. For some reason, I have never been able to mount the encrypted folder using my passphrase . But I can always do it by using the private key generated during ecryptfs setup.
So I have since been doing some research on decrypting the encrypted files without a synology (for example if this thing catches fire or is stolen and I need to restore from backup). I've read several threads and howto's on decrypting synology/ecryptfs encrypted shares using linux and encryptfs-utils. But the howto always tells you to provide the passphrase and never mention the use of the key for decryption. So my question is how do I decrypt using the key (which works to mount and decrypt with synology's software)? The key I have is 80 bytes and is binary. The first 16 bytes are integers only and the remaining bytes appear to be random hex.
Thanks for any tips!
linux encryption ecryptfs
I have an encrypted share folder on my synology NAS DS413 (which uses ecryptfs). I can manually mount the encrypted folder and read the decrypted files without issue, using synologies GUI. For some reason, I have never been able to mount the encrypted folder using my passphrase . But I can always do it by using the private key generated during ecryptfs setup.
So I have since been doing some research on decrypting the encrypted files without a synology (for example if this thing catches fire or is stolen and I need to restore from backup). I've read several threads and howto's on decrypting synology/ecryptfs encrypted shares using linux and encryptfs-utils. But the howto always tells you to provide the passphrase and never mention the use of the key for decryption. So my question is how do I decrypt using the key (which works to mount and decrypt with synology's software)? The key I have is 80 bytes and is binary. The first 16 bytes are integers only and the remaining bytes appear to be random hex.
Thanks for any tips!
linux encryption ecryptfs
linux encryption ecryptfs
asked Jan 8 '15 at 15:14
kevincw01kevincw01
162
162
1
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23
add a comment |
1
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23
1
1
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23
add a comment |
2 Answers
2
active
oldest
votes
See by "How To Recover Synology encrypted folders in Linux" by Robert Castle. Summary:
MOUNTOPTIONS=""
for option in
"key=passphrase"
"ecryptfs_cipher=aes"
"ecryptfs_key_bytes=32"
"ecryptfs_passthrough=no"
"ecryptfs_enable_filename_crypto=yes"
; do
MOUNTOPTIONS="${MOUNTOPTIONS}${MOUNTOPTIONS:+,}$option"
done
sudo mount -t ecryptfs -o $MOUNTOPTIONS,passwd=$PASSWORD $CRYPTDIR $TARGET
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
add a comment |
Short answer: Use the passphrase $1$5YN01o9y to reveal your actual passphrase from the keyfile with ecryptfs-unwrap-passphrase (the backslashes escape the $ letters):
printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase keyfile.key -
Then use your passphrase with one of the instructions you probably already know, like AlexP's answer here or Robert Castle's article.
Or do it all in a single line:
mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passwd=$(printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase /path/to/keyfile.key -) /path/to/encrypted/folder /path/to/mountpoint
I just tested the whole decryption process with a keyfile and can confirm its working:
- Created a new encrypted shared folder in DSM 6.2 and downloaded the keyfile.
- Shut down the NAS, removed a drive, connected it to a Ubuntu x64 18.04.2 machine and mounted the raid and volume group there.
- Installed
ecryptfs-utilsand successfully got access to the decrypted data using the mount command mentioned above with the downloaded keyfile.
Credits: I found that $1$5YN01o9y-passphrase in a post in a German Synology forum. The user that probably actually found out the secret in 2014 is known there as Bastian (b666m).
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f178160%2fhow-to-decrypt-ecryptfs-file-with-private-key-instead-of-passphrase%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
See by "How To Recover Synology encrypted folders in Linux" by Robert Castle. Summary:
MOUNTOPTIONS=""
for option in
"key=passphrase"
"ecryptfs_cipher=aes"
"ecryptfs_key_bytes=32"
"ecryptfs_passthrough=no"
"ecryptfs_enable_filename_crypto=yes"
; do
MOUNTOPTIONS="${MOUNTOPTIONS}${MOUNTOPTIONS:+,}$option"
done
sudo mount -t ecryptfs -o $MOUNTOPTIONS,passwd=$PASSWORD $CRYPTDIR $TARGET
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
add a comment |
See by "How To Recover Synology encrypted folders in Linux" by Robert Castle. Summary:
MOUNTOPTIONS=""
for option in
"key=passphrase"
"ecryptfs_cipher=aes"
"ecryptfs_key_bytes=32"
"ecryptfs_passthrough=no"
"ecryptfs_enable_filename_crypto=yes"
; do
MOUNTOPTIONS="${MOUNTOPTIONS}${MOUNTOPTIONS:+,}$option"
done
sudo mount -t ecryptfs -o $MOUNTOPTIONS,passwd=$PASSWORD $CRYPTDIR $TARGET
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
add a comment |
See by "How To Recover Synology encrypted folders in Linux" by Robert Castle. Summary:
MOUNTOPTIONS=""
for option in
"key=passphrase"
"ecryptfs_cipher=aes"
"ecryptfs_key_bytes=32"
"ecryptfs_passthrough=no"
"ecryptfs_enable_filename_crypto=yes"
; do
MOUNTOPTIONS="${MOUNTOPTIONS}${MOUNTOPTIONS:+,}$option"
done
sudo mount -t ecryptfs -o $MOUNTOPTIONS,passwd=$PASSWORD $CRYPTDIR $TARGET
See by "How To Recover Synology encrypted folders in Linux" by Robert Castle. Summary:
MOUNTOPTIONS=""
for option in
"key=passphrase"
"ecryptfs_cipher=aes"
"ecryptfs_key_bytes=32"
"ecryptfs_passthrough=no"
"ecryptfs_enable_filename_crypto=yes"
; do
MOUNTOPTIONS="${MOUNTOPTIONS}${MOUNTOPTIONS:+,}$option"
done
sudo mount -t ecryptfs -o $MOUNTOPTIONS,passwd=$PASSWORD $CRYPTDIR $TARGET
answered Dec 8 '16 at 9:11
AlexPAlexP
7,2671125
7,2671125
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
add a comment |
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
Sorry, you're using the passphrase and not the key.
– kevincw01
Dec 8 '16 at 14:09
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
@kevincw01: Read the linked article, not just my summary. You can mount the filesystem by first adding the key to the keyring.
– AlexP
Dec 8 '16 at 15:24
3
3
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
I did read it. In fact that's the article I originally read before I posted this question. I reread it just now to make sure and I don't see anything that talks about how to use the key file instead of the passphrase.
– kevincw01
Dec 8 '16 at 19:09
1
1
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
@kevincw01: What exactly is "the private key generated during ecryptfs setup"? It is something else than the eCryptfs wrapped passphrase?
– AlexP
Dec 8 '16 at 21:38
add a comment |
Short answer: Use the passphrase $1$5YN01o9y to reveal your actual passphrase from the keyfile with ecryptfs-unwrap-passphrase (the backslashes escape the $ letters):
printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase keyfile.key -
Then use your passphrase with one of the instructions you probably already know, like AlexP's answer here or Robert Castle's article.
Or do it all in a single line:
mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passwd=$(printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase /path/to/keyfile.key -) /path/to/encrypted/folder /path/to/mountpoint
I just tested the whole decryption process with a keyfile and can confirm its working:
- Created a new encrypted shared folder in DSM 6.2 and downloaded the keyfile.
- Shut down the NAS, removed a drive, connected it to a Ubuntu x64 18.04.2 machine and mounted the raid and volume group there.
- Installed
ecryptfs-utilsand successfully got access to the decrypted data using the mount command mentioned above with the downloaded keyfile.
Credits: I found that $1$5YN01o9y-passphrase in a post in a German Synology forum. The user that probably actually found out the secret in 2014 is known there as Bastian (b666m).
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Short answer: Use the passphrase $1$5YN01o9y to reveal your actual passphrase from the keyfile with ecryptfs-unwrap-passphrase (the backslashes escape the $ letters):
printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase keyfile.key -
Then use your passphrase with one of the instructions you probably already know, like AlexP's answer here or Robert Castle's article.
Or do it all in a single line:
mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passwd=$(printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase /path/to/keyfile.key -) /path/to/encrypted/folder /path/to/mountpoint
I just tested the whole decryption process with a keyfile and can confirm its working:
- Created a new encrypted shared folder in DSM 6.2 and downloaded the keyfile.
- Shut down the NAS, removed a drive, connected it to a Ubuntu x64 18.04.2 machine and mounted the raid and volume group there.
- Installed
ecryptfs-utilsand successfully got access to the decrypted data using the mount command mentioned above with the downloaded keyfile.
Credits: I found that $1$5YN01o9y-passphrase in a post in a German Synology forum. The user that probably actually found out the secret in 2014 is known there as Bastian (b666m).
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Short answer: Use the passphrase $1$5YN01o9y to reveal your actual passphrase from the keyfile with ecryptfs-unwrap-passphrase (the backslashes escape the $ letters):
printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase keyfile.key -
Then use your passphrase with one of the instructions you probably already know, like AlexP's answer here or Robert Castle's article.
Or do it all in a single line:
mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passwd=$(printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase /path/to/keyfile.key -) /path/to/encrypted/folder /path/to/mountpoint
I just tested the whole decryption process with a keyfile and can confirm its working:
- Created a new encrypted shared folder in DSM 6.2 and downloaded the keyfile.
- Shut down the NAS, removed a drive, connected it to a Ubuntu x64 18.04.2 machine and mounted the raid and volume group there.
- Installed
ecryptfs-utilsand successfully got access to the decrypted data using the mount command mentioned above with the downloaded keyfile.
Credits: I found that $1$5YN01o9y-passphrase in a post in a German Synology forum. The user that probably actually found out the secret in 2014 is known there as Bastian (b666m).
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Short answer: Use the passphrase $1$5YN01o9y to reveal your actual passphrase from the keyfile with ecryptfs-unwrap-passphrase (the backslashes escape the $ letters):
printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase keyfile.key -
Then use your passphrase with one of the instructions you probably already know, like AlexP's answer here or Robert Castle's article.
Or do it all in a single line:
mount -t ecryptfs -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes,passwd=$(printf "%s" "$1$5YN01o9y" | ecryptfs-unwrap-passphrase /path/to/keyfile.key -) /path/to/encrypted/folder /path/to/mountpoint
I just tested the whole decryption process with a keyfile and can confirm its working:
- Created a new encrypted shared folder in DSM 6.2 and downloaded the keyfile.
- Shut down the NAS, removed a drive, connected it to a Ubuntu x64 18.04.2 machine and mounted the raid and volume group there.
- Installed
ecryptfs-utilsand successfully got access to the decrypted data using the mount command mentioned above with the downloaded keyfile.
Credits: I found that $1$5YN01o9y-passphrase in a post in a German Synology forum. The user that probably actually found out the secret in 2014 is known there as Bastian (b666m).
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 26 mins ago
x-rayx-ray
1011
1011
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
x-ray is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f178160%2fhow-to-decrypt-ecryptfs-file-with-private-key-instead-of-passphrase%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
I'd be far more concerned about disk failure & power surges, or accidental overwrite, than I would be about fire & theft. And what's synologies & just wondering what system are you running, Ubuntu, Arch, Debian, etc?
– Xen2050
Jan 14 '15 at 1:52
raid 5 and ecryptfs backup to amazon glacier
– kevincw01
Jan 14 '15 at 14:23