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

encrypt then mac #19

Closed
rain-1 opened this issue Jul 12, 2018 · 12 comments
Closed

encrypt then mac #19

rain-1 opened this issue Jul 12, 2018 · 12 comments

Comments

@rain-1
Copy link

rain-1 commented Jul 12, 2018

Write HMAC(key, plaintext).

It is advised to encrypt then mac. this is doing mac then encrypt.

source: https://crypto.stackexchange.com/questions/202/should-we-mac-then-encrypt-or-encrypt-then-mac

@skeeto
Copy link
Owner

skeeto commented Jul 12, 2018 via email

@taoeffect
Copy link

"I don't want to change the file format at this point" means you are not serious about security, and people should avoid this tool.

@skeeto
Copy link
Owner

skeeto commented Jul 12, 2018 via email

@taoeffect
Copy link

taoeffect commented Jul 13, 2018

In this case the cost is supporting, forever, two different input file formats, but the increase to security would be effectively zero. That's not worth it.

I'm not understanding why you would need to support two different input formats.

AFAIKT you just released this utility. I doubt it would cause anyone any upset if you were to release a major update that wasn't backwards compatible, but greatly improved the security guarantees of the app with respect to potential attack vectors.

SSH still uses it. If someone showed that Enchive's use of M&E is broken then I would definitely fix it with an update to the format

I don't know the technical details of SSH, but MAC-then-Encrypt has resulted in serious problems in other tools and protocols. It intuitively makes sense why that would be. You're willingly allowing data to be tampered with and for that tampering to go unnoticed. That's a serious problem. Why risk that at all if you could choose to not take such an unnecessary risk?

The app itself doesn't seem to be much better than GPG in terms of security (or even usability), and yes, I did read your blog post, and also this comment on it.

@taoeffect
Copy link

BTW, I do want to emphasize that a big part of the reason why I sound so frustrated and upset is that I really want to use this tool, and I really love the thought and work that you've put into other areas of the project. While it would've been even better had you chosen to write it in Rust, it's still really great, for example, how this program has zero dependencies. And it's always great to see new encryption tools and utilities being implemented. I just wish they really pushed the envelope forward more is all. :-\

@rain-1 rain-1 closed this as completed Jul 13, 2018
@nico202
Copy link

nico202 commented Jul 13, 2018

AFAIKT you just released this utility. I doubt it would cause anyone any upset if you were to release a major update that wasn't backwards compatible, but greatly improved the security guarantees of the app with respect to potential attack vectors.

I have now lots of enchive files; a format change will be quite a pain indeed

@taoeffect
Copy link

taoeffect commented Jul 13, 2018

Well, it's a shame that @rain-1 chose to close this issue that he opened, so I re-opened it myself here: #22

I have now lots of enchive files; a format change will be quite a pain indeed

@nico202 Could you explain what would prevent you from continuing to use enchive 1.x with your enchive files should @skeeto choose to improve the security of enchive in a 2.x that supported Encrypt-then-MAC?

@nico202
Copy link

nico202 commented Jul 13, 2018

@taoeffect it's not that i wont use it. But if enchive 2.x does not support both files format, that would mean that I'd have to do something like

enchive -v # 1.x
find ./ -iname "*.enchive" -exec enchive extract {} \; > extracted
# upgrade to enchive 2.x
while read line; do
enchvie archive "$line"
done < extracted

or something like that. BUT some of those are on 1 computer, some on one other, some on extrernal unconnected drives. Some are on nextcloud, some might be on some third party storage system that I cannot remember. And the one that are available are on a raspberry pi, so that would take days. If the way to go is something like:

  • try the new format
  • if fail:
  • try the old one
  • fail

then I would just not upgrade the files format

@taoeffect
Copy link

taoeffect commented Jul 13, 2018

@nico202 You would not believe what I’ve had to do, how many shell scripts I’ve had to rewrite or convert into completely different languages, in order to benefit from new technologies and security improvements.

Never once in my life though, have I ever felt it acceptable to make other people less secure because I felt it would be too much of an inconvenience for to me to do so.

@nico202
Copy link

nico202 commented Jul 13, 2018

Well if somebody using enchive and just upgrades, s/he will (temporarily) might loose access to his/her files. I don't know how many people we are talking about, but if it's the three of us it might be fine. But enchive is already in various repositories, so IMHO the only feasible way is something like supporting both formats and issuing a warning for old format files (printing the command needed to convert it in place to the new format). But dropping the support is like: "ok this program is supposed to help you to store file securely for later use (but this later means one year)". Given that those encrypted files are supposed to contain sensitive information, loosing them is not the best thing to do. And yes, you can always go back in time with git, recompile, decrypt, compile, encrypt. But still it depends on the number of people actively using enchive. That said, if we want to move change the memory-hard function (as suggested in the other issue) those both might go together and a format change might be required. Still I find it to be important to tell the user the last "working" version they might try.

(Sidenote/theoretical question that does not apply: would you rather loose forever your files or keep them in a way that maybe somebody will be able to bruteforce them?)

@taoeffect
Copy link

taoeffect commented Jul 13, 2018

But enchive is already in various repositories, so IMHO the only feasible way is something like supporting both formats and issuing a warning for old format files (printing the command needed to convert it in place to the new format). But dropping the support is like: "ok this program is supposed to help you to store file securely for later use (but this later means one year)". Given that those encrypted files are supposed to contain sensitive information, loosing them is not the best thing to do. And yes, you can always go back in time with git, recompile, decrypt, compile, encrypt. But still it depends on the number of people actively using enchive. That said, if we want to move change the memory-hard function (as suggested in the other issue) those both might go together and a format change might be required. Still I find it to be important to tell the user the last "working" version they might try.

That sounds perfectly reasonable to me, and if it were me I would do exactly that.

(Sidenote/theoretical question that does not apply: would you rather loose forever your files or keep them in a way that maybe somebody will be able to bruteforce them?)

If your files are brute-forceable or if there is some bug that's discovered in the current format, well, then you didn't really lose them in the first place, did you? You and others will be able to decrypt them regardless of what future versions of the program do.

I will share an anecdote from my own personal experience in the decade that Espionage has been around. Espionage went through 3 major rewrites, which included fundamental changes to some of the file formats it used. We did provide an upgrade path to ensure users did not lose their data, so hopefully that answers your question.

@skeeto
Copy link
Owner

skeeto commented Jul 14, 2018 via email

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

4 participants