Live data from Hacker News

Reddit 1.0 source code

github.com

21–30 of 117 posts

Re: Reddit 1.0 source code

#21
post #16

Earlier quoted context omitted.

To reinforce your point, see all pre-modern crypto techniques. It cannot be argued that they worked, and they were all certainly security through obscurity.

Aren't most examples things where it didn't work? The most famous case is the German "Engima" device from WWII (hardware- and 'software'-based, but cracked and readable for years before the Germans knew because they believed it was both obscure and effective) but it's wholly possible that most schemes were broken eventually. Keeping an obscure system secret is really hard, especially against a motivated attacker.

Enigma wasn't hard through obscurity. The Allies had the Enigma machine long before they were able to crack it. It was hard because with the equipment of the day, it was pretty much unbreakable in the same way that prime-number based cryptography is today. It was only A. Turing developing a completely novel kind of machine (https://en.wikipedia.org/wiki/Bombe) that enabled the decryption. In the same way that quantum computers could break the current cryptography easily. It's not obscurity, it's assuming that some (mathematical) task is hard.

Re: Reddit 1.0 source code

#22
post #16

Earlier quoted context omitted.

To reinforce your point, see all pre-modern crypto techniques. It cannot be argued that they worked, and they were all certainly security through obscurity.

Aren't most examples things where it didn't work? The most famous case is the German "Engima" device from WWII (hardware- and 'software'-based, but cracked and readable for years before the Germans knew because they believed it was both obscure and effective) but it's wholly possible that most schemes were broken eventually. Keeping an obscure system secret is really hard, especially against a motivated attacker.

I would consider the Enigma to be a very good counterexample to security by obscurity. Even after capturing a few of the apparatuses, it took a lot of mathematicians and engineers a lot of time and effort to build something that could decipher messages before the key became obsolete.

Re: Reddit 1.0 source code

#23
Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML.

    (defun login-panel ()
       (pbox "login/register"
         (:form :id "logform" :class "nomargin"
           (:table :style "border-collapse: collapse"
                   (:tr (:td :colspan "2"  "username:"))
                   (:tr (:td :colspan "2" (:input :id "loguser" :class "txt" :name "user" :type "text" :size 15)))
                   (:tr (:td :colspan "2" "password:"))
                   (:tr (:td :colspan "2" (:input :id "logpass" :class "txt" :name "pass" :type "password" :size 15)))
                   (:tr (:td :colspan "2" (:input :id "logmem" :type "checkbox" :name "mem" "remember me")))
                   (:tr (:td :colspan "2" (:span :id "logerror" :class "error" "")))
                   (:tr (:td (:input :id "logbtn" :class "btn" :type "submit" :value "Login" :onclick "login(); return false"))
                        (:td (:input :class "btn" :type "submit" :value "Register" :onclick "register(); return false")))
                   (:tr (:td :nowrap t :colspan "2" :align "center" :class "little" (:a :href "/password" "what's my password?")))))))

Re: Reddit 1.0 source code

#24

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

It's not uncommon. An example in Racket is html-template.[0] Hiccup is one in Clojure.[1] There's a spectrum of methods for doing things like this: both Clojure and Racket have Mustache[2] implementations.

"Confusing and hard to grok"† is in the eye of the beholder. Syntax highlighting and indentation go a long way (as well as exposure), though even in black and white, the parens fade for me much more than angle brackets do. Personally, I'd wrap some of the longer lines, but that's a style thing.

[0]: https://docs.racket-lang.org/html-template/index.html.

[1]: https://github.com/weavejester/hiccup

[2]: https://mustache.github.io/mustache.5.html

† Sorry. Couldn't let the typo stand. Heinlein made me do it.

Re: Reddit 1.0 source code

#25

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

How is it verbose? It has much LESS noise than HTML. IMHO, Lisp is the simplest and smallest readable representation of data structure. I will trade JSON for edn [1] any days of the week

[1] https://github.com/edn-format/edn

Re: Reddit 1.0 source code

#26
post #21
post #16

Earlier quoted context omitted.

Aren't most examples things where it didn't work? The most famous case is the German "Engima" device from WWII (hardware- and 'software'-based, but cracked and readable for years before the Germans knew because they believed it was both obscure and effective) but it's wholly possible that most schemes were broken eventually. Keeping an obscure system secret is really hard, especially against a motivated attacker.

Enigma wasn't hard through obscurity. The Allies had the Enigma machine long before they were able to crack it. It was hard because with the equipment of the day, it was pretty much unbreakable in the same way that prime-number based cryptography is today. It was only A. Turing developing a completely novel kind of machine ( https://en.wikipedia.org/wiki/Bombe ) that enabled the decryption. In the same way that quant…

Don't forget about the Polish. They too broke the encryption before, but then they were invaded, and no precision machinery was available to increase the number of rotors to 10. https://en.m.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma Turing did it too, independently.

Re: Reddit 1.0 source code

#27

Never played around with Lisp, so excuse the ignorance. Is this typical to construct HTML in Lisp? This feels incredibly verbose and error prone, not to mention confusing and hard to grok. Good luck having a designer mockup/write HTML. (defun login-panel () (pbox "login/register" (:form :id "logform" :class "nomargin" (:table :style "border-collapse: collapse" (:tr (:td :colspan "2" "username:")) (:tr (:td :colspan "…

How is it verbose? It has much LESS noise than HTML. IMHO, Lisp is the simplest and smallest readable representation of data structure. I will trade JSON for edn [1] any days of the week [1] https://github.com/edn-format/edn

I share your zeal, but the answer to apparent incredulity isn't to raise the level. People have different tastes when it comes to programming languages and methods, and that's okay. There's often things we can learn from different techniques.

To our parent's points, it's more verbose if you're used to passing data into a separate template file. That can help abstract the markup from the data processing. To their point regarding designers, many are more comfortable working with HTML files than application code. That can be a benefit for many teams. Clearly some lispers agree, as they've implemented alternatives like Mustache templates.

Re: Reddit 1.0 source code

#28
What kind of Lisp system was used to run this? Would it work with any Common Lisp? What other things are required, like libraries or a database etc.?

I'm guessing reddit.asd lists some:

:tbnl (a toolkit for building dynamic websites)

:cl-ppcre (a regex library)

:trivial-http (a HTTP client)

:cl-who (a library for using S-expressions as HTML markup templates)

:clsql (a SQL database interface and ORM)

:clsql-postgresql (a PostgreSQL connector)

:cl-smtp (a SMTP client for sending email)

:ironclad (a cryptography library)

Re: Reddit 1.0 source code

#30

Earlier quoted context omitted.

To reinforce your point, see all pre-modern crypto techniques. It cannot be argued that they worked, and they were all certainly security through obscurity.

This is not really a useful response. The trivial counterexample is that all modern crypto techniques rely on keeping a key, or part of a key, secret. That's security through obscurity, and you've just stated bluntly that obscurity never works under any circumstances, right? What you want to do instead is talk about tradeoffs. Talk about how much information you need to keep secret in exchange for a given window of e…

We don't allow you to change the definition of "security through obscurity" just like that!

Using a public algorithm with secret key is BY DEFINITION _not_ security through obscurity. On the contrary.

Post reply on HN