News for hackers. Stuff that matters.
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by rakoo on Sunday July 05, 2020 @04:34PM (#23741712)
> openssl enc blablabla

Don't use that line for encrypting stuff. There is no authentication and the IV is static. You're just asking for your secrets to be decrypted or modified without anyone noticing

Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by tialaramex on Sunday July 05, 2020 @07:59PM (#23743327)
The static IV is a brown M&M but not in itself fatal because this seems to use fresh random keys each time. If your keys end up re-used (NB don't fret about somehow choosing the same random key as somebody else that's astronomically unlikely, but do fret about your choices not actually being random after all) then you're screwed anyway.

There's no obvious route to decrypt these messages without the secret key, though it's up to you to not send that key anywhere (HTTP clients don't send fragment identifiers as part of the HTTP request, but of course a Javascript-enabled client can be instructed with Javascript to simply inspect the whole URL...)

The lack of authentication does mean you have no reason whatsoever to be sure this is the message intended. Regardless of IV anyone with control over the encrypted data gets to selectively alter the plaintext you'll decrypt even though they can't read it.

Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by rakoo on Monday July 06, 2020 @08:49AM (#23747307)
Indeed in that particular case since key is randomly generated it's ok to have a static IV. However I feel it's important to understand why it's ok in that case; in the general case, even though it's not technically required, it's always easier to have a random IV
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by philplckthun on Sunday July 05, 2020 @05:20PM (#23742103)
Genuinely ignorant here and curious, would using OpenSSL’s salt option help here? I’m not quite sure why the instructions in the repo specify a fixed IV to begin with
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by rakoo on Sunday July 05, 2020 @07:16PM (#23743007)
Just don't use openssl's command line for encrypting anything, there are better tools for that.

My guess is that the fixed IV is used because the IV is needed for decrypting, which means either you prepend the ciphertext with it (which means you need to buffer the whole ciphertext in memory, defeating the streaming functionality of the service) or you already know it because it's hardcoded.

In any case there is no authentication of the encrypted payload, so you have no idea if what you received really is encrypted by the person that claims to be the sender or if it was modified somewhere in the middle.

Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by gruez on Sunday July 05, 2020 @07:48PM (#23743234)
>which means you need to buffer the whole ciphertext in memory, defeating the streaming functionality of the service

Can't you generate an IV, write it out to the stream, then encrypt/write the ciphertext?

Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by rakoo on Monday July 06, 2020 @09:03AM (#23747413)
You could indeed, I didn't think of that. But it starts to beheavier and heavier, and the risk of making subtle mistakes increases. That's why it's better to use tools that do it properly, like age (https://github.com/FiloSottile/age)
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by LeoPanthera on Sunday July 05, 2020 @07:57PM (#23743306)
You can specify an IV with -iv. If you don't, the IV is derived from the password.
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by ta17711771 on Sunday July 05, 2020 @09:22PM (#23743781)
Just don't use OpenSSL for anything - how many times does the community have to be burned by the same project before they switch?
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by cjones26 on Sunday July 05, 2020 @10:24PM (#23744090)
What's a good alternative?
Re:PurritoBin: Ultra fast, minimalistic, encrypted command l... by ta17711771 on Monday July 06, 2020 @10:22AM (#23748186)
libressl is the only one I'm aware of.