HNHacker News
TopNewBestAskShowJobs

KMag

6,898 karma · joined October 6, 2012

submissionscomments
KMag··on Modern-day spying: sometimes old technology is more secure
According to the Matt Blaze article, the Radio Havana numbers station sends 3 messages per hour. At the start of the transmission, three 5-digit message identifiers are sent for the 3 messages to be transmitted.

My guess is there's some cryptographic structure to these indicators that tells agents if the messages are for them, so they can shut down their listening early if none of the three messages are for them. If it were otherwise, I would expect each indicator group to be before (or inserted at a secret agent-specific offset within each message) each message. If you listen to the mp3 recording linked from Matt's article, you'll notice that the three indicator groups are repeated before the actual messages begin. Presumably the repetition is to guard against the indicator groups being garbled, since if the indicator group gets garbled, the whole message is garbled. On the other hand, a garbled regular message group would only result in a few characters of the plaintext being garbled.

Placing the indicator groups at constant (and secret) per-agent offsets within the messages has been known since at least WWII. In the case of an OTP, having a secret offset of the indicator group makes it harder to detect if the fatal error of pad reuse has been made. In the case of other ciphers, making the location of the indicator group secret also complicates cryptanalysis.

It wouldn't make sense to separate out the indicator groups like that unless it provides some operational advantage to offset the small cryptoanalytic toehold provided by highlighting the indicator groups. Allowing agents to shut down their listening early is the most obvious advantage I can think of.

The simplest cryptographic structure (and devoid of bias if the OTP is devoid of bias) would be to simply have the indicator group be the first 5-digit group for the next page in the OTP. The agent would need to check the next several pages of their OTP to verify they hadn't missed any messages. Encrypted headers within the messages could be used to handle the rare cases of collisions across agents, rather than introduce extra stucture (weaknesses!) to prevent any two agents from ever having duplicate indicator groups across their next few pages of OTP material.

Of course, it is also possible that these repeated indicator groups at the start of the transmission are just decoys and the real indicator groups are somehow hidden within the messages in some way that provides redundancy without revealing which groups are the indicator groups. Maybe the first three groups of the OTP page are placed at 3 constant offsets within the message or something.

But, my guess is that these repeated indicator groups at the start of the transmission really are there to let the agents know that they can shut down their listening early when there are no messages for them.

