An apparent discrepancy


Status
Not open for further replies.

RobJ

New member
Nov 5, 2019
4
1
First, I'm new here, and perfectly willing to admit I may have made a mistake, and I'm willing to learn from you. I have not yet used my new SQRL identity, in case a developer would like a closer look at it.

A week ago, I downloaded Steve's Windows SQRL client, and created an identity, and printed out the rescue code and identity. The textual form of the identity consists of 5 lines of 5 groups of 4 alphanumerics, plus 1 more group of 4 plus a remainder of less than 4 characters, specifically in my case "R24". So that's 26 4's plus "R24". On my new android phone, I downloaded and installed from the Google Play store Daniel Persson's "SQRL Login" app, and attempted to import the identity. But each time I try to scan the Qrcode, it displays the textual identity with a discrepancy in the last group. The Import display begins with a note that says I've successfully scanned my secure identity, and that I should "verify that the rescue data presented below corresponds to the data printed on your key page." The first 26 4's appear to be exactly identical, but the remainder group is "Rh", not "R24". I've repeated this multiple times, with no change.

I was unable to find a note anywhere explaining away this possible discrepancy. It is 2 separate differences - an "h" instead of a "2" in position 105, and more importantly a different length (106 vs. 107). I hesitate to proceed further without assurance this is fine.
 

Jaap

Well-known member
May 20, 2018
123
14
This is not fine.
Please check the QR code by re-scanning it with Steve's Windows SQRL client and/or another SQRL client.
Does that work ok?
 

PHolder

Well-known member
May 19, 2018
1,225
205
The Android app had some changes recently in the textual representation. I'm not sure if those are already published or not, but I thought they were. You didn't mention which version of the Android app you have, in case it's not up to date. I believe this is the zero padding issue still, which I thought @kalaspuffar had licked, finally, but perhaps not.

Since I assume you've only used it here, if you're willing to start over, then you could dissociate your identity, and create a new one to associate, and share your old one here. (Yes I realize this is a major pain, but it's really hard to investigate something like this from just a description of the problem but no hard data.) If you are willing, then this identity will likely become part of a unit test case to make sure the fix sticks around.
 

RobJ

New member
Nov 5, 2019
4
1
Thank you both for responding so quickly. I have not been able to find another app or client or extension with a way to scan the qrcode. (I'm sorry if I missed the feature.) I added the Chrome extension to my Vivaldi browser, but don't see a way to scan with it either.

Current versions:
- Windows client v1.0.7098.1
- Android app v1.5.0
- Chrome extension v0.0.55

Using the Android app to scan the key page on paper produces the same output as scanning the displayed qrcode from the Windows client (*Rh instead of paper listing of *R24). I've attached the qrcode (poorly imaged but does scan). As I haven't used it, not even to register here, I can create another. I would prefer not to provide the password, but I assume that isn't needed.

Rescue code: 9291-1379-3477-5363-4234-7917
Identity:
BJdJ h8B5 HxtK 38tk wCDi
VdJK cfTL xQaG YSBq 2SUR
nYJQ Uj9x utQG V9FY j5wW
Yze2 3sLz rYZX dGKw zb78
XjHi phqE wbzR KhXV DkaM
JYTG R24

A padding issue at the end certainly sounds like a good candidate for investigation.
 

Attachments

PHolder

Well-known member
May 19, 2018
1,225
205
I would prefer not to provide the password, but I assume that isn't needed.
No, since you've provided the recovery code, it shouldn't be needed at all. In fact, depending on what the problem works out to be, it's probably not actually required to even treat it like a SQRL identity specifically... it's basically an array of bytes, and it may be the case that it's simply a decoding issue. Hopefully @kalaspuffar or @ahauser will stop by soon and provide more feedback.
 

PHolder

Well-known member
May 19, 2018
1,225
205
@kalaspuffar based on the test code you shared with me before, I ran it through my encoder/decoder successfully, so here's that code to save you a few minutes of time:

Code:
  // https://sqrl.grc.com/threads/an-apparent-discrepancy.971/#post-8060
  /* Rescue code: 9291-1379-3477-5363-4234-7917
     Identity:
      BJdJ h8B5 HxtK 38tk wCDi
      VdJK cfTL xQaG YSBq 2SUR
      nYJQ Uj9x utQG V9FY j5wW
      Yze2 3sLz rYZX dGKw zb78
      XjHi phqE wbzR KhXV DkaM
      JYTG R24
  */
  @Test
  public void testEncodeAndDecodePaddedExampleFromUser() throws Exception {
      final String testIdentity = "BJdJh8B5HxtK38tkwCDiVdJKcfTLxQaGYSBq2SURnYJQUj9xutQGV9FYj5wWYze23sLzrYZXdGKwzb78XjHiphqEwbzRKhXVDkaMJYTGR24";

      final String[] stringArr = splitString(testIdentity);
      final byte[] decodedBytes = Base56Decoder.base56Decode(stringArr);
      final String[] encoded = Base56Encoder.base56Encode(decodedBytes);

      assertEquals("Encoding should be the same before and after", testIdentity, mergeStrings(encoded));
  }
 

kalaspuffar

Well-known member
May 19, 2018
296
106
Sweden
coderinsights.com
Hi @RobJ

This issue is solved in 1.5.1 - Alpha, not released to production yet. The import was successful, the only issue is with displaying the textual version with zero padding at the end.

The alpha have been available for testing since the 15 of September so I will push that to production now.

Best regards
Daniel
 

ahauser

Well-known member
Feb 22, 2019
224
57
Here is the PR for the mentioned fix, if anybody is interested:

@RobJ, Daniel usually announces new versions of the app here in the forums, so just keep an eye out for version 1.5.1 which will contain the fix for your problem. And thanks for taking the time to report the issue!
 

mozz

Member
Oct 16, 2019
9
0
Here is the PR for the mentioned fix, if anybody is interested:

@RobJ, Daniel usually announces new versions of the app here in the forums, so just keep an eye out for version 1.5.1 which will contain the fix for your problem. And thanks for taking the time to report the issue!
I downloaded the Sqrl App from F-Droid about 3 weeks ago. Checked it now and found it to be version 1.5.1. In Google Play the version is 1.5.0.
 

RobJ

New member
Nov 5, 2019
4
1
The update just appeared on my Android phone, is v1.5.1, and I can confirm it decodes correctly (shows "R24" at the end). Thank you again to all.
 
  • Like
Reactions: ahauser
Status
Not open for further replies.