From 0be5b68398015f00a3eb69130a423a21f33c0aa0 Mon Sep 17 00:00:00 2001 From: Chad Spensky Date: Wed, 13 Aug 2025 17:16:16 -0500 Subject: [PATCH 1/3] Condensing everytihng into one script that opens the images for you --- gen-qr-codes.sh | 9 --------- index.js | 4 ++-- install_dependencies.sh | 2 ++ otp-codes.sh | 10 ++++++++-- 4 files changed, 12 insertions(+), 13 deletions(-) delete mode 100755 gen-qr-codes.sh create mode 100644 install_dependencies.sh diff --git a/gen-qr-codes.sh b/gen-qr-codes.sh deleted file mode 100755 index dd07bba..0000000 --- a/gen-qr-codes.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -counter=0 - -for x in `cat urls.txt` -do - qrencode -s 10 "$x" -o qr$counter.png - ((counter++)) -done diff --git a/index.js b/index.js index beff8d7..c85ab3d 100644 --- a/index.js +++ b/index.js @@ -22,8 +22,8 @@ async function printOTPCodes(otpBuffer) { for(let i = 0; i < otpArray.length; i++) { const otp = otpArray[i]; console.log("otpauth://totp/" + - (otp.issuer == undefined ? "" : otp.issuer) + - ":" + otp.name + + (otp.issuer == undefined ? "" : encodeURIComponent(otp.issuer)) + + ":" + encodeURIComponent(otp.name) + "?secret=" + base32.encode(otp.secret)) } } diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100644 index 0000000..e19907b --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sudo apt-get -y install qrencode zbar-tools feh diff --git a/otp-codes.sh b/otp-codes.sh index e0e2822..7917659 100755 --- a/otp-codes.sh +++ b/otp-codes.sh @@ -3,6 +3,12 @@ # Decode all the QR codes given on the command line for qrfile in "$@"; do qrcode="$(zbarimg -q --raw "$qrfile" 2>/dev/null)" - url="${qrcode/#QR-Code:}" - node index.js "$url" + mainurl="${qrcode/#QR-Code:}" + urls=$(node index.js "$mainurl") + for url in $urls; do + echo "Generating image for URI: $url" + qrencode -s 10 "$url" -o /tmp/qr_allthenticator.png + feh /tmp/qr_allthenticator.png + rm /tmp/qr_allthenticator.png + done done From 639e48c43abec07d5b967dfb4e061587dbbfddf1 Mon Sep 17 00:00:00 2001 From: Chad Spensky Date: Wed, 13 Aug 2025 17:21:28 -0500 Subject: [PATCH 2/3] updating readme --- Readme.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Readme.md b/Readme.md index 8f2a4d3..3490869 100644 --- a/Readme.md +++ b/Readme.md @@ -37,8 +37,18 @@ javascript, but it didn't work straight out the box so I didn't bother spending ## Usage 1. Clone this Git repository -2. Make `otp-codes.sh` and `gen-qr-codes.sh` executable: `chmod +x *.sh` -3. Extract codes `./otp-codes.sh ... > urls.txt` -4. Encode all the images to QR codes `./gen-qr-codes.sh` -5. Import each code, one by one, using ALLthenticator's user interface -6. DELETE `urls.txt` and each generated qr code file. These files contain your secrets and MUST NOT be kept. \ No newline at end of file +2. Install dependencies +```bash +./install_dependencies.sh +``` +3. Install node packages +``` +npm i +``` +4. Take a screenshot of your exported QR code from Google Authenticator +5. Extract codes, which will be automatically displayed and scan them with the Allthenticator +```bash +./otp-codes.sh +``` + Press `ESC` to advance each picture +6. Import each code, one by one, using ALLthenticator's user interface From d80e4a72982bac671af5b128701a4092eea0cb8a Mon Sep 17 00:00:00 2001 From: Chad Spensky Date: Wed, 13 Aug 2025 17:23:10 -0500 Subject: [PATCH 3/3] Update Readme.md --- Readme.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 3490869..d92e51b 100644 --- a/Readme.md +++ b/Readme.md @@ -45,10 +45,11 @@ javascript, but it didn't work straight out the box so I didn't bother spending ``` npm i ``` -4. Take a screenshot of your exported QR code from Google Authenticator +4. Take a screenshot of your exported QR code from Google Authenticator and save it to your disk 5. Extract codes, which will be automatically displayed and scan them with the Allthenticator ```bash ./otp-codes.sh ``` - Press `ESC` to advance each picture 6. Import each code, one by one, using ALLthenticator's user interface + - Press `ESC` to advance each picture +7. DELETE your screenshot! That is your secrets!