Telegram protocol defeated. Authors are going to modify crypto-algorithm - <AUTHOR> http://translate.google.com/translate?hl=en&sl=ru&u=http://habrahabr.ru/post/206900/ <comment><USER3> There's a lesson here. I genuinely don't mean to sound smug, but -- remember how confident the Telegram guys were? Remember how sure they were that their protocol would be able to resist the eavesdropping efforts of the NSA and whatever other nefarious interlopers may come along? Remember how they said they'd been working on it for years, and presumably expected for it to last many more years?

Remember how that was, like, five days ago?

<comment><USER4> Never forget.

RIP Telegram (2013-2013).

This whole thing has been interesting to follow because it seems this same thing happens every time someone make macho Crypto-claims. From seeing how confident the Telegram team was to reading all the detractors who were so ready to criticize. It's an interesting dynamic in the Crypto community.

<comment><USER5> Hate tone discussion makes me sad.

Telegram is very young project and it has bugs for sure. Some guy found potential issue in protocol and developers committed to fix it soon. There is no information that any messages were revealed due to this bug but Telegram should go away and developers should do something else.

Whatsapp is less secure then Telegram but I have not seed "Whatsapp RIP" messages. Not so hard to save videos in snapchat but no one propose to close the application. About a year ago YAML vulnerability was found but no one proposed dhh to stop development and focus on race driver career.

I think that we need more competition for TextSecure.

Terms of bug bounty are very hard to satisfy even with bad protocol but Durov seems decided to play safe with such amount of money. Guy that found problem in MTproto doesn't win money according to conditions of the bug bounty because message is not decrypted.

Disclaimer: I don't have any affiliation with telegram besides living in the same city as telegram developers.

<comment><USER6> You must not have followed Telegram much. From the beginning they've done nothing but pretend their protocol is absolutely secure ("military-grade encryption", "world's most secure protocol", etc) and rejected any attempt from the crypto community to help them fix problems before they endanger people.

So, let's put it this way: Was it ok of them to lie through their teeth to users? If so, then that's a sad state of marketing. If not, then what are you proposing here?

<comment><USER5> I'm not security expert, but I believe that:

\- military-grade encryption – true

\- world's most secure protocol – I'd consider this statement as false, I don't know what they mean by most secure and what protocols were considered. May be messengers available at app store, better to ask them

Why do you think that they "rejected any attempt from the crypto community to help them", especially after bug bounty proposition?

Why do you think that they lie more then TextSecure advocates? Each of these messengers is safe to passive listening. But unsecure to similar degree if user downloads them from app store and runs on hardware and software that could be easily patched. Current implementation of telegram api is prone to MiM attack but I would not consider TextSecure completely safe app and that every other app should be thrown out.

<comment><USER6> _Why do you think that they "rejected any attempt from the crypto community to help them", especially after bug bounty proposition?_

I've written about this pretty extensively: [https://www.hnsearch.com/search#request/all&q=by%3Asillysaur...](https://www.hnsearch.com/search#request/all&q=by%3Asillysaurus2+textsecure)

It's an interesting contrast in cultures that you phrase it like "Why do you think Telegram lies more than TextSecure advocates?" .... As far as I'm aware, TextSecure advocates haven't lied at all. TextSecure's interest is in security, whereas Telegram's interest seems to be in money and power.

 _Current implementation of telegram api is prone to MiM attack but I would not consider TextSecure completely safe app_

I just don't know what to say to this. Telegram has been proven insecure, TextSecure hasn't. Telegram isn't designed by cryptographers, TextSecure is. There is absolutely every reason to assume Telegram is broken.

 _Each of these messengers is safe to passive listening._

This is mistaken because Telegram has been proven vulnerable to MITM attacks. Even after they patch this latest security problem, it would be very unwise to trust them.

<comment><USER5> I've not found any attempts to help them apart from this bug report.

>TextSecure's interest is in security, whereas Telegram's interest seems to be in money and power

I can't read minds or even their messenger logs so I can't comment what is their interest but I'd be interested to know why you think so

> TextSecure completely safe app

Just wrong. How could you call something "completely safe" or bug free?

>Each of these messengers is safe to passive listening >This is mistaken because Telegram has been proven vulnerable to MITM attacks

How Telegram is prone to passive listening?

<comment><USER6> Telegram seems to be interested in money and power because they've turned down offers from Moxie (the creator of TextSecure and a well-known cryptographer) to join forces. There's no reason to do that unless they were interested in money or power more than security.

I didn't say TextSecure is completely safe. I said Telegram has been demonstrated to be broken.

Telegram is prone to passive listening because their design doesn't prevent it. There's nothing stopping someone from MITM'ing every Telegram secret chat when it's first initiated. It's in the design.

Their contest means nothing, because due to the way the contest is designed, it's impossible to MITM or other side channel attacks like timing attacks. These are the real attack vectors, yet the format of the contest prevents anyone from employing them.

<comment><USER5> > I didn't say TextSecure is completely safe.

Yes you do. "TextSecure completely safe app" was copied from your message before you or someone else edited it. I've not typed it but copied exact phrase from your message.

