diff options
author | tv <tv@krebsco.de> | 2021-01-03 15:27:06 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-01-03 15:49:25 +0100 |
commit | 9feb2a8b377205ff8ab0f947ee511ec1fde5b9e7 (patch) | |
tree | c80cae24d6c7a3cbd5f0634a5e48400657dd695d | |
parent | d3ed6d81900766ec53547623ac3e59a537fa2179 (diff) |
crxid: initial commitv1.0.0
Based on https://github.com/dsoprea/ChromeIdGenerator/blob/master/README.txt
-rwxr-xr-x | crxid | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#! /bin/sh +# Get CRX id from RSA key +# usage: crxid PEM_FILE + +set -efu + +pem_path=$1 + +digest=$( + openssl rsa -in "$pem_path" -pubout -outform der 2>/dev/null | + openssl dgst -sha256 -hex | + sed 's/^(stdin)= //;s/.*/\U&/' +) + +script=" + obase=16; + ibase=16; + ascii_a=61; + $(echo $digest | cut -b-32 | sed 's/./ascii_a + &;/g') +" + +echo "$script" | bc | xxd -r -p +echo |