Google Chrome - Alphanumeric hashes to identify extensions

后端 未结 8 706
别那么骄傲
别那么骄傲 2020-11-29 02:17

Google Chrome is using alpha numeric hashes as identifiers for the Chrome extensions. For eg. \"ajpgkpeckebdhofmmjfgcjjiiejpodla\" is the identifier for XMarks Bookmark Sync

8条回答
  •  执笔经年
    2020-11-29 02:37

    Here is the easy way in bash (and openssl) to get the X.509 SubjectPublicKeyInfo block, DER-encoded:

    openssl rsa -pubout -outform DER < "$pem" > "$pub" 2>/dev/null
    

    Where $pem is the private key file, RSA encoded.

    To get the SHA256 Digest you need to run the following on the file resulting from the previous line:

    openssl dgst -sha256 $pub | awk '{print $2}' | cut -c 0-32
    

    All that remains is to take the resulting 32 char string and change it from regular hex ([0-9][a-f]) to ([a-p]) where a matches 0 and p matches f.

    With a bit of effort, I'm pretty sure these two steps could be made into a one-liner. I hope you find it helpful and if so, please let me know.

提交回复
热议问题