TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Decrypting Blind's Encrypted API

109 pointsby jonlucaabout 5 years ago

6 comments

kccqzyabout 5 years ago
This is yet another reminder that good JS minification tools exist that can absolutely change object properties into short minimal strings instead of descriptive names. It&#x27;s called the Closure Compiler in advanced mode. You do have to have quite a bit of discipline in writing the JS to have that though. Some languages like ClojureScript actually do this by default, so it doesn&#x27;t take much effort.<p>Also it helps if you don&#x27;t have to use objects (with keys) to transfer data. What I mean is that there&#x27;s little reason to use<p><pre><code> { &quot;alias&quot;: &quot;b6WJEDTp&quot;, &quot;member_nickname&quot;: &quot;faRw33&quot;, &quot;created_at&quot;: &quot;4d&quot;, &quot;is_auth&quot;: &quot;Y&quot;, &quot;board_id&quot;: 114961, &lt;snip&gt; </code></pre> when you instead can use a simple array<p><pre><code> [ &quot;b6WJEDTp&quot;, &quot;faRw33&quot;, &quot;4d&quot;, &quot;Y&quot;, 114961, &lt;snip&gt; </code></pre> if you have some post-processing to transform array indices into object keys.<p>Both of these approaches also cut down on the amount of data transferred over the wire, so it saves data and helps speed up the site for users too.
评论 #22651102 未加载
评论 #22653650 未加载
jiofihabout 5 years ago
Is there any point in encrypting API payloads when the traffic is going via TLS?
评论 #22649821 未加载
评论 #22651695 未加载
评论 #22650318 未加载
评论 #22650098 未加载
评论 #22650708 未加载
评论 #22652484 未加载
eralpsabout 5 years ago
Nice article! I always wonder what the legal aspects of publishing a reverse engineering article for a private API are? Does the company that the API belongs to have rights to an obligatory take down request?
评论 #22650973 未加载
bowmessageabout 5 years ago
I&#x27;ve gone through this same exercise in the past in order to mass-delete a large number of comments on different threads. I was afraid that Blind may one day suffer a data leak. I attempted to reroll the crypto in Ruby, but ultimately failed and went the JS route, same as the author. I also had to roll my own sesion-token refresh logic. Finally I was wondering if any kind of data mining could be done with the tool, but I never took it that far. Thanks for the writeup!
评论 #22650592 未加载
tomsmedingabout 5 years ago
So, they used asymmetric encryption for the request so that a MITM can&#x27;t read that, but they used symmetric encryption for the response. Though it requires a MITM to fully analyse the code, it allows a MITM to decrypt any response. Cited possible reason (in the conclusion) is performance.<p>I think you don&#x27;t have to resort to symmetric encryption here, even keeping performance in mind. What you do is generate a new asymmetric keypair on the client for every session, then send the public key over to the server. Then the server encrypts every response with that public key, allowing only the client to decrypt it.<p>Doing that, one can only read a session&#x27;s network traffic, both ways, if they can read values of variables on the client -- but if one can do that, you can read everything anyway. ;)<p>EDIT: forgot to talk about performance -- you just use a so-called &quot;envelope&quot;, where the sending party first encrypts the data symmetrically with a randomly generated key, then encrypts that random key with the asymmetric crypto. The pair (symmetrically encrypted data and the asymmetrically encrypted key) is sent to the receiver, which can use its private key to decrypt the symmetric key, with which it decrypts the data.
zaptttabout 5 years ago
the sad state of web developers.<p>from the silly comments of &quot;infinite scrolling&quot; being definitive proof of a solid rest api behind and that php is or is not capable of either (the writing is too ambiguous). to the roundabout amateur obfuscation (the author calls encryption) that is entirely akin to the JavaScript that disabled right click to &quot;copyright&quot; the page&#x27;s content in the 90s.<p>sigh
评论 #22661761 未加载
评论 #22654464 未加载