Your family should have a shared two-factor authentication code

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

Your family should have a shared two-factor authentication code

“Hi mum. I’ve broken my phone - this is my new number. Can you save it please? xxx”

“嗨,妈妈。我的手机坏了——这是我的新号码。你能存一下吗?xxx”

Despite not being a parent, a surprising number of my imaginary children have suffered phone-related calamities recently. If you’re unfamiliar with the scam, that’s not my child. It’s someone enslaved in a call-centre who will impersonate a relative and gradually extract your money, banking details, or personal information.

尽管我并不是一位家长,但最近我那几个“虚构的孩子”却频繁遭遇与手机相关的灾难。如果你还不了解这种骗局,那其实根本不是我的孩子。这只是某个被困在呼叫中心的人,他们会冒充你的亲戚,并逐步套取你的钱财、银行信息或个人隐私。

When I was a schoolboy, I had it drilled into me that I was not to take a lift home from school with a stranger - even if they did claim to know my parents. No matter how convincing they were, how reputable they looked, or whether they offered sweets, I was to refuse to go with them.

当我还是个小学生时,父母就反复叮嘱我,绝对不能搭陌生人的顺风车回家——即使他们声称认识我的父母。无论他们表现得多么令人信服、看起来多么体面,或者是否用糖果诱惑,我都必须拒绝。

Unless they knew the family password!

除非他们知道家庭密码!

Yup, my family had a password. Only to be used in the direst emergencies! A phrase that even now - several decades later - is burned into my brain. But humans are unreliable and prone to forgetting. A stranger could eavesdrop on the password. A trusted friend might turn traitor. If only there was a better way.

没错,我们家确实有一个密码。它只在最紧急的情况下使用!即使几十年后的今天,那个短语依然深深烙印在我的脑海里。但人类是不可靠的,而且容易遗忘。陌生人可能会偷听到密码,值得信任的朋友也可能背叛。如果有一种更好的方法就好了。

Well, now we have that technology. The “Time-based One Time Passcode” is probably familiar to you. It’s that app that you have which shows a code which changes every 30 seconds. You know - this one:

好吧,现在我们有了这项技术。“基于时间的一次性密码”(TOTP)你可能很熟悉。就是你手机里那个每 30 秒变换一次代码的应用程序。你知道的,就是这个:

Anyone can create those codes. I’m going to show you how to use them to protect your family, how to generate the codes, and where it might go wrong.

任何人都可以创建这些代码。我将向你展示如何利用它们来保护你的家人,如何生成这些代码,以及在哪些环节可能会出错。

You can use any TOTP code generator you like. I’ve built one which runs in your browser and doesn’t send data to anyone. Gather your loved ones around a single laptop and point your browser at:

你可以使用任何你喜欢的 TOTP 代码生成器。我自己构建了一个可以在浏览器中运行的工具,它不会向任何人发送数据。让你的亲人们围在一台笔记本电脑前,打开浏览器访问:

https://edent.codeberg.page/Family-TOTP-QR-Generator/

https://edent.codeberg.page/Family-TOTP-QR-Generator/

Get everyone to scan the code using their normal authenticator app. Make sure all your apps show the exact same number on screen.

让每个人都使用他们常用的身份验证器应用程序扫描该二维码。确保所有人的应用程序屏幕上显示的数字完全一致。

You are Alice. You receive a call or text from someone claiming to be Bob.

假设你是爱丽丝(Alice)。你收到一个自称是鲍勃(Bob)的人打来的电话或发来的短信。

You don’t need to have one person read half the code and the other person read the rest of it. You could wait for the code to roll-over to the next one. But that takes time. Sure, an attacker has a 1-in-a-thousand chance to guess the correct code, but I think that’s an acceptable risk.

你不需要让一个人读出一半代码,另一个人读出剩下的一半。你可以等待代码跳转到下一个。但这需要时间。当然,攻击者有千分之一的概率猜中正确代码,但我认为这是一个可以接受的风险。

It’s very easy for a scammer to say “Yes, that’s the correct code” without knowing the actual code. This gives both family members confidence that they are speaking to someone they trust.

骗子很容易在不知道真实代码的情况下说“没错,这就是正确的代码”。这能让双方家庭成员确信他们正在与自己信任的人交谈。

This is in no way a foolproof system. There are five main failure modes.

这绝不是一个万无一失的系统。它主要存在五种失效模式。

If the device holding the code is stolen, unlocked, or hacked then an attacker can read out the correct code. You have verified the code, but not the person.

如果存储代码的设备被盗、解锁或被黑,攻击者就能读取正确的代码。你验证了代码,但没有验证对方的身份。

If someone is threatening one of the parties, they are likely to read out the correct code. You have verified the person but not their actions.

如果某一方受到威胁,他们很可能会读出正确的代码。你验证了对方的身份,但无法验证他们的行为是否出于自愿。

Often known as a Man In The Middle attack - someone could be sitting between Alice and Bob. Bob tells the middle-man the code, who passes it on to Alice. Then Alice tells the middle-man her code, who passes it on to Bob. Thus verified, the middle-man can now communicate with either without raising suspicion.

这通常被称为“中间人攻击”——有人可能坐在爱丽丝和鲍勃之间。鲍勃把代码告诉中间人,中间人再传给爱丽丝。然后爱丽丝把她的代码告诉中间人,中间人再传给鲍勃。通过这种验证,中间人现在可以与任何一方沟通而不引起怀疑。

