Generate Known PEM
This Node.js script generates RSA key-pairs in PEM format, then selects those which map to a Chromium extension ID with a specified prefix and/or suffix.
Run node generate-known-pem.module.js
to see the options.
For example:
Run node generate-known-pem.module.js --prefix=mega --n=3
to generate three PEM files starting with "mega".
If you've worked with browser extensions on Chromium-based browsers such as Chrome or Edge, you will be accustomed to seeing long meaningless IDs like:
- cjpalhdlnbpafiamejdnhcphjbkeiagm - uBlock Origin
- fnplhdldnhaodknidfddmkfdhlhjihpd - Scientific Calculator
- cdnapgfjopgaggbmfgbiinmmbdcglnam - Open Dyslexic
This script allows you to choose the first few characters of the ID, giving you something more friendly like:
- blockhdlnbpafiamejdnhcphjbkeiagm
- calchdldnhaodknidfddmkfdhlhjihpd
- opendgfjopgaggbmfgbiinmmbdcglnam
The characters are based on hexadecimal 0-F, but mapped to A-P:
- 0123456789abcdef - before
- abcdefghijklmnop - after
The script generates random RSA key-pairs, then derives the Extension ID that each one would create. If the derived ID matches the sought pattern, it is saved to a .pem file.
Yes; this is written as a Node.js module, so you can just import it.
On my PC, timings are as follows:
- 1 known letter: 5 seconds
- 2 known letters: 2 minutes
- 3 known letters: 15 minutes
- 4 known letters: 2 hours
- 5 known letters: 36 hours
- 6 known letters: 1 month
Generating RSA keys is slow by nature; and there is no way of knowing in advance what the ID will be.
Yes, by running multiple instances in parallel.
Unlikely. The bottleneck is in generating the RSA key-pairs, and most of these tools use the same underlying operating system calls (e.g. the Win32 CryptGenKey function on Windows).
See project https://www.npmjs.com/package/crx
You can't. These PEM files are only suitable for extensions distributed via Enterprise Policy or sideloaded via an installer.
See my other project https://github.com/andrewpmontgomery/chrome-extension-store
Raise an issue in Github, or email my GitHub username at gmail .com