KMag··on Architectural cross-section of Kowloon Walled City
Yes, but it seems I mixed up some details between the disappearance of Gui Minhai and the disappearance of his colleague Lee Bo. Gui Minhai was last seen in Thailand who showed up on Chinese TV asking Sweden not to investigate, and Lee Bo is the one who went to deliver some books in the Chai Wan district of Hong Kong and was apparently kidnapped to the mainland.
KMag··on Architectural cross-section of Kowloon Walled City
Yes, in North Point, right over the Wellcome near the MTR station. It was also right near the pedestrian overpass to the Chun Yeung Street Wet Market. (The overpass was covered when I moved in, but one morning the homeless encampment on the bridge caught fire and damaged the roofing enough that the roofing was removed. I don't remember if the fire was before or after the protests.)
KMag··on Architectural cross-section of Kowloon Walled City
I lived there 2012 to 2021, and left my heart there. I'd likely still live there if I felt it were a better place to raise kids.

In the treaty between China and the UK handing over HK, the people were promised eventual universal suffrage for the Chief Executive (governor/mayor). The elections for Chief Executive are held every 5 years, and there are protests every 5 years asking for universal suffrage. In 2014, there were tents on the main roads, and students making makeshift barricades, a small number of people being beaten and/or pepper sprayed by police.

The protests in 2019 were very different. It looked crazy on television, but in person it actually wasn't very scary. I lived in a neighborhood with a lot of immigrants from Fujian province who got in a big brawl with protesters half a block from my flat. Unfortunately, some subway stations and a few shops were burned, but it wasn't random arson. The subway company is majority-owned by the government, and police were using stations as makeshift police stations. The businesses that got burned had owners with large business interests in the mainland and had spoken out against protesters. That's not to say the arson was justified, but I was never worried someone would torch my building.

Though, as an obvious Westerner, any protester would have assumed that I supported at least peaceful protest for democracy. On the other hand, with all of the propaganda/rumors saying all of the protesters were organized and paid by the CIA, I was careful not to do anything that would feed into that. I had a strong sense that as long as I minded my own business, both the police and the protesters would likely leave me alone.

In 2019, a journalist was charged with misuse of a police database because they looked up the license plate of a van that dropped off a bunch of triad thugs to beat up protesters in a subway station. The journalist discovered the van belonged to a pro-mainland politician.

Also, sometime around the 2019 protests (a bit earlier, if I remember), there was a dual-citizen bookstore owner in Causeway Bay who published a book about Xi's mistresses . He disappeared. His wife didn't know where he was. The Hong Kong government had no record of his having crossed passport control at any airport, pier, or land crossing with mainland China. A bit later, he showed up in the mainland to give a televised statement that he had gone to the mainland of his own free will to confess to a DUI case several years prior, and asking his second country (Sweden or Switzerland, I forget) to stop investigating his disappearance. Absolutely nothing fishy about that. (As I remember, the bookstore had 5 owners, and at least 4 of them had similar legal troubles. I believe only the one had an unexplainable border crossing into the mainland.)

2024 is another election year. I worry a bit what will happen, but I get the feeling the government has finally broken the will of the protesters.

KMag··on Architectural cross-section of Kowloon Walled City
Not just the Kowloon Walled City, but other locations in Hong Kong inspire lots of cyberpunk scenes. After living in Hong Kong for a few years, I re-watched Ghost in the Shell and was surprised to recognize the final scene as taking place under the circular pedestrian overpass on Queens Road, just east of Victoria Park.
KMag··on Architectural cross-section of Kowloon Walled City
Note that the walled city is just a small part of Kowloon district. The famous Kai Tak Airport was also in Kowloon (now converted into an event space), where airliners flew scarily close to buildings on final approach.

I lived in Hong Kong just under 10 years, and a friend of a friend grew up in the walled city.

KMag··on The 'pay phone bandit' who baffled the FBI in the '80s
My multiple experiences with ChatGPT hallucination, even at minimum temperature, leaves me preferring a web search answer. Just last week, jq hallucinated three different jq syntaxes that failed to parse.

That being said, I had been using web search for several years looking for the Get Smart episode I had seen as a kid in the 1980s where the enemy agent explains that he can't give up his suicide ring because "That's how it works, if I take it off, my wife will kill me." Google Bard found the episode on the first try.

So, I tend to fall back to LLMs only when search engines fail me.

KMag··on It's getting harder to die
Granted death penalty opponents are biased, but it's often said that barbituate overdose is a very unpleasant way to die. I've also heard opiod overdose is unpleasant.

I was once helping take down a 10-foot weather balloon full of helium, and took in two breaths in a row of pure helium. I started to get tunnel vision, said "whoah", sat down when I realized I was about to lose consciousness, fell down, and twitched just long enough for my friend to realize I wasn't joking around before I woke up. From my experience, hypoxia from pure helium is slightly pleasant all the way to loss of consciousness. I presume pure nitrogen would be nearly the same.

Let my last words be something witty in a high-pitched helium voice.

(Side note: pure nitrogen hypoxia would not be a particularly humane form of execution because the condemned would likely fight it by holding on to their last breath.)

KMag··on For the record: You just ordered me to cause a expensive outage
> The funny thing is that equipment wasn't even mine,

Did you have a reputation for being good at debugging things? Expertise and experience in one area often has crossover in connected systems.

I got pulled in to advise on an automated options market making system written in Java when the closest I'd done was equity execution algorithms in Slang and C++ (and integration with the options automated delta hedging facility).

KMag··on More Memory Safety for Let's Encrypt: Deploying ntpd-rs
You'd probably want an alternative libc implementation rather than a compiler flag.

However, calloc everywhere won't save you from smashing the stack or pointer type confusion (a common source of JavaScript exploits). Very rarely is leftover data from freed memory the source of an exploit.

KMag··on Forebruary
More likely, it goes back to the origins of our 7-day week. The ancient Romans had an 8-day week. Our 7-day week comes from the Jewish calendar, where supposedly the world was created on a Sunday, and the final day of the week is the Jewish Shabbat on Saturday. (Though, we didn't keep the Jewish calendar's notion that days start at sunset.)

I suspect that if you go back far enough, most of Europe considered the week to begin on Sunday, but I have no idea how far you'd have to go back.

KMag··on Farmed salmon leads to loss of nutrients, instead eat 'feed fishes' directly
You'd be hard pressed to find anything absolutely toxin-free. Many toxins have non-linear effects, negligible at very low doses, so there are advantages to diversification.

Even if you could find a handful of foods that are absolutely toxin-free, eating only those would greatly reduce the diversity in your diet.

The obvious optimum is a diet minimal in the effect-weighted sum of its toxins, subject to the constraint of also providing healthy levels of all essential nutrients... which the GP is attempting to reasonably approximate without requiring years of research into the exact diet by proposing toxin risk diversification.

KMag··on Meta outage
The heavy lifting is done by GPG in a subprocess, taking information on stdin or outputting the decrypted data on stdout. The rest is just generating the passwords, organizing the encrypted files, and perhaps interacting with the clipboard.

Have a look at https://www.passwordstore.org/ and also https://github.com/kmag/store_password_gpg

KMag··on Array languages vs. the curse of the spreadsheet
20 years ago, I was told there was such a beast for turning an Excel spreadsheet into a C# application, targeted at accelerating/productionizing financial models. I never used it, though.
KMag··on Meta outage
Yea, the wife came to me in a bit of a panic that her Facebook account got hacked. I tried logging in to FB to check if I had been unfriended, and I also got errors indicating my password was incorrect. My FB password is 96 bits from /dev/urandom in a GPG-based password manager I wrote for myself a couple decades ago. So, no my password wasn't wrong, and I'm not a big enough target for someone to put enough effort into figuring out how to snarf up my password data and crack my GPG passphrase.

Anyway, when FB thought my password was wrong I calmed way down. I thought maybe FB corrupted their password DB or something, so I just tried to reset my password, got into an odd workflow loop, and then quacked "downdetector facebook".

KMag··on The Black-Scholes/Merton equation [video]
One thing that seems not widely understood is that the assumption of normal or log-normal distributions in stochastic calculus is like the assumption of linearity in most engineering fields. It's known to be incorrect, but you can do a heck of a lot with piecewise-linear model. Similarly, using a normal or log-normal assumption within a range of parameters (such as the volatility smile) is really useful.

Part of the reason a Gaussian distribution is used so much is that you need a stable distribution if you want to be able to perform algebra on your random variables. The variance of the Cauchy distribution is undefined and the variance of the Levy distribution is infinite, so Gaussian is really the go-to distribution.

KMag··on Better PC cooling with Python and Grafana
Honestly, the fan should ramp up to maximum speed if not explicitly set within the past 500 ms or something, and also have a high-water mark temperature that if crossed while the fan isn't at maximum speed causes the fan to run at maximum speed until the machine restarts.

If the OS can't keep up with the fan speed update schedule, go into your failsafe mode.

If you cross that maximum temperature while being commanded by the OS to run at maximum speed, then that's presumably not an OS bug. If otherwise, treat it as an OS bug and put the OS back into diapers, to re-try the big kid underwear on the next restart.

KMag··on Using a solar oven as a radiant refrigerator at night
But, it might be possible to have a material that has different characteristics at different temperatures, as long as it's symmetric. If it's nearly opaque to IR in its cold state, hopefully sunlight at dawn would warm it rapidly enough that it would automatically "shut off" on cold nights, and still "turn on" shortly after dawn even on cold days.
KMag··on Rewrite the VP9 codec library in Rust
I think you mean x <= 4, right?
KMag··on A bad day at the office
> You can take any high voltage power line and a metal plate and power a blinking light just by getting close to it!

Well, for high-voltage DC transmission lines (typically used for longer distances to minimize induction loss), you'd presumably need to try to power them via current leaking to the air instead of induction. I'm not sure how feasible that is.

KMag··on High Interest Savings Leaderboard
The short answer is that if you could answer that question in advance to a high accuracy, you could make billions as bond trader. In theory, you get paid similarly to regularly going out into the bond market and buying US government bonds that expire in the next few months, but with a potential tax savings twist. (I am a random Internet dude, not a tax lawyer.)

The returns supposedly track the short end of the yield curve on US Treasuries. That would make sense, as theoretically, the net premium of a box spread is equal to the net present value of the payout (under the no arbitrage assumption). That net present value should be very close to the yield on a zero-risk asset over the same time period. They're using 1 to 3 month options, so in theory, they get yield close to short-term US Treasuries (the market prices a near-zero probability of the US defaulting on its bonds in the next few months).

I haven't looked into the tracking error between SPY box spreads and the short end of the US yield curve. https://en.wikipedia.org/wiki/Box_spread#cite_note-2 says the yield averages about 0.35% above holding equivalent maturity US Treasuries.

Though, it sounds like they're using box spreads composed of American options, so I wonder how they deal with early exercise risk. You only get bond-like performance from a box spread if you don't have early-exercise risk. The further out of the money they place their strikes in the box spread to avoid early exercise risk, the lower the liquidity they get, and higher trading costs.

The tax trick is that they also enter into a delta-neutral trade on a high-value single stock. (They don't use and index for this part because they want the difference between the winning and losing parts of this trade to be as large as possible, so they want volatility in the underlying asset.) At certain points, they realize the losses on the losing half of that trade (reducing tax liability), and perform a tax-free in-kind exchange of units (shares) in their ETF for the winning half of that trade. Of course, they don't know in advance which half will win and which will lose, but it doesn't matter. The brokerage buying their ETF in order to make the tax-free exchange bumps up the price of the ETF, very close to the value of the winning leg of the tax-saving trade.

Note the several caveats above (and probably some I missed) in comparing with US Treasuries yield.

This is not investment or tax advice.

KMag··on Memory Renaming: Fast and Accurate Processing of Memory Communication (1999) [pdf]
The basic idea here is to use unused physical registers in a register-renaming processor as a level-0 cache. I imagine this is much easier to get good performance out of this technique on architectures with weaker memory models than x86.
KMag··on Satya Nadella uses an IBM AS/400 in 1993
... and AoT-compiled at installation time! We didn't get this in mainstream software until Android Runtime started AoT-compiling Dalvik bytecode. As I've mentioned elsewhere, Android Runtime shows that AoT compilation doesn't prevent you from dynamically re-optimizing your binaries based on profiling feedback.
KMag··on Satya Nadella uses an IBM AS/400 in 1993
I was surprised Sun/Oracle's JVM (or Apple, after their 3rd architecture migration) never took a page from AS/400's TIMI (Technology Independent Machine Interface) and compile an architecture-independent representation to native code at installation time.

As the Android Runtime later demonstrated, nothing prevents you from distributing an architecture-independent representation, AoT-compiling to native code at installation time, instrumenting the native code, and then re-optimizing at runtime and/or in a background batch process if your instrumentation statistics deviate substantially from what was available the last time you re-optimized.

Apart from the extra disk space for both bytecode and native representations, something like TIMI allows for the best of both worlds as far as AoT and JIT. (It's also nice that TIMI doesn't require a garbage collector to be running.)

I'm not aware of modern AS/400 dynamically re-optimizing binaries, but doing so wouldn't break anything. Given the conservative nature of mainframe users, I imagine dynamic re-compilation would need to be an opt-in feature.

KMag··on Why do military personnel wear watches upside down?
When I was young, we had kind of a surrogate grandmother who was a retired nurse anesthetist. She told us stories of the old days counting the pulse of patients, holding an eye dropper full of chloroform to add to the gauze mask over the patient's face when the pulse got too fast.

If she had too many cases close to the end of her shift, she'd have to drive home buzzed on chloroform fumes.

KMag··on British intelligence able to read and flag private Snapchat messages
It's conjectured, but not proven, that there is no efficient algorithm on classical computers to compute discrete logarithms over elliptic curves.
KMag··on British intelligence able to read and flag private Snapchat messages
I totally agree that joint failures by the British and Spanish government shouldn't be paid for by the victim. I'm just saying that there isn't any evidence that British intelligence asked for any restitution. I think they screwed up, know it, and are keeping quiet.

The Spanish prosecutors, on the other hand... shame on them for having the nerve to continue prosecution, particularly after Spanish law enforcement subjected the victim to time in jail.

KMag··on British intelligence able to read and flag private Snapchat messages
That's a great statement. DDG seems to think you came up with it. Is that so?

Thank goodness I'm not inebriated near an all-night tattoo parlor.

KMag··on British intelligence able to read and flag private Snapchat messages
Who is the "We" in "We messed up" here?

Presumably, the "We" is British intelligence, but it's Spanish prosecutors that were asking for the kid to reimburse the Spanish government for the cost of scrambling the fighter jet.

KMag··on Abandoned villages of Hong Kong
I'm not sure about adverse possession, but my understanding is that the church behind Cheung Kong Centre is the only place in Hong Kong that privately owns land rather than leasing land from the government for 99 years. It would be better to sort out efficient use of land before the leases need renewal, but at least there's a mechanism to reclaim truly unused land.
← PreviousPage 2 of 34Next →