One code shared by many people means any of those people can pretend to be each other. A brother can pretend to be a sister, for example. You could set up a separate code for every individual - but that might be a lot of work, especially in a large family.

多人共享一个代码意味着他们中的任何一个人都可以冒充对方。例如,兄弟可以冒充姐妹。你可以为每个人设置单独的代码,但这可能工作量巨大,尤其是在大家庭中。

How seriously you take those as possible threats depends very much on your risk profile.

你如何看待这些潜在威胁,很大程度上取决于你的风险承受能力。

The codes change every 30 seconds. Most phones keep reasonably good time - and most code apps will show the upcoming code. But there’s always a possibility that your two phones will be so out of sync that the code won’t validate. It’s fine to accept the previous or next code.

代码每 30 秒更换一次。大多数手机的时间都相当准确,大多数应用程序也会显示即将到来的代码。但总有可能出现两部手机时间不同步导致代码无法验证的情况。接受上一个或下一个代码是可以的。

There’s an option on my code generator to have 5 or 10 minute codes. Sadly, some security apps don’t support that - so check that all your family’s devices show the same code when registering.

我的代码生成器提供 5 分钟或 10 分钟有效期的选项。遗憾的是,一些安全应用程序不支持这一点,因此在注册时请务必检查所有家庭成员的设备是否显示相同的代码。

It is now easy to clone people’s voices using AI - how sure are you that you’d recognise a family member’s voice over a crackly phone line?

现在利用人工智能克隆人的声音非常容易——在嘈杂的电话线路中,你有多大把握能认出家人的声音?

Even video calls aren’t totally safe. A few years ago, several AI generated corporate executives were placed on a video call and used to convince an employee to transfer a vast sum of money.

即使是视频通话也不完全安全。几年前,几位由人工智能生成的企业高管出现在视频通话中,并成功说服一名员工转账了一大笔钱。

Hopefully you have enough in-jokes with your family to spot an impersonator, and I’m sure you’ve spent hours with your parents teaching them about scams, and - yes - this isn’t fool-proof. If someone genuinely has lost their phone, you’ll need another way to verify them.

希望你和家人之间有足够的“内部梗”来识别冒充者。我相信你已经花了很多时间教父母如何防范诈骗,而且——没错——这也不是万无一失的。如果某人真的丢了手机,你还需要其他方式来验证他们的身份。

Scams like the “Hi mum” one often target people who are overly trusting. It might feel weird to start off all conversations will a password check - but getting into the habit of regularly checking will help normalise it. Practice makes perfect. If you have elderly parents or easily distracted kids, you need to build this up as a habit. It isn’t just for emergencies; it needs to be normal.

像“嗨,妈妈”这样的骗局通常针对那些过于轻信的人。在所有对话开始前进行密码核对可能会让人觉得奇怪,但养成定期核对的习惯有助于将其常态化。熟能生巧。如果你有年迈的父母或容易分心的孩子,你需要将此培养成一种习惯。这不仅仅是为了应对紧急情况,它应该成为常态。

But I think it’s a relatively simple way to add an extra layer of protection to your family chats.

但我认为,这是一种为家庭聊天增加额外保护层的相对简单的方法。

Many thanks to my beta readers - Julia, Ryan, Phil, doop, Juliet, Dan, Sam, Brunelo, David, and some anonymous friends.

非常感谢我的内测读者们——Julia、Ryan、Phil、doop、Juliet、Dan、Sam、Brunelo、David 以及一些匿名的朋友。

Enjoyed this post? Show your support and pay the author.

喜欢这篇文章吗?请表达你的支持并向作者付费。

Your family should have a shared two-factor authentication code | Hacker News

你的家庭应该拥有一个共享的双重身份验证代码 | Hacker News

Reply | Reply to original comment on news.ycombinator.com 2026-11-29 14:50

回复 | 回复 news.ycombinator.com 上的原始评论 2026-11-29 14:50

I see that your blog post is under CC BY SA. I find your totp-qr-code-generator useful and want to deploy and style it on my own server. What license is your code?

我看到你的博客文章采用 CC BY SA 协议。我觉得你的 TOTP 二维码生成器很有用,想在自己的服务器上部署并修改样式。你的代码是什么许可证?

Reply 2026-11-29 14:52

回复 2026-11-29 14:52

The code is MIT - you can download it from https://codeberg.org/edent/Family-TOTP-QR-Generator

代码采用 MIT 许可证——你可以从 https://codeberg.org/edent/Family-TOTP-QR-Generator 下载。

Reply 2026-11-29 15:02

回复 2026-11-29 15:02

Cool. That’s my favorite license. Thanks, Simpel

太棒了。那是我最喜欢的许可证。 谢谢,Simpel

Reply 2026-11-29 15:27

回复 2026-11-29 15:27

Thanks… this is very useful. Following your instructions, may I just print out the QR code and have family members scan it (at some future time), or must we all be together and scan the QR code simultaneously in order to have our apps be synchronized? If we must be together is there another approach that you’d recommend for doing a on

谢谢……这非常有用。按照你的说明,我可以把二维码打印出来让家人们(在未来的某个时间)扫描吗?还是说我们必须聚在一起同时扫描二维码,才能让我们的应用程序同步?如果我们必须聚在一起,你是否推荐其他方法来完成……