Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ 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 <path to qr-code image 1> <path to qr-code image 2> <path to qr-code image 3> ... > 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.
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 and save it to your disk
5. Extract codes, which will be automatically displayed and scan them with the Allthenticator
```bash
./otp-codes.sh <path to screenshot>
```
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!
9 changes: 0 additions & 9 deletions gen-qr-codes.sh

This file was deleted.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
Expand Down
2 changes: 2 additions & 0 deletions install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
sudo apt-get -y install qrencode zbar-tools feh
10 changes: 8 additions & 2 deletions otp-codes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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