LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-22-2016, 01:36 PM   #1
Thewyzewun
Member
 
Registered: Sep 2003
Location: UK
Distribution: Xubuntu 15.10
Posts: 95

Rep: Reputation: 15
Symlink two folders, one copy encrypted, the other not?


I wondered if anyone knows of a way to hijack the symlink mechanism such that it runs any changes through a cipher, resulting in one folder being unencrypted, the other encrypted.

Or, just a way to achieve the same.

I'd like to symlink my Zim notebook folder inside my Dropbox folder with:

Code:
$ ln -s ~/Notebooks ~/Dropbox/Notebooks
But I'd rather not give Dropbox a plain text copy of my notes.

I appreciate there are likely options that involve scheduling a job, I'm curious if anyone who reads this is aware of any means to achieve the ends I'm trying to here.

Thanks for reading
 
Old 11-22-2016, 01:45 PM   #2
Thewyzewun
Member
 
Registered: Sep 2003
Location: UK
Distribution: Xubuntu 15.10
Posts: 95

Original Poster
Rep: Reputation: 15
...I was searching with the keyword symlink, I realized I needed to generalize my query to being about normal folders. Since adjusting my keywords, it seems there are some options to explore. I've tried Cryptomater, but I get "Mount Failed", so will try BoxCryptor Classic (https://www.boxcryptor.com/en/download/)

Last edited by Thewyzewun; 11-22-2016 at 02:07 PM.
 
Old 11-22-2016, 02:22 PM   #3
Thewyzewun
Member
 
Registered: Sep 2003
Location: UK
Distribution: Xubuntu 15.10
Posts: 95

Original Poster
Rep: Reputation: 15
I get the impression that BoxCryptor may aswell not be performing the encryption client-side; they keep a copy of the keys on a centralized server, from what I can tell (so, I'm just introducing an additional party into the mix, not very helpful!).

Anyone got any better ideas? I read about EncFS, but it's not secure in this scenario (as detailed on Wikipedia).

Last edited by Thewyzewun; 11-22-2016 at 02:24 PM.
 
Old 11-22-2016, 04:27 PM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,783

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Quote:
Originally Posted by Thewyzewun View Post
I get the impression that BoxCryptor may aswell not be performing the encryption client-side; they keep a copy of the keys on a centralized server, from what I can tell (so, I'm just introducing an additional party into the mix, not very helpful!).
They claim that the keys are encrypted by your password, so it should be safe if you choose a sufficiently large and random password.

https://www.boxcryptor.com/en/technical-overview
Quote:
Boxcryptor is a zero-knowledge service provider because any private and sensitive information that we receive from the users will always be in the encrypted form protected by the user’s password - which is never transferred to us or anyone. Only public keys are in plain text.
Quote:
Originally Posted by Thewyzewun
I wondered if anyone knows of a way to hijack the symlink mechanism such that it runs any changes through a cipher, resulting in one folder being unencrypted, the other encrypted.

Or, just a way to achieve the same.
Perhaps you can use an encrypted loopback device? Then you would put the image file of your encrypted file system into the dropbox folder.
 
1 members found this post helpful.
Old 11-22-2016, 05:24 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by Thewyzewun View Post
I wondered if anyone knows of a way to hijack the symlink mechanism such that it runs any changes through a cipher, resulting in one folder being unencrypted, the other encrypted.
Either I am confused or you are. With a symlink (or a hard link, for that matter) there is only one copy of the file stored. It can't be both encrypted and unencrypted. A stacked filesystem like eCryptfs allows you to have an unencrypted view of data that is stored encrypted on the disk. How is that different from what you are asking for?
 
Old 11-22-2016, 08:40 PM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
"Bzzzzt!!! Nope!!!! (Sorry...)

Let's stop to consider exactly what these two types of "links" actually are. First, the preliminaries:
  • In the Linux system, the physical representation of "a file" is called an inode ... for purely-historical reasons now lost in time.
  • A "directory" is actually a file(!) containing file-names and their corresponding inode numbers.
So... having said all that ...
  1. A "hard link" occurs when there exist (somewhere ... anywhere ...) two-or-more actual directory entries which refer to the same inode number.
  2. A "soft link" is simply a file(!) ... albeit a specially-designated kind of file ... which contains: "a file name."
So far as the file-system is concerned, a hard link is indistinguishable from any other directory entry (although, in fact, the file-system does 'know better' ...). "It contains an inode-number, and that's that."

Whereas a soft link simply leads to "a file name," which then must be separately resolved. (And which may either succeed or fail. You won't know until you try.)

Nowhere in all of this will you find "two separate pathways to the underlying file-system, 'one encrypted and the other not.'" One way or the other, every path leads (or, fails to lead ...) to: "one particular inode."
 
2 members found this post helpful.
Old 11-23-2016, 03:05 AM   #7
Thewyzewun
Member
 
Registered: Sep 2003
Location: UK
Distribution: Xubuntu 15.10
Posts: 95

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ntubski View Post
They claim that the keys are encrypted by your password, so it should be safe if you choose a sufficiently large and random password.

https://www.boxcryptor.com/en/technical-overview
Still, I would rather not trust a third party provider to be competent enough 24/7 to keep their word regarding "safety" - it's a massive thing to try and offer a customer, as endless companies have discovered in recent years when they've been hacked. It's not a trivial matter for any online entity to "keep their word" on this - there are many who see any centralized repository of private information as having a target painted on its back, and all year round these individuals probe for weaknesses, and if they've got targets in mind, perhaps just keep an ear out for new security problems, ready to spring into action as soon as they hear of something they can maybe use to get a foothold somewhere.

Quote:
Originally Posted by ntubski View Post
Perhaps you can use an encrypted loopback device? Then you would put the image file of your encrypted file system into the dropbox folder.
I hadn't thought of that thank you very much, that sounds like it just might work!

EDIT: I don't think it quite will - I'm very much looking for a transparent, set it and forget it option.
All I want to do is backup some files, and keep the key locally.

I think a sensible solution might a scheduled task - I think it is that I am trying to set up something that "syncs on change" that is making this more difficult than it need be.

Last edited by Thewyzewun; 11-23-2016 at 04:41 AM.
 
Old 11-27-2016, 10:33 AM   #8
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,129
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
If I understand the question right, it's possible to do what you want with ecryptfs.

Code:
mount.ecryptfs folder1 folder2
If you use the option plaintext passthrough, anything created/copied in folder1 will appear normal in both folder1 and folder2. Anything created/copied into folder2 will be encrypted.

Is the dropbox folder a FUSE filesystem? I believe is it also possible to stack FUSE filesystems.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgraded via DVD - user folders (encrypted) not accessible mazzo Ubuntu 3 03-13-2014 11:35 AM
Copy the target from a symlink? menator Linux - Newbie 1 01-25-2007 07:04 AM
Tip: How to copy a symlink and its target file in a script fotoguy Programming 4 08-05-2006 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration