News for hackers. Stuff that matters.
Re: by forty on Sunday October 27, 2024 @02:07PM (#41964377)
This seem to use home made cryptography, which is never a good idea. In particular it's not clear why this design with layered algorithms is needed, nor why it uses a non standard KDF.

Prefer using libsodium for the crypto, which has made sensible choices for you.

Re: by forty on Sunday October 27, 2024 @02:10PM (#41964400)
Also you are missing a MAC, which is also a bad idea
Re: by deknos on Sunday October 27, 2024 @02:13PM (#41964421)
what does this provide which cannot be done with openssl, which is available for most systems?
Re: by cynicalsecurity on Sunday October 27, 2024 @03:40PM (#41965042)
OpenSSL should not be used for encryption of files. PGP/GnuPG should.
Re: by tptacek on Sunday October 27, 2024 @03:46PM (#41965095)
No, PGP isn't much better.
Re: by max_ on Sunday October 27, 2024 @03:42PM (#41965055)
Why not?
Re: by tptacek on Sunday October 27, 2024 @03:47PM (#41965098)
Last I checked, there's no authenticated encryption option in the OpenSSL CLI.
Re: by stackghost on Wednesday October 30, 2024 @10:52PM (#42002998)
GnuPG and PGP are a shit show. Just make an encrypted drive volume instead.
Re: by SahAssar on Sunday October 27, 2024 @02:29PM (#41964553)
How would you compare this to existing tools in the space like https://github.com/FiloSottile/age?

Seems like age has multiple implementations (rust, go), has a permissive license, a public specification (https://github.com/C2SP/C2SP/blob/main/age.md) and the spec/core implementation is developed by someone with a history with cryptography (I don't know if you do, but there is no indication or name attached to the repo).

While many things can be built as a hobby or learning project I feel like cryptography is one of those spaces where you should be clear if it is that and if it is not you need to expressively argue its bona fides up front.

Re: by ezcrypt on Monday October 28, 2024 @11:44AM (#41972316)
age is definitely more mature, and as you say, it should probably say somewhere that ezcrypt is still a hobby project (albeit a serious one).

Some motives (some of which may sound strange, but mattered to me):

  * Completely public domain.
  * Without any third party dependencies (not even openssl or similar).
  * Don't rely on a single cipher (low trust).
  * Extremely portable (should easily build for and run on anything from an M4 Mac to a Raspberry Pi to an old OpenWRT MIPS router with 32 MB RAM for instance).
  * Should be easy to use (e.g. no key management, unless you want to), and composable in standard Unix ways (pipes etc).
  * Security focused, obviously. E.g. software architecture-wise, minimize dependencies, properly manage files, processes and secrets, etc.
  * Personally: To learn and to build something that I trust.
In a way: When the dust settles after the nuclear apocalypse, if you manage to dig out a C compiler, this is your tool. ;-)
Re: by tptacek on Monday October 28, 2024 @01:43PM (#41973878)
"Don't rely on a single cipher" is an anti-goal, and a reason your hobby project won't be taken seriously. You'd be better off striking it from the list.

"Zero dependencies" is also not especially reassuring, as it implies you're using your own cipher implementations (or reference implementations).

Re: by shanusmagnus on Wednesday October 30, 2024 @11:26PM (#42003193)
> "Don't rely on a single cipher" is an anti-goal, and a reason your hobby project won't be taken seriously.

Why?

Re: by metadat on Thursday October 31, 2024 @12:01AM (#42003372)
If unanticipated issues are discovered, end users may not receive the updates in a timely fashion if, for example, the repo owner is the only committer and they're on vacation when the next Heartbleed 0day hits.

I am confident and trust the OpenSSL and LibreSSL projects each have multiple folks capable of merging and releasing critical updates.

Amazing as he is, Filippo is a single person who presumably has human needs. If he's a Terminator, though, swell, do let me know.

Re: by shanusmagnus on Thursday October 31, 2024 @10:38AM (#42007362)
Ah. I was thinking the critique was about combining different crypto methods in serial; I've heard people say this is a bad idea but have never understood why.
Re: by tptacek on Thursday October 31, 2024 @11:38AM (#42007962)
Mostly it's just that it doesn't accomplish anything.
Re: by some_furry on Thursday October 31, 2024 @12:03AM (#42003387)
> Without any third party dependencies (not even openssl or similar).

In your pursuit of "no dependencies", you made a classic blunder: making AES vulnerable to cache-timing attacks.

https://codeberg.org/ezcrypt/ezcrypt/src/commit/3268d71e80d3...

I'm not going to review the rest of your code. This is sufficient for me to recommend everyone run the other way screaming.

Re: by ezcrypt on Thursday October 31, 2024 @03:52AM (#42004371)
Thanks for having a look. The software implementation of AES is actually mostly a copy-paste of https://github.com/kokke/tiny-AES-c (see https://github.com/kokke/tiny-AES-c/blob/master/aes.c#L189 ). I have been meaning to replace and/or improve it. Even moderately modern x86 machines will always take the fast AES-NI path, though.
Re: by some_furry on Thursday October 31, 2024 @06:21AM (#42005293)
"mostly a copy-paste" is also known as a dependency

Look to BearSSL for inspiration for how to implement cryptography right

Re: by ezcrypt on Thursday October 31, 2024 @08:26AM (#42006183)
"also known as a dependency" - There are different kinds of dependencies. The ones I'm usually concerned with are the ones that cause you headaches when you try to get the software working on an exotic platform ten years from now. I've developed software for 30+ years, and along the way I have grown a strong disliking to external dependencies (be it Python packages, Boost C++ libraries, 3rd party C libraries or a hefty Mono or Java runtime).

Thanks for the reference to BearSSL - it appears to be very much in line with my own preferred design principles.

Re: by voodooEntity on Sunday October 27, 2024 @02:39PM (#41964624)
I recently gave building a file encryption tool a shot myself ( https://github.com/voodooEntity/go-tachicrypt ) tho i didnt implement my own crypto to be fair.

I think its always good to dive into topics if you are actually interested and lets face it, the beginning of most of the big things nowadays started somewhere in a basement or a garage.

Re: by tptacek on Sunday October 27, 2024 @02:56PM (#41964727)
The code isn't especially easy to follow, but is this a cascade of Serpent, Twofish, ChaCha20, and AES, all in CBC except for ChaCha, without an authenticator? With its own stream construction, that doesn't stop truncation?
Re: by ezcrypt on Monday October 28, 2024 @10:29AM (#41971385)
That's pretty much spot on. Authentication is planned (and that should handle truncation too if I'm not mistaking): https://codeberg.org/ezcrypt/ezcrypt/issues/3
Re: by tptacek on Monday October 28, 2024 @01:11PM (#41973528)
Public key signatures and ciphertext authentication are not the same thing.
Re: by ezcrypt on Monday October 28, 2024 @01:35PM (#41973810)
No, I realize that (I was thinking that ssh-keygen could be used as a poor-man's authentication for some use cases - basically share a secret between sender & receiver that can be used to ensure that the message has not been tampered with). One of the reasons that I haven't implemented authentication yet is that I want to better understand the differences and nuances of different methods and use cases before deciding on a method. Recommendations are welcome.
Re: by tptacek on Monday October 28, 2024 @01:41PM (#41973857)
Get rid of the weird cipher cascade and replace it either with XAES-GCM or ChaPoly. Do some research into how to handle large ciphertexts with a chunking construction. Use a well-defined construction; don't invent your own.
Re: by dist-epoch on Sunday October 27, 2024 @03:05PM (#41964791)
PSA: it should be obvious that it's a really dumb idea to use random new encryption tools from GitHub (sorry, author)
Re: by spease on Sunday October 27, 2024 @03:19PM (#41964896)
> it should be obvious

It should be, but a lot of developers don’t have formal security training, nor especially management which may end up selecting the contractors/developers and deciding on the technical approach.

If it’s explicitly not production ready, it should probably say so up front, not advertise itself as “strong encryption”. However painful that may be.

Re: by ezcrypt on Monday October 28, 2024 @10:22AM (#41971293)
All good points. I intend to make it clearer: https://codeberg.org/ezcrypt/ezcrypt/issues/4
Re: by sevg on Sunday October 27, 2024 @03:20PM (#41964904)
Don't use this.

It's missing a basic building block: authentication.

Unfortunately, the author hasn't spent long enough researching cryptography. (Even the briefest of research would have made this mistake obvious.)

Re: by ezcrypt on Monday October 28, 2024 @10:27AM (#41971347)
Very good point!

I have been planning to look into authentication. I didn't need it for my use cases, yet, but as you say that should be an integral part of any serious tool. I added a ticket: https://codeberg.org/ezcrypt/ezcrypt/issues/3

In the meantime, signing and verification can be done separately, e.g. with ssh-keygen, although that is a bit inconvenient (which kind of defeats one of the key points of the tool).

Re: by tptacek on Monday October 28, 2024 @01:45PM (#41973908)
You can't safely encrypt without authentication, so you do indeed need it.
Re: by ezcrypt on Wednesday November 13, 2024 @08:17AM (#42125806)
For the record: The latest release of ezcrypt (v1.3.0) has poly1305 authentication. Thanks for the feedback!
Re: by opheliate on Sunday October 27, 2024 @03:55PM (#41965153)
It’s genuinely quite offensive to me when people come out with these half-baked encryption tools and talk about them like they’re suitable for anything other than a fun project to learn about cryptography. Do you have any idea of the harm you can cause when people believe they can rely on a tool like this and it betrays them?

I would strongly advise the author to add a big notice to this repo indicating its unfitness for purpose, then to go away and do some learning about modern cryptographic best practices. I’m not of the belief that cryptography should be some ivory tower, only touched by some chosen elite, but “don’t roll your own crypto” is an adage for a reason.

As a first step, the author should probably go read about meet in the middle attacks, as the “effectively 2^1024 bit key” claim is laughable. Authenticated encryption is also an obvious omission.

Re: by everfree on Sunday October 27, 2024 @03:56PM (#41965159)
What’s the advantage over symmetric PGP encryption?
Re: by ezcrypt on Tuesday October 29, 2024 @07:41AM (#41982848)
Can you use PGP in the same way (I haven't tried)? Basically, symmetric file encryption based on a secret password and optionally a secret pepper file (effectively a secret key).
Re: by everfree on Tuesday October 29, 2024 @12:17PM (#41985865)
Symmetric file encryption yes, key file I’m not aware of.
Re: by andrewmcwatters on Sunday October 27, 2024 @08:46PM (#41966878)
> Encryption is done in four layers.

What?

Re: by tptacek on Sunday October 27, 2024 @10:08PM (#41967215)
It's a cipher cascade. (Don't build cipher cascades.)
Re: by ezcrypt on Monday October 28, 2024 @10:20AM (#41971273)
The idea isn't really to make the encryption stronger or to widen the key. It's a classical case of trust - if one cipher is compromised, there are others to cover for you. Also, I wanted to learn the different ciphers, and speed wasn't a top priority.
Re: by tptacek on Monday October 28, 2024 @01:09PM (#41973516)
Yeah, that's why everyone writes cipher cascades. There's a reason you don't see them in any mainstream vetted cryptography. The bigger problem is that none of this is authenticated.
Re: by underlogic on Monday October 28, 2024 @01:43PM (#41973884)
Why not exactly?
Re: by CarpaDorada on Monday October 28, 2024 @03:55AM (#41968658)
Don't use cryptographic software from people refusing to identify themselves.
Re: by ezcrypt on Monday October 28, 2024 @10:23AM (#41971302)
This should be the top rated comment ;-) Sorry. I can't remedy the situation for you, though.
Re: by gbraad on Tuesday October 29, 2024 @01:58PM (#41987475)
Have used axcrypt before; easy and portable
Re: by ezcrypt on Wednesday October 30, 2024 @02:54AM (#41992417)
If it's the AxCrypt I think it is, it doesn't even run on Linux, never mind Raspberry PI or Milk-V for instance. And it's not free either. So it doesn't meet many of my requirements, unfortunately.
Re: by svantex on Thursday October 31, 2024 @03:28AM (#42004257)
I'm the original author of AxCrypt. There's a new compatible iteration of it based on the original cryptography code called Xecrets, with several components. Xecrets Cli is the main fully featured command line engine, free open source GPL on https://github.com/xecrets/xecrets-cli . Xecrets Ez is a simple GUI frontend, single executable, portable. Runs on Linux, macOS and Windows. There are several more components available as nuget packages.
Re: by ezcrypt on Thursday October 31, 2024 @08:33AM (#42006237)
Very interesting! Thanks for the link, I didn't know about it and I'll have to check it out.

It still falls slightly outside of my zone of preference, though, as it's a .Net application, which limits which platforms it can be run on (I'm aiming for a tool that can readily be used on most of my devices, including on an old Raspberry Pi or a router).

Re: by svantex on Thursday October 31, 2024 @10:23AM (#42007218)
Fair enough, that's a little out of main scope for Xecrets Cli.

Just for fun, I tested now to build and publish for an ARM processor running Linux (linux-arm) and the build worked fine. I don't have a device to test it on though.

So... as long as it runs Linux and has an ARM or ARM64 processor and sufficient storage & memory it could work! (It's not tiny like a pure C-program unfortunately).

Would be cool to try...!

Re: by gbraad on Wednesday November 06, 2024 @11:13AM (#42064487)
Can actually try this for you. Will have a look over the weekend. Ping me otherwise on a GitHub issue with the same username
Re: by chasil on Wednesday October 30, 2024 @09:47PM (#42002607)
What's wrong with "openssl enc"?
Re: by sirjaz on Wednesday October 30, 2024 @09:58PM (#42002684)
I'm just glad you support Windows. We need more of this!
Re: by phinnino1 on Saturday November 02, 2024 @01:11PM (#42027662)
For basic file protection, this could be nice for folks who don’t want to mess with complex setups. But if you’re looking for physical security too, check out something like the iStorage datAshur PRO² at https://www.datawaysecurity.com/encrypted-flash-drivers/20-i... . It’s got built-in encryption right on the drive—no software needed, just plug and go. Sometimes the hardware route just adds that extra peace of mind!