6,663 karma · joined Feb 25, 2016 (10y ago) · 1,775 submissions
Previously AWS Cryptography (2019 - 2023).
Unless otherwise stated, my opinions are my own and do not reflect my employer.
https://scottarc.blog/about/
comment 6y ago · link · parent
If the key involves a password that you, a human, have memorized in your squishy pink organ, it's privileged under the Fifth Amendment. (This hasn't been tested in court yet, of course. There's no precedent to fall back on.)
comment 6y ago · link · parent
https://i.imgur.com/DnRNrZe.png
Normal for Android : Normal in general :: Madness : Sanity
> This code is a frequent source of security vulnerabilities.
If the first sentence was the shot, that's the chaser.
245.
Show HN: Gossamer, an authority-free PKI for securing software updates(github.com ↗)
3 points · by CiPHPerCoder · 6y ago · discuss
comment 6y ago · link · parent
A Merkle tree is not a recursive signature algorithm, because a hash function is not a signature algorithm.
https://paragonie.com/blog/2015/08/you-wouldnt-base64-a-pass...
(Yes, you can build signature algorithms out of hash functions, but definitions matter.)
comment 6y ago · link · parent
No.
You can say that git reduces to a Merkle tree. And blockchains use Merkle trees.
But you can't say that git is a blockchain.
https://gist.github.com/joepie91/e49d2bdc9dfec4adc9da8a8434f...
https://paragonie.com/blog/2017/07/chronicle-will-make-you-q...
comment 6y ago · link · parent
https://en.m.wikipedia.org/wiki/Three-Fifths_Compromise
Not sure if an intentional dog whistle
comment 6y ago · link · parent
Because AES-CTR and ChaCha both refer to it as a nonce, and CBC calls it an initialization vector, the IV/nonce distinction does matter. But if you misuse the terms folks will know what you meant to say. Just don't mix it up when it comes time to implement.
comment 6y ago · link · parent
Libsodium offers Argon2 password hashing and key stretching, XChaCha20-Poly1305 AEAD constructions, BLAKE2b generic hashing, SipHash-2-4 for collision-resistant hash tables, etc.
Most people who say "use NaCl" really mean "use NaCl/libsodium".
Regarding my project: sodium-plus will wrap sodium-native (a thin Node wrapper to libsodium proper, which has been audited) if it is installed. To date, libsodium.js has not. Therefore, if you care about public code audits, you can use audited libsodium with sodium-plus just by installing sodium-native alongside it.
comment 6y ago · link · parent
Let's try this again.
You have two types of inputs that APIs refer to as "IVs".
Nonces: Must never repeat.
Initialization vectors: Must never repeat AND must be unpredictable.
Counters are acceptable for nonces. When an academic cryptographer says in a security proof that a counter doesn't suffice for the security of a scheme, what they're really saying is that you're in the latter category (must be unpredictable too) rather than the former (where predictable is okay as long as it never repeats).
If it can be predictable, it can be a counter. If it can't be a counter, it must be unpredictable.
The correct way to get an unpredictable IV is to use a CSPRNG.
SHA256(some predictable low-entropy inputs) fails to meet the bar for unpredictability.
> Are you talking about brute forcing the IV? The IV is not a secret to anyone--it's usually appended to the cipher text.
IVs aren't secret, but given the security proof I linked, IVs cannot be predictable. They must be unpredictable.
comment 6y ago · link · parent
I covered that:
> Furthermore, not authenticating your ciphertext means padding oracle attacks can be launched against the app.
The list above was just the requirements for the initialization vector, not the list of problems with the code.
comment 6y ago · link · parent
See the section about "CBC with Counters".
The consequence of the security proof by Rogaway, et al. for CBC mode is that IVs must be unique AND unpredictable for CBC mode to be secure*.
SHA256 is a deterministic pseudorandom function if you know all of the inputs. By studying the source code, we can see what gets fed into the SHA256 inputs. The cost to brute force all possible inputs is definitely much lower than 2^128, therefore it weakens the IND security of the AES-CBC scheme.
CBC security only provides indistinguishability. It isn't secure against adaptive chosen-ciphertext attacks.
comment 6y ago · link · parent
> I am wondering if that is necessary,
Yes, it is necessary. The IND security of Cipher Block Chaining (CBC) depends entirely on the IV being from a cryptographically secure random generator.
CBC mode requires unique and random IVs. CTR mode requires unique IVs (but can be predictable).
That's why we call the CTR input a nonce (number to be used once) and the CBC input an IV (initialization vector). Since they have different security requirements, we refer to them differently. Unfortunately, some cryptography libraries just name the parameter IV.
comment 6y ago · link · parent
JS: https://www.npmjs.com/package/sodium-plus (I wrote this one.)
Lisp: https://github.com/orthecreedence/cl-sodium
Java (Android): https://github.com/terl/lazysodium-android
Other bindings: https://libsodium.gitbook.io/doc/bindings_for_other_language...
comment 6y ago · link · parent
https://github.com/twinkle-labs/twinkle-notes/blob/45206f9d6...
For AES in CBC mode, IVs have two requirements:
1. They must never repeat.
2. They must be unpredictable.
Generating them from a SHA256 hash of some low-entropy data is not a good practice.
https://paragonie.com/blog/2016/05/how-generate-secure-rando...
Furthermore, not authenticating your ciphertext means padding oracle attacks can be launched against the app.
comment 6y ago · link · parent
This is less of a problem when each message also generates a random key, but still annoying to contend with.
XChaCha20-Poly1305 lets you generate 2^96 messages before having to worry about rekeying. https://libsodium.gitbook.io/doc/secret-key_cryptography/aea...
comment 6y ago · link · parent
What I've found over the years is that most people who sell software think of security as a value-add. At best, it's something to bill enterprise customers for. At worst, it's a cost center that will only be invested in if a big paying customer asks for it explicitly, and not a moment sooner. [1]
For background: I spent years pushing the PHP ecosystem forward in cryptography and security. I published a lot of open source libraries [2], cleaned up a lot of StackOverflow answers [3], and had a lot of discussions with small and medium businesses about security improvements that ultimately went nowhere because they couldn't find budget for security.
I don't believe it's fair to say that trust is "at the core" of software marketing if so many successful software companies can get by without investing in making their products trustworthy. After all, deception can obviate trust in this context.
(I do believe that software ought to be more trustworthy, and society should reward companies that act with integrity. But at the end of the day, that's not my call to make.)
[1]: https://sso.tax
[2]: https://github.com/paragonie
[3]: https://paragonie.com/blog/2018/01/our-ambitious-plan-make-i...