<comment><USER6> You copied it from your own message, not mine. [http://i.imgur.com/pxMVDwA.png](http://i.imgur.com/pxMVDwA.png)

<comment><USER7> The best part was when he copied it from your quoting of his message, but removed the "not" that came before it

</comment></comment></comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><AUTHOR> In short: telegram in secure chats ([http://core.telegram.org/api/end-to- end](http://core.telegram.org/api/end-to-end)) was using modified version of Diffie-Hellman algorithm: key = (pow(g_b, a) mod dh_prime) xor nonce (original: key = pow(g_b, a) mod dh_prime) That custom 'nonce' is derived from server and in theory server can send a specially formed nonce which will lead to known client keys ("bookmark"). It means that server as MITM can read all needed chats by request.. Authors of Telegram agreed that it is a big hole and their algorithm needs modification. User, who found the issue will get a prize (not 200,000$, but good enough).

<comment><USER8> Why not the 200K? Was it outside the parameters of the contest or something?

<comment><USER9> Yes. The contest is not about actually exposing flaws in their cryptosystem, which is why the rules are rigged up in a way that would allow even a terribly insecure protocol (like Telegram's, or Moxie's counter-challenge protocol) to pass as "secure".

<comment><USER10> Telegram's contest itself is meaningless regarding the security of its protocol (as others explained in details). Finding bugs such as this deserves 200k more than anything else

<comment><USER11> Offering the contest was shady and stupid enough. Not paying just proves they're chiselers that never intended to pay in the first place. This wins the runner-up award for second most botched PR disaster ever. The consolation prize is a lump of coal.

<comment><USER12> They're paying $100 000.

[https://vk.com/wall-52630202_7858](https://vk.com/wall-52630202_7858)

<comment><USER11> It's too late to matter. But good for him that they're only half crooked.

</comment></comment></comment></comment></comment></comment></comment><comment><USER13> This is my first comment on the Telegram bruhaha.

Sometimes, I get embarrassed by what I experience here on HN. The gang up, the unnecessary pride.

To those saying RIP, Telegram will succeed. Without using it (I use a Blackberry), it looks to be top two of the chat apps when you combine usability/security. I will download it once I get an Android phone in January.

I will not wish failure on anyone that is confident in his product. Of course they could have shown more humility but it he face of "take downs" on all sides especially the ones sponsored or initiated by the Whispersystem/Texsecure chaps, I do not see why they should have bowed down to be crushed.

Considering the type of responses given by Pavel Durov, I am almost certain he would have been much more humble if his attackers toned it down a notch.

To the person that found a flaw, kudos to you on doing something and not spending all your time doing take downs of telegram on HN threads and blogs.

Pavel, I am hopeful that you will reward the chap even though the discovery was not within the "guidelines". it is all about the spirit of the competition.

As for the TextSecure/WhisperSystems guys, stop being like the politicians we hate who campaign by slinging mud on opponents instead of selling their stuff. Focus on selling the TextSecure app and not looking to takeout anyone who has a different approach.

PS: I have no relationship with either party. I am a neutral observer that has his own opinions.

<comment><USER14> > To those saying RIP, Telegram will succeed. Without using it (I use a > Blackberry), it looks to be top two of the chat apps when you combine > usability/security. I will download it once I get an Android phone in > January.

But it is not secure! That's the entire point.

Never mind "not secure against a well funded government agency", it's not secure against other attackers.

There are lots of usable chat apps that do not give you the illusion of security.

> and not looking to takeout anyone who has a different approach.

You seem to be mistaken about _why_ they do this. It's nothing to do with pushing their app or their approach. They'd welcome good well-formed apps to compete with them. But when they see an app that claims to be secure they have an ethical duty to let people know if it is obviously not secure.

Most people are not bashing just for the sake of bashing. Some people need good cryptography software to avoid imprisonment, or torture, or state- killing. This isn't about stopping someone's teen-angsty poetry from being discovered by a sibling, it's about protecting political dissidents from an oppressive regime. In that context pointing out that a software is broken is not mindless bashing, it is a crucial part of the cryptography process.

(I'll accept that a few people are missing the mark with their criticisms.)

Pointing out flawed crypto software is part of a long tradition going back many years. It's part of the culture. Most cryptographer will start by analysing other software and finding flaws before implementing their own software.

<comment><USER13> _Most people are not bashing just for the sake of bashing. Some people need good cryptography software to avoid imprisonment, or torture, or state- killing. This isn 't about stopping someone's teen-angsty poetry from being discovered by a sibling, it's about protecting political dissidents from an oppressive regime. In that context pointing out that a software is broken is not mindless bashing, it is a crucial part of the cryptography process._

I like your commentary it is level headed and explains the position of the non biased "other side".

I think the conflicted position of the lead bashers did not help their position. It would have been much more useful for a neutral party to do a comparative analysis and stated the pros and cons of each side.

As for me and most _normal users_ , the security we need is not from NSA type of snooping but from mid level risks. There may be some sacrifices that may have to be made. Just like the position Ubuntu plays where Linux distros are concerned

For people like Snowden, Greenwald and others with NSA level adversaries, I do not expect them to rely on any third party application at all.

Now your argument may be that they have created stuff for sexting teens and claimed to be good enough for Snowden. In that case, I would argue that it could have been pointed out that in a different and perhaps more polite way.

I would worry about anyone who has created any crypto tool who is not over confident in his product. I will also expect the person to be receptive to constructive feedback NOT "leave your product and join us" or "This is shit because no noted crypto person is on your team"

I remember when cperciva that built Tarsnap, an online "backup for paranoid users" launched, he was rather confident in his product and I did not see any intense bashing of him. As expected,there have been bugs in his system and he has fixed them as they have arisen.

We should help things grow right here on HN not hope for things to fail if they do not support the view of the crowd.

<comment><USER15> > As for me and most normal users, the security we need is not from NSA type > of snooping but from mid level risks.

Most users, disregarding the government for the moment, don't need encryption full stop. They don't send anything commercially sensitive that an attacker's going to be interested enough in to try to intercept their messages.

The use of encryption _presupposes_ a motivated threat, and it's not clear to me that the NSA is significantly more powerful than other adversaries in that area. They've more computing power, more political power, they can buy zero day exploits. They probably even have some very smart people, who can find flaws faster than the attackers in civ-space. But speed isn't required, only persistence; motivation, interest. Which is, after all, what we're supposing in the first place if someone's going to go to the trouble of intercepting your messages.

It's not clear to me that unless your goal is _' make something that the NSA can't break into'_, you're going to make something that a well motivated attacker can't break into either. And this stuff only has to be broken _once_ , then they'll just sell or share the attack. The conflict is asymmetrical.

Your argument seems to be posited on the idea that there will be no attacker; no-one anywhere, ever; sufficiently motivated to breach the protocol. And I find that highly questionable, given that a flaw has already been found - <USER2> with far lower levels of incentive than will be present if the system is widely deployed and used to protect valuable information.

<comment><USER16> > Most users, disregarding the government for the moment, don't need > encryption full stop.

You've no idea what you're talking about. Please stop spreading such bullshit around; other people might fall for it!

Fireship is an app that allows you to hijack the account of _any_ user on the same Wi-Fi network as you are, if the network is not encrypted, and the user used a non-encrypted connection to the website. Facebook, Google, Twitter and Flicker were all susceptible to such attacks before the advent of this tool; afterwards, they fixed it by using https by default.

Do you want random strangers to have full access to your Facebook account? No? Then you should realize that most people _do_ need encryption _full stop_.

Also, only very powerful attackers can hack https encryption (they need either access to your laptop (hardware access, or a zero-day exploit), or access to the website (e.g. court warrant, or coercing a certificate authority)).

<comment><USER15> We were having a discussion about Telegram and similar uses of encryption, a discussion where I specifically responded to a remark on the strength required of Telegram-style encryption. I would hope that _most_ people are capable of interpreting the context of a remark - especially embedded in paragraphs that expand on it. Rather than, _' fall[ing] for it!'_

-sigh-

Beyond that I'm not going to engage with you any further, on this or any other point. You strike me as a bully, restrained where you are simply by the absence of an excuse rather than the presence of decency. As such, I've no interest in associating with you.

<comment><USER16> Yeah, I probably overreacted.

</comment></comment></comment></comment></comment></comment></comment><comment><USER17> Excruciating evidence that supports Moxie's position.

Vuln rewards should exist for two purposes:

1)An act of good faith on the part of the developer that says "I am interested in securing my product and I won't prosecute direct disclosure"

2) The Dev knows exploitable vuln discovery has value, but cannot compete with black market pricing. Instead, the reward is a token of appreciation for a shared code of ethics.

I wish bug bounties could compete with the budgets of nation states. They can't.

Companies shouldn't pretend to compete. Shame on telegram for stupidly false promises.

<comment><USER12> I have no idea what you are trying to say here.

The guy is rewarded half the bounty: [https://vk.com/wall-52630202_7858](https://vk.com/wall-52630202_7858)

<comment><USER17> Vuln reward programs that payout at this level are broken.

1) They don't achieve their objective of securing a product. Moxie eloquently captured why here: [http://thoughtcrime.org/blog/telegram-crypto- challenge/](http://thoughtcrime.org/blog/telegram-crypto-challenge/)

2) At this level of payout, they are inefficient and unsustainable. There were less expensive ways to discover implementation flaws, and certainly more direct ways to discover design flaws. Was the lesson they just learned really worth $100 grand from some random dude on the Internet? Seems to me you could find more problems per dollar by directly engaging with some of the top class security consultancies out there.

So to summarize, telegram's reward was an extremely inefficient stunt that did not achieve it's likely real objective. I imagine the team is licking it's wounds right now and regretting their approach. We'll be able to tell by whether or not they continue their offer under the same rules and same budget.

I expect this to continue for another couple of rounds because random security people on the Internet will be smelling blood right now.

</comment></comment></comment><comment><USER18> The Telegram guys chose to view it as a proof of inherent superiority of humble Russian programmers over NSA-backed American haters (I wish I was kidding!). Here is what Pavel Durov had to say on the matter (translated from his public post on vk.com [http://vk.com/wall-52630202_7858](http://vk.com/wall-52630202_7858)):

> This story makes me once again admire Russian programmers. For a whole week > esteemed American cryptographers on HackerNews were picking on the protocol > fruitlessly - mostly demanding to replace our own solution with algorithms > from NSA-backed Suite B [sic!]. An yet a Russian programmer, who calls > himself "a novice", could immediately recognize the weak spot in the secret > chats, in the context of an article on Habrahabr.ru.

Edit: To make it clear, that is not the whole post, just the first paragraph relevant to my point

<comment><USER19> Not sure if the VK post was edited later on, but you are missing the other important statements by Pavel:

* There was no data leak, the vulnerability is fixed, there is no danger. * It was a good idea to open the source and protocol for review. * The founder of the vulnerability deserved a reward of $100k, and comparable rewards will be made for further attacks of similar grade.

<comment><USER18> I didn't mean to present his whole post. It was the first statement that I had issue with. I amended my comment to make it clear.

</comment></comment></comment><comment><USER20> I'm excited by the insight and modesty of this guy. I will see to it that he gets a mighty prize.

It's great to see how open software can leverage the power of the community to find weak spots and become stronger.

<comment><USER21> It is good to see that you recognise modesty as a virtue.

May I suggest that you guys take a leaf out of his book and rewrite the security claims in your FAQ to reflect the fact that the protocol is new and at this point there are likely to be some bugs but that you are working hard to make it secure.

<comment><USER12> This, a thousand times.

Somebody finally expressed this thought politely.

</comment></comment></comment><comment><USER22> Well nice knowing you Telegram. I don't see a good way for them to recover from this. First the bogus contest that Moxie debunked. Now this. The best option is to close shop, open a new company, new names and do something else.

<comment><USER6> The best part is that the debunker wrote this in Russian. The language barrier has probably been responsible for them getting so many users. So now everyone is very clear that Telegram is snakeoil.

<comment><USER12> _> The language barrier has probably been responsible for them getting so many users._

What do you mean?

</comment></comment></comment><comment><USER23> Demoralized twice, first for finding a flaw, second for not giving the prize.

<comment><USER24> Why give the prize for not doing what was needed to win the prize, namely reveal the message?

<comment><USER25> As others have already said, the prize was essentially meaningless because the terms were so narrow.

If the spirit of the prize was "if you break our crypto you win", this guy should win it. If the spirit of the prize was "we don't want to give away 200k, but we want to pretend we're secure", he shouldn't

<comment><USER24> I don't get it. If it's not secure why can't the message be revealed? What's the value of breaking someone's crypto if you are still unable to see the data unencrypted? Was the recipe for decryption given, with the actual decryption being much harder (terms so narrow, as you say)?

<comment><USER26> genwin, I've invented a secure system. If you can tell me what this message says, you win $200k:

      jo

You don't know what the message says, because it's so short. You will never win the prize.

But my system was not so secure. My cipher system was this: Take a message and type it on a US Qwerty keyboard, but shift every letter over one place. So `hi` became `jo`. Not very strong. It would easily be cracked with a message consisting of an actual sentence or two.

Now, with Telegraph, it wasn't just length of the message involved, but additional information; still, the conditions are so narrow that it doesn't apply to the real world. Just like I'd never simply send you a message that said "hi", Telegraph would be used in ways beyond one simple back-and-forth exchange, so it artificially limits the information available to a cracker. Make sense?

See also: The BEAST attack or the general class of side channel attacks.

<comment><USER27> FWIW, "hi" was my first guess when I saw "jo". $200k, please. :-)

</comment></comment></comment></comment></comment></comment><comment><USER27> Why is Telegram in the HNews so much? Are they part of the YC fraternity? Why do pay so much attention to crypto hucksters?

It hasn't been so long since the last snake oil peddlers had their roasting -- I forget the name, it was some cutesy web-browser "secure" chat thing.

It's cool to report debunkings, but if it weren't for HN, I (and most others?) never would have even seen these products in the first place.

<comment><USER14> HN is (rightly) interested in easy to use secure software.

So when something easy to use claims to be secure HN waits for some of the well known cryptographers here to kick the tires.

In this case many people kicked the tires and pointed out some weird obvious flaws. People hoped that Telegram would listen, and seek help and advice, and continue to make a great product.

Telegram's actions made the situation worse, and created a pile-on.

Telegram made a few mistakes.

1) Smart people without crypto experience designed crypto software, but without getting involvement from cryptographers.

2) They released this product as finished, secure, ready to use.

3) They dismissed concerns.

