neocotic / qrious

Pure JavaScript library for QR code generation using canvas
https://neocotic.com/qrious
Other
1.54k stars 214 forks source link

Order of secret & issuer generates different QR #109

Closed bshore closed 1 year ago

bshore commented 6 years ago

I've noticed that upon generating a new TOTP (for Google), the string occasionally switches the secret & issuer causing the QR generation to break (with qrious).

These generate two visibly different QR codes, and only one of them successfully scans.

Working with qrious: otpauth://totp/Company:name%domain.com?secret=2345ABCD6789EFGH&issuer=Company

Not Working with qrious: otpauth://totp/Company:name%domain.com?issuer=Company&secret=2345ABCD6789EFGH

There is no specific order listed here, just that they are query parameters. It does affect how the QR is drawn though.

edit: It was pointed out to me that 0 & 1 technically do not show up in RFC 4648 base32, so I adjusted the base32 example strings.

nayuki commented 6 years ago

Is this a problem with this QR code library, or is a problem with the input text you are giving to the library?