Better HN
topnewbestaskshowjobs
Log inSign up

modalduality

302 karma · joined Feb 11, 2017 (9y ago) · 56 submissions

[ my public key: https://keybase.io/modalduality; my proof: https://keybase.io/modalduality/sigs/AFEeqRQcdFDAsfFHFTYPcsi07V63-9j3xR2g3vW13Eg ]
Submissions

comment 8y ago · link · parent

Most languages with monads have tools for working with them. In Haskell, for example, even without `liftM2` or `sequenceM`, you can simply do

    case (xm, ym) of
        (Just x, Just y) -> x + y
        _ -> 0

comment 8y ago · link · parent

About ten of us are playing in https://modalduality.org/sibylant-graze/play/lobby if you'd like to join!

A bit about the technical stack: the server was written in Haskell using WebSockets. Source at https://git.modalduality.org/sibylant-graze/tree/.

3.

Show HN: Sibylant graze, play the multiplayer word game Contact (Haskell/WS)(modalduality.org ↗)

1 points · by modalduality · 8y ago · 1 comment

comment 8y ago · link · parent

In general forward security involves generating a new key for each conversation with Diffie-Hellman or similar.

According to https://crypto.stackexchange.com/questions/5610/diffie-hellm..., Diffie-Hellman is not post-quantum secure, but https://en.wikipedia.org/wiki/Supersingular_isogeny_key_exch... is a DH alternative that is.

comment 8y ago · link · parent

The main idea is to explore the concept of skinny triangles being unaesthetic (and thus undesirable for triangulations). This is true for many tasks in computational geometry, but not so true in art. Bringing these two together shows jarring conflict where the Delaunay Triangulation and your brain's sense of aesthetics disagree.

It's not really supposed to be useful, just exploration in reduction of an already reduced art style: what is lost when we enforce that all shapes are triangles that tend to be more large-angle? For one, I think this destroys the perspective since one common trope is to make objects narrower as they are farther away.

Although the entire thing is mostly a joke based on their shared last names.

6.

Show HN: Delaunay Triangulating Robert Delaunay's Eiffel Tower Paintings(modalduality.org ↗)

39 points · by modalduality · 8y ago · 11 comments

7.

Recurse Center Application Process(recurse.com ↗)

1 points · by modalduality · 8y ago · discuss

comment 8y ago · link · parent

Ah, so Aaronson is talking about the Busy beaver shifts function of 2 there. I gave the answer to the busy beaver function counting the maximum number of 1s.

comment 8y ago · link · parent

> What makes it okay to identify the naming of a large number with producing that large number of things (e.g. 1's)?

Nice catch! I glossed over this but this is pretty important. The issue is that for any _specific number_, it takes a constant amount of time to write a number larger than that. Related: solving chess is technically O(1) since there are a constant number of positions we have to check.

What we need instead for this concept is a series of numbers, those can be compared with the question "Does one eventually get to a point where it will always be larger than the second?". We can parametrize the "biggest number" by the number of seconds given, say we can write down one character per second. Then a person's largest number function might be something like "f(n) = 9 ^ n", which is easy to see _is_ a computable function, and thus smaller than BB(n) for the same number of seconds, eventually.

In practice, just something like BB(100) - or BB(BB(100)), even can't really be written out by any computable method in a finite amount of time.

> which was: what characterizes the Busy Beaver function?

The proper one is just the number of 1s, but I talked about the shift function because it's easier to see why it's uncomputable. Tibor Rado proved that the Busy beaver function is also uncomputable in his 1962 paper, if you're interested you could check out his reduction.

comment 8y ago · link · parent

Thanks! I should probably include some more details on how to program the simulator.

Turing machines are just one simple way for formalizing programs, without all the complexities of modern programming languages. The core idea is that whatever a supercomputer (or any future computer) can compute, so can a Turing machine (it might just take more time): this is called the Church-Turing thesis.

The specifics on how to program Turing machines don't actually matter too much in modern complexity theory, but the rigorous basis is there when needed.

--

A Turing machine is always in some "state," (starts at A) and it's head is always over some cell of the tape, initially all zeros. Then the program, which is the grid in angelic hierarchy, specifies what the Turing machine should do. If it's in state A and the cell the head is at is 0, just go to the corresponding cell (marked in bright red), it will tell you the next state to go to, a number to write down on the tape, and a direction to step toward (Left or Right).

For intuition about why more states allow for more complex programs, try writing a 1-state program that writes two 1s and then halts (it's not possible). Then try it with 2 states.

comment 8y ago · link · parent

In case you think you've figured out the 2-state solution and you want to check that you can't do better, I've uploaded the number of 1s your machine should output at https://modalduality.org/static/busy-beaver-2.txt, but did not include the actual configuration.

12.

Show HN: Angelic-hierarchy, a game about Turing machines, philosophy, and math(modalduality.org ↗)

95 points · by _d4bj · 8y ago · 20 comments

13.

Show HN: Tzimtsum, an auto theorem prover for addition (Presburger arithmetic)(modalduality.org ↗)

2 points · by modalduality · 9y ago · discuss

comment 9y ago · link · parent

In addition to 4Clojure, I found the Brave Clojure book (https://www.braveclojure.com/) helpful for understanding how to structure programs in a "Clojure-y" way, e.g., to a greater extent than OOP representing data in lists and maps instead of structured classes, or using the "nil" value effectively when chaining functions together, almost like the Maybe monad.

comment 9y ago · link · parent

Is it easy to write timing-attack-resistant crypto code in Clojure? Sounds interesting, what company was this for? Thinking of implementing Damgard-Jurik myself sometime.

comment 9y ago · link · parent

yup! they should have used a commitment scheme instead - for example, SHA256(winning numbers || 512-bit nonce). To reveal, reveal the winning numbers and the nonce and Mr X can check that the hash matches. The nonce is to introduce more entropy so Mr X can't just bruteforce the hash, but since finding any collision is difficult, it doesn't let the alien cheat by trying different nonces (unlike with different keys with encryption schemes).

comment 9y ago · link · parent

Does anyone know why they might choose to encrypt-then-MAC vs. an AEAD scheme? Seems less error prone.

18.

Show HN: Thetapack: Type-homogenous, crypto-friendly, padded binary serialization(github.com ↗)

1 points · by modalduality · 9y ago · discuss

comment 9y ago · link · parent

Web developers may be also interested in https://gotham.rs/, which was released very recently and looks to be a promising competitor to Rocket.

comment 9y ago · link · parent

P = NP implies the polynomial hierarchy collapses, thus P = Sigma2, so by contradiction P != NP.

comment 9y ago · link · parent

Wow, how did you find that commit?

comment 9y ago · link · parent

Good article (didn't realize there were other kinds of lookaround), but maybe the bottom should link to well-tested standards-based regexes instead.

    URL: ^(((http|https|ftp):\/\/)?([[a-zA-Z0-9]\-\.])+(\.)([[a-zA-Z0-9]]){2,4}([[a-zA-Z0-9]\/+=%&_\.~?\-]*))*$
I recently encountered a case where a URL had an underscore at the end of a subdomain name. It seems underscores are okay anywhere else, but while my friend on Windows was able to load the website, I wasn't (on Linux) using Firefox, curl, remote screenshot service which presumably ran Linux etc. According to various RFCs, they should be okay anywhere within the subdomain name.

Has anyone encountered this behavior? Couldn't find anything on the internet; maybe it's just my computer?

comment 9y ago · link · parent

As the author mentions, this solution doesn't create identical distributions between the found case and the not-found case.

One other concern is that a db hit and miss could take very different amount of times (e.g., L1 hit vs miss that travels to disk).

* Don't waste server time hashing a password if you already know the user doesn't exist.

doesn't seem like too big of a concern, since you're spending the time anyway, it's just increasing server load marginally.

To solve the first problem, how about running two queries in parallel against the db, one for a fixed username and one for the given username? However, depending on the database, now you may run into caching issues with the fixed username, speeding up that query. Querying for a random username at the beginning might also push that row into the cache.

Maybe keep a large, randomized linkedlist of usernames on-disk (initialized on server startup), read out the next link, and use that as parallel username?

For these ideas I believe you would need to enforce a max-password-length and take up that many steps to check equality for all passwords.

comment 9y ago · link · parent

I think the OP is referring to simulating an oblivious Turing machine on the encrypted data, which itself is a Turing machine and some data.

I don't think this is known to be intractable, just really slow (for now).

comment 9y ago · link · parent

In general it's much easier to reason about Boolean circuits because they always have an answer, unlike arbitrary programs that may never halt, for example, so you see a lot of theoretic results focusing on Boolean circuits (sometimes with limitations on the depth) instead.

Early on it was thought that considering circuits instead of regular programs could result in "polynomial with advice" algorithms for NP-complete problems, but results such as the Karp-Lipton theorem have shown this to be unlikely.

26.

TFHE: Fast Fully-Homomorphic Encryption Over the Torus(tfhe.github.io ↗)

196 points · by _d4bj · 9y ago · 94 comments

comment 9y ago · link · parent

If there was no salt in the database, it looks Tumblr used a secret "pepper" (https://en.wikipedia.org/wiki/Pepper_(cryptography))? Why wouldn't they include a salt as well? Or did the database dump just not have the salt column?

comment 9y ago · link · parent

Does anyone know what the proof actually proves, and how the reduction was formulated?

comment 9y ago · link · parent

My bad, I meant profiling, not benchmarking.
12