4) To try to quash those concerns they created a rigged challenge with a high value prize. This is a well known red flag for cryptography software, and it's surprising they weren't aware of it, but as soon as people saw that the pile on accelerated.

</comment></comment><comment><USER28> Noone should trust a service that advertises itself as being safe from governments ears. Pure and simple.

First, there's a risk the NSA is actually the one initiating those services.

Secondly, in cryptography, it's very hard if not impossible to effectively prove your messages are not read by someone else. Cryptography experts do not tend to work for people's interests. And if some do, the NSA has too many resources to just defeat those who try to not be listened to.

I understand the intention is noble, but if you release such a safe tool, the NSA will view it as a terrorist threat, because that's the job they have been given, and they will end up listening anyways.

I can't understand the paranoia about all this. If you're really afraid the NSA might use information against you, it's because you made political enemies, in this case, why use digital means of communication at all ?

I really tend to think it's being cool to use those cryptographic features, rather than anything else, and that's worrying.

</comment><comment><USER29> As a side note, I didn't notice it was google translate until half way through the article. It's getting really good.

Is Russian an "easy" language to translate to English?

<comment><USER30> I had to struggle to read it. I mean:

 _After logout, one of the key interlocutors for chat will regenerate, and to check that I have the same key as the source, I can only look in his eyes phone._

...did it translate "iPhone" to "eyes phone"? I'm not sure. If that _isn 't_ what happened, then something far more horrible must have.

<comment><USER31> The original:

 _После логаута одного из собеседников ключ для чата будет перегенерирован, а проверить то, что я имею тот же ключ что и собеседник я могу только посмотрев в его телефон глазами._

My (human) translation:

 _After one of the participants will log out, the key from the chat will be re-generated, but in order to check that I have the same key as them, I would need to see their phone with my own eyes._

This sentence has a particularly non-English word order, plus some missed punctuation. I can see how it would be a hard case for machine translation.

</comment></comment></comment><comment><USER31> Here are some of their comments:

 __ibeatle __

 _Большое спасибо, автор поста полностью прав. Со своей стороны хотим пояснить, что сделано это было из лучших побуждений: исправление плохого рандома на клиентах. С настоящего момента в nonce всегда будет приходить ноль, и в следующем слое мы обязательно удалим это поле из схемы и поясним в документации. Автор топика безусловно заслужил награды, просьба обратиться хабраюзера x7mz на email email@example.com для уточнения деталей._

Translation:

Thanks very much, the author is absolutely correct. Just wanted to explain that the intentions were good: to correct bad "random" on the client side.

From this point on nonce will always be set to 0, and next we will definitely remove it from our diagram and explanations in the docs.

The author definitely deserves a prize, please enquire at the following email for details.

 __W_K __

 _Товарищ прав — похоже, сервер в принципе может с помощью манипуляции с nonce выполнить MiTM на DH между клиентами. Не знаю, кто именно внедрил этот nonce в такой форме, хотя и знаю, какое предъявлялось обоснование — он был нужен для того, чтобы защититься от слабого рандома на клиентах, которых в принципе может писать кто угодно. Очевидно, нужно сделать этот nonce нулём и написать, что клиенты впредь не должны принимать секретные чаты с ненулевым nonce.

Удивительно, что человек, называющий себя «чайником» в криптографии, нашёл действительно серьёзный недостаток протокола, в отличие от многих якобы «профессионалов», постоянно придирающихся не по существу.

Не знаю как насчёт 200k$ — расшифровать трафик это не поможет, а сервер не знает ключа от секретного чата, поскольку на нём нет такой закладки. Но мне очень не нравится, что в будущем такая закладка могла бы быть в принципе кем- нибудь добавлена.

Тем не менее, считаю, за это ценное наблюдение Вам положен ценный приз. Пусть и не такой большой. Если Вы или кто-либо ещё найдёт какие-либо ещё потенциальные дыры в протоколе — сообщайте, будем награждать._

Translation:

He is correct, looks like the server can manipulate nonce and succeed at MiTM on DH between the clients. Not sure who's idea it was to introduce that nonce in this form, but I do understand the motivation, to protect against the "weak random" on the clients that can in theory be written by anyone. Obviously, we need to make nonce=0 and refuse secret chats with non-zero nonce.

It is quite amazing that the man who calls himself "a crypto noob" found a real vulnerability, as opposed to all those so-called professionals whose criticisms were largely unfounded.

Not sure about the $200k since this vulnerability won't really help to decipher the traffic and the server doesn't know the key from the secret chat, because it doesn't have any "bookmark". But I really don't like that in the future such a bookmark could be added.

However, I think this is a valuable observation and you do deserve a prize, even if not such a big one. If you, or anyone else, will find other potential vulnerabilities, please let us know, we will be rewarding.

<comment><USER32> A small correction: use "irrelevant" instead of "unfounded" to translate "не по существу".

"unfounded" is closer to "не обосновано".

It is a English-speaking forum, put English text first.

<comment><USER31> I agree, "irrelevant" would be a better choice.

</comment></comment></comment><comment><USER33> So this was supposed to be secure/robust/mature/trustworthy ? Not impressed, still too many companies around pretending it's sooo easy to make something better, how hard can it be ?

</comment><comment><USER34> There is another "tab" for MITM (at least in android client and in the documentation there are no clues of it) :

