The easiest strategy, of course, is to simply use gpg to generate a key and
check its fingerprint until you get the one you need (see batch mode).
Generation of an RSA 2048 key is taking around a second, so e.g. for your
example #1 (four bytes fixed) we are talking tens of hours or ones of days.

In case you need something better, you’ll have to get inside the public key
packet. Basically, fingerprint is a hash of the actual public key material
and its creation timestamp, so if you do not care much about creation
timestamps, you can bruteforce _them_, which will be much faster. This way
you might get a timestamp that doesn’t make sense (e.g. in the future) and
some implementations can potentially become upset, so you either accept
that or choose timestamps carefully.

If you don’t need the key to actually work, that is, be able to
encrypt/decrypt, then you can safely brute force its other parameters, such
as p, q and e.

I do not know if there are tools around, but hacking GnuPG code should not
be too difficult.

On Mon, Jun 19, 2017 at 6:44 AM Long Si <longsi0...@gmail.com> wrote:

> Hi
>
> I am on Linux, and would like to generate a key with "unique 40"
> fingerprint.
>
> eg 1: Starts with ABCD XXXX ... XXXX
>
> eg 2: Starts with AXXX XXXX ... XXXA ends with A
>
> eg 3: XXXX ... XXXX without any '0' character at all
>
> How would I go about writing such a script? Don't mind running for
> months to get these sets.
>
> Regards
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>
_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to