Better HN
topnewbestaskshowjobs
Log inSign up

nmadden

511 karma · joined Jun 20, 2015 (11y ago) · 248 submissions

Author API Security in Action - https://www.manning.com/books/api-security-in-action

https://neilmadden.blog/about

[ my public key: https://keybase.io/neilmadden; my proof: https://keybase.io/neilmadden/sigs/QfrQtB7H1Ni4rhaFpENFBtqqCd-VYDYXqYHKRfojHnk ]

Submissions

comment 7y ago · link · parent

It’s also worth pointing out that non-repudiation requires stronger properties than cryptography alone can guarantee. If I surreptitiously leak my private key onto the internet I can later plausible deny that I signed messages. (The Signal protocol deliberately leaks old MAC keys for this reason).

If you really want non-repudiation then you have to have hardware, legal, and procedural controls in place.

comment 7y ago · link · parent

It is, although COSE is significantly different to JOSE in many ways.

comment 7y ago · link · parent

That’s not correct. Latin-1 and UTF-8 are both compatible with 7-bit ASCII but they are not the same encoding. For instance é (e acute) is a single byte in latin-1 (0xe9) but is two bytes in UTF-8 (0xc3 0xa9)

comment 7y ago · link · parent

No, I'm not defending PGP. Even without the automation, every PGP-encrypted email almost certainly results in a bunch of internal plaintext emails between employees that could easily accidentally cc the wrong person, etc. I'm just pointing out that the chances of replacing PGP with something genuinely secure for these kinds of use-cases are close to zero.

comment 7y ago · link · parent

I used to get about 1 or 2 PGP-encrypted emails with security bug reports per year when I managed this for my employer. There's a dedicated team that receives security reports now, with email feeding into an automated ticketing system with automatic acknowledgements, reminders, spam filters, PagerDuty alerts, etc. There's a huge amount of tooling and workflow built around email, with a lot of integrations into all kinds of enterprise software. Often the only sane way to trigger all this stuff is to send an email.

So I think the result of removing PGP will be even more plain 'ol email than anything else.

comment 7y ago · link · parent

With any algorithm complexity analysis you have to define what the inputs are considered to be. For cryptography, algorithms are designed to be constant-time with respect to the non-secret inputs. The secret inputs (which you are trying to protect) usually do not vary from one call to the next (eg, long-term private keys etc) - so can be assumed to be constant.

So while the terminology seems confusing, it’s not actually different. It’s just a different choice of “input” compared to typical algorithm analysis.

comment 7y ago · link · parent

CLP shares some similarity with Satisfiability Modulo Theories (SMT). Is there much overlap in how they are used in practice? When would you reach for SMT over CLP?

comment 7y ago · link · parent

I’m sure that’s a common problem.

comment 7y ago · link · parent

Unlike unchecked exceptions.

comment 7y ago · link · parent

He is also the author of https://www.bearssl.org/

comment 7y ago · link · parent

While Prolog’s operational semantics are given in terms of least Herband models (at least, before you consider negation), you can also view a Prolog program as a subset of FOL and give a traditional model-theoretic account of the semantics. This may be less useful practically, for the reasons you give, but sometimes it’s nice to consider that a symbol “fred” might actually refer to a person called Fred rather than just be symbols all the way down...

(It always surprises me when Prolog texts refer to the least Herband model as the “intended model” - it’s definitely not what I intend when I write Prolog!)

So while we can say that an “ancestor” relation in Prolog correctly defines transitive closure within the least Herbrand semantics, at some point we actually have to relate that “semantics” to the real world if we want to know what our programs mean.

Edit: putting this all another way, my understanding of (pure, positive) Prolog’s operational semantics is that the least Herbrand model contains exactly those sentences that are true in all models of the program, whether those models are Herbrand or otherwise. So it’s not quite true to say that Prolog only considers the least Herbrand model, but that it may as well only do so because the (operational) result will be the same. It’s been a while since I’ve looked at this any great depth though.

comment 7y ago · link · parent

Great post! Still working through it, but there is a slight error in the nested diagram at the start. Relational algebra has set difference, which is akin to negation-as-failure, but it lacks recursion. So the positive Datalog and RA circles should overlap without either containing the other. See http://www.lifl.fr/%7Ekuttler/elfe/biblio/datalog-overview-g...

comment 7y ago · link · parent

It's 12 bytes for both.

comment 7y ago · link · parent

Thanks, I’ve not seen that before. It looks like a great read.

comment 7y ago · link · parent

I don’t know much to point you at sorry, apart from general works on denotational semantics.

comment 7y ago · link · parent

The first author of this is John Alan Robinson, inventor of the first unification algorithm and thus the first practical resolution theorem proving algorithm, on which Prolog was developed.

I remember reading a history of Prolog, I think by Kowalski, which mentioned that Robinson always preferred Lisp to Prolog, despite it being built on his ideas. I’ll try and dig out a reference.

Edit: I found the article I was thinking of [1], on Maarten van Emden’s blog. Here is the quote:

> A few years later some excited evangelists brought Robinson the news that resolution had led to a new programming language. Robinson was delighted to see some sample programs and an explanation of how resolution was used to execute them. The evangelists took it for granted that henceforth Robinson would program in Prolog. They were disappointed to learn that no, for Robinson Lisp was the one and only programming language and that it could not even be displaced by an elegant embodiment of his own brain child.

[1]: https://vanemden.wordpress.com/2017/09/08/conceptual-integri...

comment 7y ago · link · parent

I think this is what Pulumi (https://www.pulumi.com) is trying to achieve.

comment 7y ago · link · parent

Catching all exceptions is what we used to do in Java - using checked exceptions. It turns out that in many cases the caller cannot do anything sensible with most exceptions, except to let them bubble up to a higher layer. Eventually you reach a point where something can be done - rolling back and retrying a whole transaction, for example.

Forcing every intermediate layer in the call stack to catch and rethrow that exception (check and propagate an error code) sounds like a good thing for explicit error handling, but actually in practice introduces a lot of boilerplate code that just provides more opportunities for mistakes (like errors being silently swallowed, or logged multiple times creating confusing log files).

How many times in a code review do you see `if err != nil { return err }` and ask yourself if what it is doing is actually appropriate? Most people just mentally mask out that kind of boilerplate over time.

comment 7y ago · link · parent

This reply from Tom Lane reminded me of the PC losering issue from the “worse is better” essay [1].

> 2. What is the rationale for supposing that a retry a nanosecond later will help? If it will help, why didn't the kernel just do that?

[1] https://www.jwz.org/doc/worse-is-better.html

comment 7y ago · link · parent

Firstly, this is just authenticating the same factor over a different channel. (Actually the exact same credential). So not 2FA.

Secondly, if I can successfully get you to approve my login request then I not only get logged in but also receive a copy of your private key? That is a really bad failure mode.

comment 7y ago · link · parent

Really? It’s called GraphQL and its schema can’t describe a simple tree?

comment 8y ago · link · parent

We have been looking at something very similar (using scrypt and Ed25519) at work for LDAP (SASL) authentication. The primary motivation for us is to move costly password hashing off the LDAP servers.

Our current design is basically the same, but we generate and store a random salt server-side and present that to the client along with the challenge. Using a deterministic salt based on the username and domain is a nice idea - we actually do something similar if the client presents an incorrect username to avoid leaking whether the account exists (we send salt = HMAC(secret, username) in that case).

comment 8y ago · link · parent

Right. Most applications and protocols only need authentication. Non-repudiation is kind of an extreme security property, rarely needed outside of legal/financial transactions.

comment 8y ago · link · parent

Non-repudiation means that the party that sent a message cannot later deny having sent it. In TLS both sides negotiate a shared secret key(s) that they then use for fast symmetric crypto for the actual messages. Symmetric because both sides know the same keys.

This means that after the fact either side can claim that the other side fabricated messages that apparently came from them, because they could have done.

The point about losing keys is that if I can plausibly claim that I “lost” control of my key then I can claim that an imposter signed a message that apparently came from me. So even with digital signatures you usually need additional controls (hardware, processes, legal/regulatory etc) to really guarantee non-repudiation.

comment 8y ago · link · parent

There is a (now expired) draft for sending signed HTTP requests using JWS that includes the access token as part of the signature data getting around this problem.

Edit: forgot the link https://tools.ietf.org/html/draft-ietf-oauth-signed-http-req...

comment 8y ago · link · parent

TLS certs (client or server) are only used during the handshake. After that it’s symmetric crypto, so no non-repudiation if that’s what they want. (Real non-repudiation requires a lot more than just signatures though, otherwise you could just claim that you lost control of your key).

comment 9y ago · link · parent

I haven't followed the process, but if they just wanted to break up rt.jar, why didn't they do just that and break it into smaller jars that you may/may not include on the classpath?

238.

Stateless Session Logout with Rolling Bloom Filters(neilmadden.wordpress.com ↗)

2 points · by nmadden · 10y ago · discuss

239.

Solving the GCHQ Christmas Puzzle (part 1) with Constraint Programming(neilmadden.wordpress.com ↗)

2 points · by nmadden · 10y ago · discuss

comment 11y ago · link · parent

Now we are definitely going in circles.
1
56789