Even in the corrected version of Diffie-Hellman (with nonce removed) the server can slip customers a number which is zero modulo p as g_a or g_b (since the documentation says about the 2048- bit sequence -- it can be either 0 or p itself). Then both clients will see the same identicon ("visualization key", 'cause it will be a presentation of SHA1 applied to zero).

However, judging by further manipulation with the "shared secret" key (because MTProto doesn't use Diffie-Hellman method of multiplying by g^ab^-1 or any multiplication by the shared key whatsoever) the multiplication by zero will not happen with client messages and they will successfully flow through the "bare" AES ( and therefore users will think that everything is fine and will proceed to transmitting sensitive data in this mode ).

P. S.: Correct me if I missed something . This might be a corner case, but, nevertheless, it formally differs from the one with server xor salt not much (at least , need fixes in the client and the doc too). Or am I making a mistake somewhere? P. S.: Original version of this my comment in russian: [http://habrahabr.ru/post/206900/#comment_7128970](http://habrahabr.ru/post/206900/#comment_7128970)

</comment><comment><USER35> Am I the only one who read this in my head with a Russian accent?

<comment><USER36> nope.. lol!

</comment></comment><comment><USER37> That didn't take long.

</comment><comment><USER38> This is great news for Telegram. With such a weakness, the NSA will soon be encouraging wide spread use of their protocol.

</comment><comment><USER39> Great work! I hope this person gets a big piece of the prize, if not all of it. Perhaps they should have waited for the challenge to be expanded. (That's what I'm doing. I just hope nobody spills the beans first.)

</comment><comment><USER40> cool stuff. Give the guy his prize

<comment><USER41> He didn't break the message. They weren't offering a prize for what he did.

</comment></comment><comment><USER19> On [http://vk.com/wall-52630202_7858](http://vk.com/wall-52630202_7858) Pavel Durov writes that the finder of this vulnerability will receive a reward of $100k, and that comparable awards will be given for other findings. It looks like they are slowly making progress from a rigged show to a proper crypto evaluation situation.

</comment><comment><USER42> 200k gone just like that, better now then later.

<comment><USER43> He's not getting it apparently, even though he discovered a major flaw. Sounds like a great PR stunt gone bad for Telegram. What a joke.

<comment><USER12> He's getting $100 000.

[https://vk.com/wall-52630202_7858](https://vk.com/wall-52630202_7858)

</comment></comment></comment><comment><USER44> The bad thing about this is that it further advances the delusion that this contest is a reasonable idea. Nothing was "improved" by finding this. It's just going to reinforce their bad behavior.

</comment><comment><USER45> The first thing they teach in hacking class is "Nothing is 100% secure. Even the brain.exe is vunerable.".. Well proved again. Nice work !

</comment><comment><USER46> Why does Telegram provide the generator (g and p) and then suggest validation and caching? These can be hardcoded parameters

<comment><AUTHOR> in cryptography nothing is hardcoded (or at least hardcoded values should have enough entropy) :) if client doesnt use caching - then every message user sends should obtain a new pair of p/g (which is expensive) - and it will make telegram not only insecure but also "slow" messenger :P

<comment><USER46> The only things that aren't hardcoded in your typical secure cryptosystem is your key and a few nonces. In ECC the analogous components to p and g are defined extremely carefully and certainly wouldn't be changed willy nilly. I'm aware classic DH parameters are more liberal, but changing them for every session seems unnecessary.

</comment></comment></comment><comment><USER47> Interesting. I'm wondering about Threema, I think Moxie is already on them.

</comment><comment><USER48> Would this hole allow him to decrypt chat text?

<comment><AUTHOR> no, but it allows server to decrypt it. Government in case of the need can "ask" them to forward your chat and they will do it, but it was stated in their PR that server is unable to decrypt your messages.

<comment><USER36> exactly, the prize was at their own discretion(telegram) in the first place. And it was still for breaking their End-to-End encryption process.

To simply put it, you don't have to break a wall, just find a loose brick, once that is gone, the wall will have even more loose bricks, and eventually it will fall.

</comment></comment></comment><comment><USER6> TextSecure's protocol, on the other hand, hasn't ever been compromised. Don't use Telegram. Use TextSecure. [https://whispersystems.org/](https://whispersystems.org/)

<comment><USER49> That's absolutely true, but I think the reason this seems so devastating for Telegram is not necessarily because there was a vulnerability, but because they were so dismissive of the feedback they got and so willing to immediately make such strong claims.

The way I hope TextSecure can be different from Telegram is not by having an absolutely perfect security record forever (although that'd be great), but by publicly talking about the protocol choices we've made, employing constructions with proofs where possible, and actively soliciting feedback. Thanks for being involved!

<comment><USER31> To be fair, no one here mentioned anything related to the found vulnerability. Instead people seemed to have focused on their choice of SHA1 and IGE.

<comment><USER50> To be fair, no one actually discovered the bridge was made of rotting wood. They seemed focused on the fact that math PhDs design it with no civil engineering background and stated plastic had no known defects.

<comment><USER16> No. They saw that the bridge was made of such a material, that it would collapse if the material turns out to be anything but steel-reinforced concrete. Which it was pretty likely to be, because it was designed by people who have been, up until now, building igloos.

</comment></comment></comment></comment></comment><comment><USER51> I hope this person will get the full $200,000. I definitely don't think we can ever trust Telegram's strength again. They won't be paying him the full $200,000 even though he has rendered the Telegram to be weak. Major, major backfire for Telegram stakeholders.

<comment><USER52> They gave him $100 000. And yet the flaw he pointed out doesn't help you read encrypted messages and has been already fixed/

<comment><USER53> The flaw he pointed out renders one of the main advertised features of Telegram - end-to-end encrypted chats that they can't eavesdrop on - broken to the point of total worthlessness. Telegram had the ability to undetectably MITM and spy on the supposedly secure communications, as did anyone who managed to compromise them.

They'd have achieved exactly the same level of security by having no end-to- end encryption whatsoever and just promising that they wouldn't log or look at people's messages - this flaw is seriously that bad.

</comment></comment></comment><comment><USER36> Lol, I don't know whats so bad in Telegram being a bit "braggy" about their stuff. I mean, it took them a lot of hard work, in the first place since they did a lot of things on their own, instead of using pre-set standards. Everyone can loose a grip on self control, more than a few times. So what!

Besides, its only to inspire someone to crack their program, it is necessary to come across as a bit arrogant, so someone would loose a screw and crack it. never mind the buttery language post-cracking, since that usually comes from appreciation for each other.

Putting up a challenge publicly is a great PR tool, I feel its not reasonable to only bash 1 company about it. Unless, there is something I don't know, about what they said/did earlier on HN.</comment>


How lack of natural talent is irrelevant to great success - <AUTHOR> http://money.cnn.com/magazines/fortune/fortune_archive/2006/10/30/8391794/index.htm

<comment><USER2> The title here is misleading, maybe deliberately to provoke interest? The article presents research that natural talents without "deliberate practice" are unlikely to result in great success in any field. Common sense, to me, that consistent, daily practice and focus on improvement are needed for top performance.

<comment><USER3> Agreed. And in some fields, such as music, "deliberate practice" without _some_ natural talent will only take you so far. And in the the case of the international chess with an IQ in the 90s - I think that's fodder for all those who question the validity of IQ tests.</comment></comment>


How We Used Data to Win the Presidential Election - <AUTHOR> http://www.youtube.com/watch?v=71bH8z6iqSc

<comment><AUTHOR> Hope you guys like my talk. I'd be glad to answer any questions from the HN community!</comment>


Pythons, Mathematical Doodling, and Graph Theory - <AUTHOR> http://kottke.org/10/12/mathematical-doodling

<comment><USER2> This is blog spam. Don't go there - it's simply appropriating someone else's material without attribution.

Scum.

Here's the original:

<http://www.youtube.com/Vihart#p/u/1/heKK95DAKms>

Posted there:

<http://news.ycombinator.com/item?id=1974604></comment>


Microsoft's 2003 patent application for the "Is Not" operator - <AUTHOR> http://appft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50&s1=%2220040230959%22.PGNR.&OS=DN/20040230959&RS=DN/20040230959

<comment><USER2> Paul Vick, whose name appears on the patent, had a great blog post about this. Had to dig it out of archive.org: <https://gist.github.com/1846067>

FWIW, as much as I hate[d] VB.NET, Paul Vick was (is?) clearly a superstar - both in terms of coding and writing.

<comment><USER3> Disclaimer: ex-MSFT, have several patents pending from during my time there.

His blog post reminds me why I get so mad at Microsoft using patents against Android OEMs. During all my years at MSFT, employees were always told that patents were necessary for the reasons Paul Vick stated - you had people like Eolas and zillions of other trolls trying to get you and you needed a portfolio to play defence.

With the Android issue, that changed. MSFT suddenly started using patents offensively as a strategic tool. While I totally get why this is smart ( and I'm stunned at how effective it has been), I feel they violated an implicit social contract with a lot of people who worked to get them those patents.

It's going to be interesting to see whether Google does the same swerve down the line and not just stick to using patents in defence.

<comment><USER4> > During all my years at MSFT, employees were always told that patents were > necessary for the reasons Paul Vick stated - you had people like Eolas and > zillions of other trolls trying to get you and you needed a portfolio to > play defence.

No, that can't be right. I hope you're just misremembering that, but the whole problem with patent trolls is that you can't use your own portfolio for defense.

A large patent portfolio is a good weapon against other giants in your industry: IBM, Apple, Oracle, Google, (and once upon a time) Sun. Those people basically can't sue you for violating one of their patents if you have several thousand of your own: they're bound to be in violation of at least one of yours, and it's a mutually-assured-destruction scenario.

A patent troll, on the other hand, _doesn't do anything_. They can sue you with relative impunity, since there's almost no chance that they're doing anything that you can use against them. The size of your own patent portfolio doesn't even enter the picture.

<comment><USER5> There's two ways you can use patents for defense:

1) patent it before the other guy does, so the troll has nothing to sue you with, and

2) patent everything and hope that one of your patents overlaps with the troll's.

<comment><USER6> There is another strategy - just publish your invention for all to see rendering it un-patentable.

IBM of all people used to do this for ideas they did not think were worth patenting. By publishing them they stopped anyone else from getting a patent on those ideas. IBM published a magazine for 40 years that is a treasure trove of prior art: [http://en.wikipedia.org/wiki/IBM_Technical_Disclosure_Bullet...](http://en.wikipedia.org/wiki/IBM_Technical_Disclosure_Bulletin)

Now anyone can do defensive publication on this site

<http://priorartdatabase.com/>

<http://en.wikipedia.org/wiki/Defensive_publication>

I used this strategy with some GPS cell phone ideas I had in 2003 and I "published" them myself

[http://web.archive.org/web/20031211124028/http://www.gadgete...](http://web.archive.org/web/20031211124028/http://www.gadgeteer.org/ideas.htm)

<comment><USER5> Unfortunately, that (rather noble) act is untenable in a world where everyone's suing everyone in the big boy department. If Apple and Microsoft weren't trying to kill Android with lawsuits, I could see a gentleman's agreement between the lot of them making this a fairly effective strategy. With the current state of affairs, everyone needs all the linked list patents they can get.

<comment><USER6> I see it less as being noble and more of a practical strategy for a small business. You can't afford to apply for a patent on everything you think up so why not publish it so at least you will not be locked out of using your own idea by someone who comes along later and does apply for a patent.

</comment></comment></comment></comment></comment></comment></comment><comment><USER7> A question for anyone who quit their career as a patent lawyer to work on formal methods (or vice versa):

Since mathematics isn't patentable, can you invalidate a patent claim by showing that it is equivalent to a mathematical formula? And if so, by the Church-Turing thesis, wouldn't any Turing-complete program be representable in lambda calculus, and therefore be unpatentable?

<comment><USER6> True, you can not patent a mathematical formula but you can patent a machine that uses a mathematical formula to do something and the machine can be a computer.

<comment><USER5> So I can't patent 'x=x+1', but I can patent a "system, method, and computer- readable medium for incrementing the value of a variable by one"?

<comment><USER6> A more concrete example: You discover that the formula for making a beam that will have equal stress all along it's length is t = (.923)Xe/L^2 (made-up formula)

You can not patent that formula, but you can get a patent on beams made using that formula. With that patent in hand you can stop anyone from making, selling, or using those beams.

<comment><USER8> Sounds like a distinction without a difference. If you can stop people from using a formula with your patent, you've effectively patented that formula.

</comment></comment></comment></comment></comment><comment><USER9> Reading the title, I immediately thought of Python's "is not" operator as "prior art". However, it seems to me that the patent is specifically about an operator called "IsNot" (one word) used in a BASIC compiler. So that might not be the same at all (but then again, IANAL etc).

Still, it seems a pretty silly patent... :-/

<comment><USER10> > it seems a pretty silly patent

In software, most of them are.

<comment><USER11> In software, all of them are. It's like patenting a mathematical formula.

It's bad enough that the USPTO will rubberstamp everything with the right fees, but that they can issue patents on concepts that are far outside the original intent what patents are for.

Yes, developing software involves "invention" in every sense of the word, but if you can patent algorithms, why can't you patent mathematical formulae or proofs?

<comment><USER12> " It's like patenting a mathematical formula." More like an Mathematical Algorithm but even then, most devices are physical representation of a algorithm in some way. I don't see how this is a valid attack on software patent or patents in general.

I don't support software patents but I have a problem with the whole "it's patenting a mathematical formula" argument.

<comment><USER13> The US courts do place weight on the "it's patenting a mathematical formula" argument. There's some nuance and murk, but an application will probably have to pass the "Machine or Transformation Test" to be patentable: <http://en.wikipedia.org/wiki/Machine-or-transformation_test>

Essentially, software implementations of algorithms cannot generally be patented either because they are simply an expression of the algorithm in a particular language. The fact that this language can be interpreted by a particular hardware device does not change the situation. The hardware is a pre-existing piece of general-purpose commodity hardware that is easily interchangeable with any number of other pre-existing pieces of general- purpose commodity hardware, up to and including a human being equipped with a pen and paper, and therefore cannot really be claimed as part of the patent.

A physical device which implements the algorithm can, of course, be patented. And a hardware/software combination where the computer is an integral part of the mechanism (e.g., it cannot in principle be replicated by a human with a pen and paper) can also be patented, so Amazon's 'One-Click' patent is safe. However, simply tacking on the phrase, "Written in a programming language," does not take an unpatentable idea and make it patentable.

</comment></comment></comment></comment></comment><comment><USER14> Better link, includes figures and proper formatting: [http://www.google.com/patents?id=m52fAAAAEBAJ&zoom=4&...](http://www.google.com/patents?id=m52fAAAAEBAJ&zoom=4&dq=isnot&pg=PA1#v=onepage&q&f=false)

</comment><comment><USER15> What's really annoying about the IsNot operator is that it's not consistent with TypeOf ... Is. In other words, you can't do this:

        If TypeOf obj IsNot MyClass Then
            ' ...

Instead you have to do:

        If Not TypeOf obj Is MyClass Then
            ' ...

</comment><comment><USER16> I wonder who has patentent exception. That would be pretty great money machine.

</comment><comment><USER17> uhh... "20. The method of claim 15 wherein the source code is BASIC code. "

Really? They patented something for BASIC? Also, I'm pretty sure patents do serve a useful purpose, because first nobody cares about whether something is protected by patent or not, they'll find a way to rip it off. What patents do is put these technologies and developments into the public record.

I think the propriety of patents is problematic, but without them we would potentially be in the dark about how certain new inventions work. It's important for things like medicine, but software patents are a bad idea because they lead to patent trolling and lawsuits over things that are obvious solutions to common problems.</comment>


The U.S. Isn't Prepared for the Next Recession - <AUTHOR> https://www.theatlantic.com/business/archive/2017/10/next-recession-prepared/544391/?single_page=true <comment><USER2> What they addressed at the end of the article is the key point to me. There are reduced nations left to fuel the worlds economic engine in a recession. Previously events like 2008 we had India, Middle Eastern and Chinese economies doing massive development, so while the western countries went to recovery mode, the could benefit and hold themselves a bit better from these other nations growth.

Today if we hit a trade/financial crisis its likely to spread across the major global economies. African areas and India seem to have ongoing growth potential but I dont see them coming to the rescue.

And should a major economy like US have a crisis this could have a global impact compounded further by; 1) The massive global debts being accumulated at personal and state levels pretty much everywhere. This is setting ourselves up for potential contagious failure of our systems. Not just inter country finance but imagine there was significant defaults and how that would spread to pension funds and back into the economy. Small business lending etc. Our globalised and finance heavy economies dont have adequate circuit breakers. Further 2) I suspect developed nations urbanisation will make any significant downturn harder on the masses than previous recessions. In the 1920's you had 30%+ of people on farms. Now you have something like 2%. Back then people could more easily tighten belts and become increasingly self sufficient over a few hard years. Today it would be a significantly more difficult position for the government to manage, both by volume of people that would need full support and back to their indebtedness. This could spell real trouble if the wheels fall off. And given history, the wheels will fall off occasionally.

Anyway, I'm not trying to scare or convince people to buy bunkers. I do feel we should demand better long term governance from politicians vs this 'whats gets me in next term' politics we see today. With the tribalism and instant gratification of today's politics it doesn't seem to offer the best hope. But really who knows...

<comment><USER3> Going along with everything you've said, the fact that the wealthy now control such a vast share of assets and capital is a super not-good thing in the event of a hard recession. Honestly our situation now looks so much like the Roaring 20's, a certain segment of the population getting a shitload of everything, while everyone else goes hungry (and famously, the roaring 20's tapered off nicely and we all came out better- oh no wait, it was the Great Depression and we had to participate in a World War to get out of it).

Income Inequality and Lack of Social Mobility are a cancerous tumor growing inside the United States and many other developed countries too. This shit is a powder keg and the wealthy need to realize that if they keep pushing to get that next dollar, eventually all their money isn't going to keep the pitchforks at bay.

<comment><USER4> I think it's different this time around.

Student loan debt and healthcare costs are out of control, but the practical difference in quality of life between the rich and average American is smaller than ever. All the money in the world won't make Facebook better, or get you another season of Breaking Bad, or a better iPhone, or a better video game, or faster speed limits.

People aren't going to raise pitchforks because someone has more zeros in their bank account.

<comment><USER5> Yeah, entertainment options are great if you're poor. This might keep them somewhat complacent. But how about the quality of housing and transportation?

People absolutely will raise pitchforks when they no longer have housing or food _. There are many Americans in this situation right now, but they suffer in near-silence. As their numbers swell, we will reach a point where they can no longer be ignored.

_ The food itself is cheap, but obtaining the food isn't. Consider the poor rural people that need to drive 30+ miles to the grocery store.

<comment><USER6> _There are many Americans in this situation right now,_

Do you have sources for this? Bonus points if it's something updated regularly that I can bookmark.

<comment><USER5> Great question. The USDA tracks this information. [https://www.ers.usda.gov/publications/pub- details/?pubid=849...](https://www.ers.usda.gov/publications/pub- details/?pubid=84972)

A snippet from the summary:

> The prevalence of food insecurity varied considerably from State to State, > ranging from 8.7 percent in Hawaii to 18.7 percent in Mississippi in > 2014-16. (Data for 3 years were combined to provide more reliable State- > level statistics.

In other words, almost 1 in 5 Mississippi households lacked enough food to feed the entire family at some point in 2016. For the nation as a whole, it's still 1 in 8 household.

</comment></comment></comment></comment></comment></comment><comment><USER7> The U.S. has gotten progressively worse and worse at handling recessions, and yes, it's in no spot to handle the next one.

But this is nothing new. It's been heading this way for a long time. You could have ran this same article a year ago before the current administration took over.

I don't want to mention politics, but politics plays a big role here. When your party is in power, life is good and spending is easy. When your party is out of power, hard times are coming and we should prepare.

The state of the nation doesn't flip around that quickly. Instead it's all about long-term trends like debt and interest rates. But by viewing all public policy through a partisan lens, it allows folks to always blame the "other guys".

It is a dysfunctional political system that's led to a dysfunctional financial system. I think the U.S. might have another decade or two, but one day, being the world's reserve currency ain't going to cut it any more. That day is going to suck.

<comment><USER8> Democracy does seem to have a problem delivering fiscal responsibility, it's too easy to put it off for the next government.

<comment><USER9> The problem is larger than fiscal. It's about long term thinking in general. We have no common cause, vision or "myth" to gather round.

<comment><USER10> Common rallying causes have been systematically dismantled.

You can't be patriotic because our history isn't perfect.

You can't be religious because it might offend someone.

God and country have been the common denominators of our culture and they are no longer seen as relevant, and there is nothing else to replace them. It seems like we are more interested in finding and emphasizing all the ways we are different from each other rather than rallying around anything we might have in common.

<comment><USER11> > You can't be patriotic because our history isn't perfect.

This is untrue; very few people have a problem with patriotism. Lots of people have a problem with various forms of nationalism, but none of that is about imperfection of history except insofar as certain breeds of nationalism center around glorifying and recreating bad aspects of history.

> You can't be religious because it might offend someone.

While this has _always_ been true to an extent for faiths other than than that of the most dominant local form of Christianity, it is less true (not more) now than in the past.

<comment><USER12> > This is untrue; very few people have a problem with patriotism.

Look, I come from the left. Growing up, there was definitely the sense that it is in poor taste to express enthusiasm about America or being an American. That it was something reserved for red necks who drive pick up trucks. The American flag, as a symbol, was considered gauche and the only time you would wear anything with the flag on it is if you were being self-consciously ironic. There was no sense that America was great. Instead, the focus was almost exclusively on America's flaws.

<comment><USER13> This critique is overly focused on shallow aesthetics ("gauche", "pickup- trucks"), which really have nothing to do with patriotism, and more to do with some kind of tribal name-calling, which I'm sure takes place on both left on right. It is just as patriotic to acknowledge and grapple with a country's flaws as it is to express pride in one's country. There's no contradiction between the two.

<comment><USER12> In my experience, there is a deep vein of antipathy toward America on the left. I brought up condescension toward the flag because I think it is emblematic of that antipathy. I mean, the flag is just about the purest symbolic representation of America that exists. So if your attitude toward it is that you wouldn't deign to adorn yourself or anything you own with it, and you disparage it as fitting only of some lower class, what viable interpretation of that fact is there other than that you feel negatively about the thing which it represents?

Or perhaps another way to think of it: if you had a friend who, every time a certain person came up, immediately started to enumerate that person's flaws, what would you conclude about their feelings toward that person?

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> At the current pace of rate rise and the announced pace of withdrawal of QE, it's going more than 5 years before the monetary policy returns to normal. I doubt the current cycle will last that much longer. That will leave the Fed with little tools to react, other than even more QE.

</comment><comment><USER15> This comment identifies parties responsible for actions, but these actions are taken by democrats and republicans alike, no president in my life time has failed to engage in these practices. This is not a political response.

Recessions are not "just how economies work". Recessions and depressions are the product of the monetary shenanigans of the central bank, as laid out well in the Austrians Business Cycle Theory. The short overview is, easy money means government gets to spend and the money creation process includes showering those at the top - wall street banks and government connected entities-- with new money that they are expected to "invest" in the economy. The problem is this is malinvestment and distorts the markets.

You can only do it so long and you invariably create bubbles.

A recent example of this I have lived thru is the dotcom boom...when it went bust, interest rates were put below the cost of money, and banks were mandated to make bad loans (prudent underwriting of loans was considered "racist" by democrats in the late 1990s so CRA was changed, later analysis showed it wasn't correlated with race after all.) Then under Bush the spigots were really opened and suddenly you have very cheap money to buy houses with.

Buying a house with cheap federal reserve money was a form of the carry trade--- where you buy an asset worth X and then pay it back with increasingly lowered value dollars.

This resulted in the housing bubble and of course the housing crisis.... which was "fixed" with massive amounts of even more easy money. This money is now going into wall street again, this time into equities, and hedge funds and venture capital.

It will eventually bust again.

IF you don't have an easy money policy then interest rates follow the supply demand dynamics of a market, and it will self regulate. Even if you don't think it will perfectly regulate itself (and that's true) it will tend to, rather than get way out of whack.

What we have now is an economy that is has gotten so out of whack and never been able to properly recover itself by unwinding the last two bubbles.

<comment><USER16> Right, because there were no recessions and depressions before central banking. Oh Wait! They were more frequent and worse.

The "government is the source of all economic problems" is a religious myth as wholesale as "satan is the source of all evil, god is the source of all good".

> prudent underwriting of loans was considered "racist" by democrats

is a myth.

Conspicuously missing from this comment is anything about deregulation, nothing about Glass–Steagall. Only euphemistic suggestions that somehow people disagreeing with redlining (and other practices) somehow caused a crash.

This view is only possible if you assume any behaviour people partake in a market is the right behaviour and so any adjustment to that must be bad (, and thefore ... euphemism euspemism... crash).

No. It is possible to have a financial system which is regulated to minimize perverse financial practices. We should place blame on the legislators who fail to do so and the financiers who act recklessly. Not wink and nodd towards "prudence", by which we mean, a president _asking_ for an end to racist policies is more severe than deregulating the banks.

</comment></comment><comment><USER17> It seems like the main takeaway here is "the social safety net has been deliberately weakened, and now in a downturn people will be more hurt." Well, yes, but in some sense that's the point of weakening the social safety net.

<comment><USER18> The "point" of weakening the social safety net is not to "hurt" people in a downturn, but to shift economic incentives by changing a reward structure from non-work/non-productive behavior to work/productive behavior.

How successful this policy is is debatable, but I think it's important clarify intentions and purposes.

<comment><USER19> I love the double standard and the underlining continuous servitude which is created with this statement. So the reason your not well off or have multiple homes is because you don't want to work. So lets give little Johnny or Maria a little whip to the back and make them earn the scraps we give them to keep themselves alive. Oh but if banks and corporations that have hollowed out the government coffers and pensions go under because of there gambling with derivatives. Well they need a blank check, or oil companies who have been making hand over fist in money for years, lets give them subsidies, or the company thats making a trillion dollar plane that doesn't even fly. Lets give them more money!!!

I really wish we would stop picking on poor and down and out people and start making the 1% pay their fair share instead of everyone else paying for them to be the 1%.

</comment></comment></comment><comment><USER20> Isn't prepared to do what exactly?

Does The Atlantic think people are just going to lay down and die when it comes?

People will deal with it the way they always have of course, by modifying their behaviors to align with current financial realities.

I really don't understand the point of article like this.

<comment><USER21> There are systemic shocks that you're sweeping under the rug.

If most people in a state is underwater on their house and they declare bankruptcy there is a real economic erosion that occurs. Foreclosed houses get looted, depressed people stop working, already stressed state finances break under the burden of further aid applicants.

By saying they'll just "modify their behaviours" you're essentially saying they'll just "go on welfare or become homeless on the street".

Most of America is not ready for the next recession, and it is coming at the worst time, when Baby Boomers are starting to strain the retirement and healthcare systems.

<comment><USER22> Paradoxically, economic downturns disproportionately affect the economically advantaged. While the medium and lower classes' financial situations don't need to travel very far to reach the bottom, the rich (and super-rich) will see their income and wealth descend a steeper cliff much more violently.

Skilled individuals can seek employment (at least until regional supply is exhausted) whereas wealth does not recover so quickly. What can take a generation to build up would be wiped out within a single fiscal year.

War and economic recessions/depressions have a tendency to assiduously devour the rich. To be quite honest, war and economic depressions are the best way to reduce income inequality. The old adage of the tree of liberty needing to (regularly) be replenished by blood seems to apply.

</comment></comment></comment><comment><USER23> It's all riding on the faith of the rest of the world in the US. Watch the USD. Once it plunges, it's over. Won't be able to print money anymore. Until then they can print away a lot of problems.

<comment><USER24> there is more than faith involved.

If you compare the U.S. to the rest of the world in terms of wealth, measured by productive land, population density, industrial development, and access to critical natural resources it is still in the #1 position and has the best natural defenses with no hostile nations on its borders.

Economics is all relative. Even if the U.S. is a disaster in many ways it only has to be as good or better than other large economic blocks in order to be competitive. Since the U.S. is in a superior territorial position and has the advantages of accumulated wealth and knowledge you really have to go out of your way to f--- things up for the U.S. to ever fall out of a leadership position.

Consequently, a "plunge" is very unlikely. More likely is a few more decades of high inflation, which is just a backdoor way to default on pension, social security, and debt obligations, followed by some kind of new stasis.

The people buying US debt are not dumb. They fully understand that it is impossible for the debt to ever be "paid" in any conventional sense. What they are betting is that the U.S. is still a better investment than other nations and that owning U.S. debt gives them leverage and access that outweighs the nominal losses. That is unlikely to change.

<comment><USER25> Agreed. The US is in a tough spot, but the rest of the world is in an even tougher spot. Definitely with regards to geography, but also with regards to demography (the only continent where population is continuing to grow is Africa). Worth reading: "The Accidental Superpower", [https://www.amazon.com/Accidental-Superpower-Generation- Amer...](https://www.amazon.com/Accidental-Superpower-Generation-American- Preeminence/dp/1455583685)

<comment><USER26> >the only continent where population is continuing to grow is Africa

No, the only continent where population isn't growing is Europe [0], where it is relatively flat. Everywhere else is growing. For individual countries, the only ones with negative growth are in Europe, Islands, and Syria [1].

[0] [https://www.statista.com/statistics/270859/natural-rate- of-p...](https://www.statista.com/statistics/270859/natural-rate-of- population-growth-by-continent/)

[1] [https://data.worldbank.org/indicator/SP.POP.GROW?year_high_d...](https://data.worldbank.org/indicator/SP.POP.GROW?year_high_desc=false)

<comment><USER12> Yeah, but birth rates have fallen below replacement in huge swaths of the world. And Pakistan is the only country outside of Africa that has fertility rates above 3 children per women. Which means that, if the demographic transition continues, the entire world except for Africa will be at below replacement fertility in several decades. Population can continue growing for a while after birth rates fall below replacement, but the writing is on the wall: if Africa can modernize, then the world population will start declining.

[https://en.wikipedia.org/wiki/Sub- replacement_fertility#/med...](https://en.wikipedia.org/wiki/Sub- replacement_fertility#/media/File:Countriesbyfertilityrate.svg)

<comment><USER25> Thanks to both you and GP for digging up the facts!

<comment><USER12> I think the most interesting avenue of thought to stroll down is considering what humanity looks like after we evolve resistance to whatever it is about modern life that results in low fertility rates. In other words, which types of people are immune to modern life and have lots of children anyway.

Happy (thought) travels!

</comment></comment></comment></comment></comment></comment></comment><comment><USER27> Doesn't a recession happening mean we were unprepared?

If we were prepared to handle it, wouldn't we, and then avoid it?

<comment><USER3> Economies bounce. Boom and Bust cycles have been with us since the beginnings. The lack of regulation though and the rolling back of financial policies in the last few years have created an environment where a whole lot of people are in a whole lot of risk that they themselves aren't entirely responsible for, and haven't agreed to.

If the next Bust goes as badly as some are saying, that could be the death knell of Fiat currency. This isn't the first time it's been mismanaged to a degree bordering on straight insanity, and it probably won't be the last either.

<comment><USER28> " _...the death knell of Fiat currency._ "

Could someone enlighten me as top the end game? I mean, after the world economy collapses into a sink hole big enough to destroy the confidence in _all_ national currencies?

</comment></comment></comment><comment><USER29> the stimulus they claim is not wanton spending by the Federal government but transfer payments. Those include extensions of unemployment, food stamps, and other assistance programs. It also includes, contrary to how we think but government thinks, tax rate cuts and tax holidays.

the real threat isn't the US still, it is that Europe still is more likely to tip and negative interest rates over there are a serious drag. Just ask Japan how long the malaise was because of bad fiscal policy and attempts to prop up on government money was

<comment><USER30> Just a few countries in Europe are in bad weather though, the Germanic core of the European economy is in good shape and Eastern Europe is rapidly catching up.

Maybe it's misplaced, but I am pretty optimistic.

<comment><USER31> I would not be. The reason Greece got such harsh treatment was because their government took over much of the private debt at the outset of the crisis to avoid mass bankruptcies. Thing is that much of that debt was issued by German banks. Thus if Greece defaults, German banking is in for a rough time.

Never mind that the German economy hinges on maintaining massive exports, while domestic wages have been deliberately held back.

</comment></comment></comment><comment><USER32> Here's an intersting question; Would an economic recession be a boost for Bitcoin, or would it be dragged down?

My intuition tells me that Bitcoin would see a surge, as it becomes a stronger pillar of monetary value that crosses country borders, similar to the dollar, but not tied to the US.

<comment><USER33> Given five years of data on bitcoin prices I think it is a false flag to think any macroeconomic force correlates to bitcoin. Bitcoin is centralized enough, and independent enough, that the real motivator of bitcoin price is the whims of a handful of people who control most of the economy, _whatever those whims may be_.

Often those whims can _correlate_ to shockwaves in the economy or the policies of the US and China trying to stomp out miners or trading but fundamentally they aren't reflective of broad market ideas the way most major stocks are. Bitcoin is _much more centralized_ than traded stocks because its economy is so small and the barrier to entry so high.

People keep trying to find the trends in bitcoin, but the active pursuit of trends is what motivates the dominant whales to avoid being predictable.

</comment></comment><comment><USER34> Why don't we just flag this article too along with all the others, if it's too unpleasant to think about?</comment>


Vuiet, the long road to building my own music player in Lisp - <AUTHOR> http://mihaiolteanu.me/vuiet/ <comment><USER2> I've used python with gstreamer to create my own music player as well. It was a fantastically enjoyable project and I use it for hours every day. Strongly recommend it for anyone who wants a fun challenge (and who is finicky about how they listen to music).

</comment><comment><USER3> Hehe, weirdly enough, I just set it up on my emacs a few hours ago. It definitely needs more polish, but so far has been a nice experience and definitely has saved me some clicks and context swapping.

Thanks for the package.

</comment><comment><USER4> A Show HN of the project: [https://news.ycombinator.com/item?id=22625836](https://news.ycombinator.com/item?id=22625836)

</comment><comment><USER5> Geek level up.</comment>


Watch this autonomous Tesla drive from home to work on its own - <AUTHOR> https://techcrunch.com/2016/10/20/watch-this-autonomous-tesla-drive-from-home-to-work-on-its-own/ <comment><USER2> Read my post about autonomous cars: [http://fullstack.info/autonomous-cars- letter-future-self/](http://fullstack.info/autonomous-cars-letter-future- self/)</comment>


Lisp as an Alternative to Java (1999) - <AUTHOR> http://norvig.com/java-lisp.html <comment><USER2> This article appears on HN on a regular basis, so I thought people might be interested in a bit of historical trivia: the reason this article is called "Lisp as an Alternative to Java" instead of some other language is that it cribbed the title off my original study ([http://www.flownet.com/gat/papers/lisp- java.pdf](http://www.flownet.com/gat/papers/lisp-java.pdf)). The reason _that_ article was titled the way it was is that I was working at JPL at the time and there was a software crisis underway. To that point, spacecraft had been mostly programmed in assembly language. The then-recently-launched Cassini spacecraft was a notable exception, having been programmed in Ada. But it was becoming clear that neither of these approaches scaled well, and so the hunt was on for an alternative. Java was the hot new language at the time, and it was under serious consideration to become the new standard for spacecraft coding. But Java was new and immature (and, in those days, very very slow), and I was advocating to use Common Lisp instead. That study was conducted -- and the paper was titled -- in order to bolster my case.

Ultimately, Common Lisp flew on a spacecraft once, on the New Millennium DS1 mission. Unfortunately, there was a serious political shitstorm that accompanied that mission, and Lisp never flew again despite several million dollars having been spent to show it to be a viable approach. :-(

<comment><USER3> That is what I have found in most of my research of computing since Burroughs attempted to use an Algol variant for systems programming.

The general opinion is that those systems failed due to technical issues, however most of the time failures are caused by political wars.

They are even worse when they are caused by those that don't want things to change, like what seems to have happened during Longhorn development.

So one needs a group strong enough monetary and political, to be able to change ways of computing, sometimes even loosing a couple of battles to eventually win the game.

<comment><USER4> Info on the Longhorn project: [http://longhorn.ms/](http://longhorn.ms/)

<comment><USER3> Windows 8 base design is basically Longhorn to certain extent.

They brought COM+ Runtime back from the grave, exchanged the COM type libraries for .NET metadata and renamed it WinRT.

At the same time C++/CLI syntax was repurposed for C++/CX this time doing AOT compilation to native code. Similarly, .NET went through two new AOT compilation toolchains, first the MDIL binary format used in Windows 8.x, followed by .NET Native introduced in Windows 10.

Which begs the question if the Dev and Windows devisions weren't so busy fighting each other, maybe just maybe, Longhorn would have had the UWP application model instead of Windows having gone through all these releases until they had settled their differences.

Now it still remains to be seen how much it will eventually matter.

This was just an example, there are others regarding other technologies, for example Symbolics had quite a few internal fights.

[http://danluu.com/symbolics-lisp-machines/](http://danluu.com/symbolics-lisp- machines/)

</comment></comment></comment></comment><comment><USER5> I've experienced those types of speed ups when doing "puzzler" programs in Haskell as opposed to Java (the language I make money programming in). If given a few weeks to implement a REST API or something much more real world, I'd kick Haskell to the curb and cleave to Java like a long lost lover. Libraries, tooling, community support and information...these are the language's "killer" features.

<comment><USER6> I support this attitude!

Haskell is coming around though. We got Stack which is a fantastic package manager, and we now have a web API library which is pretty much unmatched: [http://haskell-servant.readthedocs.io/en/stable/](http://haskell- servant.readthedocs.io/en/stable/) (each Servant endpoint has a type, and you can generate docs and client libraries from your backend code). Editor tooling has historically been the other problem, but that's starting to come around too.

<comment><USER7> It's like Year of Linux on the Desktop. Every year it gets better, and some long-suffered pain point is solved. But every year the world moves on and users want more. Without a massive investment, it just can't keep up.

</comment></comment></comment><comment><USER8> What are Oracle's plans for Java and the JVM?

"Insider: Oracle has lost interest in Java" \- [http://www.infoworld.com/article/2987529/java/insider- oracle...](http://www.infoworld.com/article/2987529/java/insider-oracle-lost- interest-in-java.html)

"The email, sent to InfoWorld on Tuesday by a former high-ranking Java official, claimed to feature details from inside Oracle. It said the company was becoming a cloud company, competing with Salesforce, and 'Java has no interest to them anymore.' The subject line cited 'Java -- planned obsolescence.'"

"Oracle's "planned obsolescence" for Java" \- [https://jaxenter.com/oracle- and-javas-planned-obsolescence-1...](https://jaxenter.com/oracle-and-javas- planned-obsolescence-121144.html)

'Oracle is cutting back on Java EE...it[Oracle] does not want to allow other companies to help out on the Java platform. Proprietary product work will be done using the Java app server WebLogic, and there will also be a proprietary microservices platform. The email also dashes any hopes of Oracle collaborating on a 'Java foundation' with other companies, let alone ever relinquishing its 'ownership' of the Java platform.'

<comment><USER9> From what I hear the JVM still has a funded team at Oracle. It's Java EE that has been put in the fridge. See fi this article on the upcoming Graal vm: [https://medium.com/@octskyward/graal- truffle-134d8f28fb69#.9...](https://medium.com/@octskyward/graal- truffle-134d8f28fb69#.9tsd6xbs6)

<comment><USER10> Java EE is back. Oracle reversed course recently. I'm on mobile so I can't find the soyrce but if you browse /r/java you can read about it. They were thinking about killing EE for their own proprietary platform which backfired.

SE isn't going anywhere. Personally I'm a JVM developer but I really don't care too much about EE.

</comment></comment></comment><comment><USER11> Statically typed language vs dynamically typed language is always a large set of differences / compromises.

Java in 1999 was about as inexpressive as today's Go. The gap is narrower if you take today's Java 8.

</comment><comment><USER12> Or Oberon [http://www.jucs.org/jucs_4_5/open_standards_beyond_java/Fran...](http://www.jucs.org/jucs_4_5/open_standards_beyond_java/Franz_M.html) (1998).

The tech was released in 1996:

[http://www.modulaware.com/mdlt69.htm](http://www.modulaware.com/mdlt69.htm)

[https://github.com/Spirit-of-Oberon/Juice](https://github.com/Spirit-of- Oberon/Juice)

[https://github.com/berkus/Juice](https://github.com/berkus/Juice)

<comment><USER3> With your nickname I was expecting Modula-3. :)

<comment><USER12> Good point, though Juice was a direct answer to Java from a pupil of Wirth, so there's that.

It's funny that Franz was influential to both Brendan Eich (JS) and Andreas Gal (Tracing JIT) but we still got JavaScript as a language, even though Brendan cited[1] Oberon as an influence. At least we got tracing JITs and the alternative AST encoding from Franz's intellectual cloud. I would really like to understand how Bill Joy and Brendan Eich studied Oberon and we still got Java and JavaScript, which haunt us to this day like the industrial takeover by C in the 1980s does.

[1] [https://news.ycombinator.com/item?id=9733520](https://news.ycombinator.com/item?id=9733520)

<comment><USER13> Love your description of the C/Java regime as a coup d'etat.

Join the dynamic programming underground! :-) (Or at least use a static language that's not all jacked up)

<comment><USER3> C would never had taken over the computing world if AT&T had the freedom to sell UNIX and did so at the same price levels as the other OSes, instead of giving almost for free to universities as they decided to do.

Same thing with Java, it was available for free, just download and install with a JDK that was "batteries included" versus the chaos of trying to write portable code in C or C++ in the mid-90's.

</comment></comment></comment></comment></comment><comment><USER14> If one has serious interest in expert level Common Lisp code there is the Norvig's masterpiece _Paradigms of Artificial Intelligence Programming_ (PAIP) which is available form Amazon or torrents.

There is also the Common Lisp code from AIMA second edition.

PAIP and AIMA for CL is the same as SICP and old classic HtDP for Scheme. After mastering these one might consider oneself a programmer.)

</comment><comment><USER15> For me, it's a question of tooling.

I would love to see a Common Lisp expert do an entire book on Armed Bear Common Lisp (Common Lisp entirely on the JVM). Edi Weitz hinted at what might be possible in his book, Common Lisp Recipes, but only very superficially.

To me, the power of Common Lisp married to the ubiquity and library of the JVM is the great possible future for CL.

<comment><USER16> > For me, it's a question of tooling.

emacs & slime[1]

> I would love to see a Common Lisp expert do an entire book on Armed Bear > Common Lisp

I'm curious what you'd expect from such a book. There are some excellent books on CL in general and good libraries that provide a convenient layer over implementation specific things (e.g.: uiop or cl-fad). One usually does not think about a specific CL implementation when writing code - I'd even go as far as saying that targeting a specific implementation is usually a sign of bad coding style.

[1] [https://common-lisp.net/project/slime/](https://common- lisp.net/project/slime/)

<comment><USER15> > emacs & slime[1]

I've spent a lot of time with emacs, and slime was what I used when I was exploring Common Lisp: both SBCL and CLISP. Emacs is really powerful and I'm fairly at home with it, but I've come to prefer more graphical IDE's. Judging from the popularity of Eclipse, Visual Studio, NetBeans, etc...I'd say I'm not alone. Telling programmers it's emacs+slime or the highway is not a strength; it discourages everyone who prefers those other environments.

> I'd even go as far as saying that targeting a specific implementation is > usually a sign of bad coding style.

I was suggesting ABCL because it is a full implementation of CL on the JVM. If there are other CL's with ABCL's level of maturity on the JVM, then they would work just as well.

Beyond that, I imagine that many programming projects target specific implementations for various, pragmatic reasons.

<comment><USER17> What do the graphical environments gain you, in most cases? I'll not argue that they don't usually have better defaults configured. Autocomplete, in particular, typically works out of the box. These can work in emacs, though. (Even in vim, to be honest.)

Seems most of them "win" by having more effective advocacy than they do more effective features.

<comment><USER15> >What do the graphical environments gain you

Simplicity. In my IDE, I start it up and then program.

With emacs, it always felt like I spent a lot of time curating the editor. Part of that was because customizing emacs is fun--I have this big .emacs file that imports an even bigger .elisp file--but I also always seemed to be referring to some documentation because I'd forgotten that particular set of key-chords or messing with something to get it to work.

I've come to prefer simplicity. In fact, after years of using emacs, I switched to vim for the moments when I want to program on the command line. (I think my only customization in VIM is mapping jj to escape)

<comment><USER18> In case this helps anyone else, I've found that a better shortcut for me is Ctrl+[ , which actually maps to escape too. I too found having to tap escape to exit modes was annoying since I had to make my fingers leave the home row and there is no need to customize mapping in this case.

If you're used to hitting ctrl with your left pinky, which is necessary for us emacsers, then Ctrl+[ will be 100x better than hitting escape.

</comment></comment></comment></comment></comment></comment><comment><USER19> It's not a popular opinion. With all due respect to Norvig, I feel it was not a valid comparison. Java came out on 1996. Most people were not experienced in it and were still figuring out how best to use it at the time. The language and tooling were still immature. Lisp had been around for a long time then. And he was very good very experienced in lisp at the time. Plus he had the insight gained for the test afterward. So it is kind of expected to do well.

The greater variance between programmers than languages is very telling. It shows experience and competence trump language difference.

</comment><comment><USER20> Has Peter Norvig written about why Google went all in on java?

<comment><USER21> Did Google? Google is very much a polyglot orginization. [https://www.quora.com/Which-programming-languages-does- Googl...](https://www.quora.com/Which-programming-languages-does-Google-use- internally)

As for Android, Google Purchased Android Inc in 2005, and I'm pretty sure the decision to use Java came before Google's purchase.

<comment><USER3> It also helps that Android team has quite a few ex-Sun engineers that used to work on Java, so I imagine that they rather keep pushing it than anything else.

They are always quite clear that it is Java + C or C++ for native methods, regardless of what developers might wish for.

</comment></comment></comment><comment><USER22> It's the same old problem. Writing as little code as possible is a non-goal for a team of developers. Writing maintainable, easy-to-understand code is much much more important.

And while I value Lisp (I started on Allegro Common Lisp on Sun OS), it's density is also its greatest problem for any significantly large codebases.

</comment><comment><USER23> Has anyone produce compelling insights on what causes these productivity differentials?

<comment><USER24> Dunno, but note that the Lisp programmers in the study were self-selected from a call for volunteers on comp.lang.lisp (and maybe comp.lang.scheme, I don't remember). I suspect programmer skill mattered more than the choice of language. (I was one of the volunteers, so obviously I'm biased.)

Ron could've partly controlled for this by posting the same query on comp.lang.java -- of course it's still very hard to say how much bias would remain.

<comment><USER25> My guess also. I obviously could not resist and tried it in C#, took me 45 minutes but I admittedly did not bother to bring it to production quality. One could certainly spend another hour or even an entire day and optimize it in all kind of ways, from readability to performance. Also the available tools are certainly important - selecting and converting a couple of lines into a new method takes me less than five second or so with ReSharper, those things add up if you have to do it often enough.

</comment></comment></comment><comment><USER26> As a Schemer who hates Java, I only wish it was.</comment>


The science of optical illusions - <AUTHOR> http://www.bbc.co.uk/news/magazine-11553099

<comment><USER2> Some of this was covered by Dan Ariely in his TED talk on the "Predictably Irrational."

[http://www.ted.com/talks/dan_ariely_asks_are_we_in_control_o...](http://www.ted.com/talks/dan_ariely_asks_are_we_in_control_of_our_own_decisions.html)</comment>