-
Notifications
You must be signed in to change notification settings - Fork 26
Replaced the encryption with age #67
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
base: master
Are you sure you want to change the base?
Conversation
|
BTW this is about #35 What is currently missing is how to deal with old encrypted files. Further could this change also fix #63. tuckr encrypt g1 ~/first.txt
tuckr encrypt g1 ~/second.txtIt is possible to use different passwords for the same group ( This later is an issue when running tuckr decrypt g1Since there you can only give one password and this just fails as soon as the password was wrong. |
Yeah, having a header and a tool to port over would be great. We could also provide a single release warning when people attempt to use secrets asking them to port over and maybe provide a link to the tool.
Yeah, secrets is not as developed as the other parts. Symlinks have been consuming most of my time on the project. If you feel like trying to tackle it feel free to do so, otherwise just create an issue and me or someone else will handle it later. |
| sys-locale = "0.3.2" | ||
| tabled = {version = "0.10", features = ["color"]} | ||
| zeroize = "1.5" | ||
| age = "0.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You forgot to remove chacha20poly1305 and sha2 as dependencies
|
by the way, just as a heads up, don't worry too much about internationalization for now. |
|
By the way I haven't attempted to merge your PR because you have it marked as a draft. But there doesn't seem to be any work going on in this. Should I merge? |
|
Sorry, I got a bit distracted.😅 The main reason for it being a draft is that there are the questions on
If you want/can finish it, that is fine with me. |
|
I'm fine with it either way tbh. But if you want me to do it it's gonna be a while before it's all implemented, since I wanna improve the symlink handling first and I'm working on the filetree-refactor so I can try and fix the longest standing issues in the project. |
The old encryption protocol has some flaws. In this commit the encryption is replaced by the age library.
|
Ok, I have thought about the PR a bit. (sorry for taking so long, my priorities for this PR are a abit low.) So I would propose the following change to the current system. First an encryption group should get its own config file. Further can the name of the file be hidden by using So the question would be where to store the group files? |
Encryption is also a low priority for me right now, as the core functionality is deploying dotfiles and that still needs some ironing out here and there, so take your time
what happens if the user deletes this config file? Maybe using any one encrypted file in secrets would yield the same result and still enforce the same password per group and if a file is deleted as long as another is there the enforcement of same password per group can still be done.
Yeah this makes sense, but HMAC is only a hash so how would we know what the name of the file will be once decrypted? When you do
Not sure if I understood correctly. If you're asking what location in the dotfiles, they're still supposed to be in |
|
The the decrypted group file could look something simple like this. When you call This requires a decrypt of the old group file, adding the new line and encrypting the now new file contents and a replace of the old file. For the file The advantage of the group file would be that you can change how files are encrypted without changing how the group file is encrypted. |
|
About the path of the group file. |
|
About deleting a config file, that is a good point, I need to think about that. |
|
I'm guessing For the format itself, since the config will be inside a group directory I think we can get rid of For the config being deleted, if we could detect the encryption used by each file we could just attempt to read the config but if it's absent we could attempt to restore it and check that all the files still use the same algo? Not sure if that's a good strategy or not. |
|
I wonder if we could use hooks support to use the Does this make sense? Apologies if this has come up before in a separate thread. |
You can already use hooks to do whatever you like. I've thought about removing secrets altogether and just letting people use hooks to deploy their own secrets but never been compelled enough to remove the implementation we have already, so it's just sitting there until we ever rework it or I remove it. |
Indeed -- it's a difficult one to call. There's pros and cons to both. I can't (and wouldn't) suggest which one is better. This is your project, after all... |
|
I tend to just let things sit for a while before I make a decision. It has worked well for me. I'm not actively working on the secrets stuff because there's still work to do to make the core functionality (managing dotfiles) easier. So I just haven't touched this. But once I get around to it, I'll choose what to do. I don't even use secrets myself. So unless there's interest in this, this might end up getting the axe in the future. |
Sure. I can understand this. I can also appreciate how this looked bed. |
The old encryption protocol has some flaws.
In this commit the encryption is replaced by the age library.