(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=44034329

这个Hacker News帖子讨论了一个生成WireGuard个性化密钥的工具,该工具可以自定义公钥的开头部分。一位用户分享了一个用于SSH密钥的类似工具。评论者们就个性化密钥的安全性问题展开了辩论,一些人认为它不会降低熵,因为它只影响公钥。一位用户描述了一种通过操作Base64字符集将ASCII艺术嵌入GPG密钥的技术,这种方法不会破坏密钥的功能。讨论还涉及到GPG密钥中使用的32位Unix纪元值以及缺乏2038年问题解决方案。一位用户表达了对Windows上ARM64应用程序构建的赞赏,并将其与Discord的性能进行了对比。讨论中提到了性能方面的考虑,包括GPU加速个性化密钥生成的可能性。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
WireGuard vanity keygen (github.com/axllent)
103 points by simonpure 1 day ago | hide | past | favorite | 24 comments










I used a similar tool[0] for my SSH key to get a nice suffix to spot it easily.

[0]: https://github.com/danielewood/vanityssh-go



Reminds me of people where I worked having vanity GPG key ids. I'm wondering how much CPU time and on what machines it took to find them.


For vanity GPG keys, I came up with a neat trick where you could insert arbitrary ASCII art into your key. You construct your ASCII art using the Base64 character set. The decoded binary will be gibberish but you can place it in an inert Literal Data Packet that will be ignored by any conformant OpenPGP parser. It just takes a little finagling to align your data to a 3-byte boundary with appropriate line wrapping.


Key IDs are based on fingerprints and fingerprints are calculated by SHA-1 hashing the primary key's public key and the creation timestamp. A computationally easy way to influence the fingerprint is to tweak the creation timestamp which is a 32 bit Unix epoch value. Of course it needs to be in the past so the range is limited but it's faster to do it this way instead of recomputing the cryptographic key.


> the creation timestamp which is a 32 bit Unix epoch value.

GPG keys aren't 2038-safe?



It's a 32-bit unsigned integer, so that should give us until Feb 2106.

> A time field is an unsigned 4-octet number containing the number of seconds elapsed since midnight, 1 January 1970 UTC.



PGP is pretty old at this point, and kinda jank.

RFC 1991 only gives them 4 bytes (32bit); not sure if there have been any later additions to rectify this but I don’t think so since even the latest RFC (9580) has them listed as 4 bytes…

https://datatracker.ietf.org/doc/html/rfc1991

https://www.rfc-editor.org/rfc/rfc9580#section-3.5



I love that the app has ARM64 builds for Windows. I use a Windows ARM64 laptop daily, and every native ARM64 build I come across brings me joy.

Take note, Discord.



> Take note, Discord.

I highly recommend Legcord[1] - it's a alternative, open-source client that has very good ARM builds

1. https://legcord.app/



It’s funny (and annoying) the disparity between Arm builds for macOS and Windows. I understand why it happens but even Microsoft has produced Arm native versions of apps for macOS before Windows.


Discord? Why use the native app instead of just the browser version? Use e.g. Ferdium (https://ferdium.org/) to have all your messaging apps in one place.


Because that way you have everything under one electron app that is maintained by one person.


How do you keep the browser version "in tray"?


Discord is the worst app on Windows ARM64 right now. Even win32 games run better and faster it's crazy.


Given a situation in which you have a decent way to guess user names, such as ‘first-initial-lastname’ how much entropy does this take away?

It seems like I’ve seen several of these over the years when a patch to parse comments would probably be simpler and less of an anti-pattern. What am I missing here?

Edit: or a config dir that allows multiple key files.



I’m not a crypto expert at all, but surely it takes away no entropy because the fixed prefix is on the public key not the private key?

My reasoning is that the full public key could be seen as a 256 bit fixed prefix, but knowing the public key is meant to give no information about the private key by design.



That may be true, but I don't think that it is obviously so.

If it were, then public keys could be shorter by the same amount and still provide the same level of protection.

But by design they are not.



I still think my reasoning holds.

Let's say that I magically manage to find a private key whose public key has a chosen prefix that is the entire length of the key - i.e. the entire key is vanity. Something like myveryveryveryverylongvanitypublickey. Is that equivalent to a 0 length public key in terms of security? I'd say obviously not - there is still no way to get started when it comes to finding the private key.



Setup my first WG server last month. WG key gen obligingly put an f-bomb by the front of the key. "You're welcome" I said. True story.


I'd like to see mentions/confirmation that it has top-notch randomness so that nobody else can come up with the same keys.


Would this run faster on a gpu?


Yes, I've generated crypto wallet vanity keys on GPUs (OpenCL) and I'd say it's about 10-20x faster than a CPU depending on which kind of key and how the code's written.


[flagged]



No you didn't


Sure, he did.






Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com