This check is not sufficient. Additionaly you have to ensure, that random value of k is not divisible by above factors of 'prime2' (BTW this will also ensure, that k is not equal to 0, which is required by ECDSA algorithm) and that neither r, nor s are equal to 0 (again - ECDSA requirement). If any of these checks fails, then you need to redo signing with a new value of k (note that in keygen this value doesn't need to be random at all - you can start with k=1 and increment it by 1 if necessary).

2 on on == == ==3 on on == == on4 on on == on ==5 on on == on on6 on on on == ==7 on on on == on8 on on on on ==9 on on on on on

Great work! I used DSA9 as cybernet recommended and it works fine.

Why do you still recommend not to use DSA9?

As you can see from your paste, It installs 100M and 200M options, which isn't necessary. 200M supersedes 100M anyway. It likely won't bring any troubles but there's no need for it. DSAZ is equivalent.

OK, so having the DSA9 already installed (license key generated with original rikey.c ) - everything Official Version - I sent an UNINSTALL and my scope got back to a normal 2072. I had the serial intact all the time. I had the latest FW installed before initially starting installing licenses.

Then on a 32 bit linux box I created a DSAZ license key with rikey.c - my serial is DS2A...2 and is 13 chars long. I sent it to the scope: verification failedThen I used the "no_brute_force" version of rikey.c - this created a different license key for DSAZ with the same serial but sending it to the scope yielded: verification failed again

Both lic1 and lic2 keys have always been 14 chars long.

So I stopped here.Any ideas/explanations/suggestions?

OK, so I used cybernet's verification routine on all keys generated. And yes, the result is the same. The DSA9 key generated is VALID, while DSAZ key generated is INVALID against my serial.

Edit: I changed the seed and now it works. Thanks again.

Sorry for talking to myself in the open

So ?

DSA9 rules !

The quote "dont use below" (DSA9) is misleading ; to many instances with problems using DSAZ

if (strlen(private_key)<14) { printf("\n\n"); printf("set the private_key variable on top of this file\n"); printf("you can find it here: http://www.eevblog.com/forum/testgear/sniffing-the-rigol's-internal-i2c-bus/msg264690/#msg264690\n"); printf("\n\n"); exit(-1); }

if (strlen(private_key)<14) { printf("\n\n"); printf("set the private_key variable on top of this file\n"); printf("you can find it here: http://www.eevblog.com/forum/testgear/sniffing-the-rigol's-internal-i2c-bus/msg264690/#msg264690\n"); printf("\n\n"); exit(-1); }

if (strlen(private_key)<14) { printf("\n\n"); printf("set the private_key variable on top of this file\n"); printf("you can find it here: http://www.eevblog.com/forum/testgear/sniffing-the-rigol's-internal-i2c-bus/msg264690/#msg264690\n"); printf("\n\n"); exit(-1); }

1.) I'd use srand instead of irand and add srand(++seed) instead - as per the manual it should not work at all like this as irand will always use a seed of 1 if no srand is called 2.) You could put "break;"s in the check cycle to save some CPU

Here's the generator code amended with "some guy"'s recommendation. Now it generates a VALID code for me w/o manually fiddling around with the seed.

So you can spare the seed field on the GUI...

Great work, the math problem was beyond me, but you didn't take into account preceding zeros in lic1 or lic2, which must be nullpadded to keep those variables at 14 characters long each.I've added it to your code here:

if (strlen(private_key)<14) { printf("\n\n"); printf("set the private_key variable on top of this file\n"); printf("you can find it here: http://www.eevblog.com/forum/testgear/sniffing-the-rigol's-internal-i2c-bus/msg264690/#msg264690\n"); printf("\n\n"); exit(-1); }

DSAZ is perfect - if you can't generate one try a different seed value until you can. You don't want to use DSA9.

Apparently you have not read to all the posts where the DSAZ is giving problems, but no problem, the tools we have are flexible

I think you are focusing on the wrong detail; Using DSA9 is what has resulted in an invalid state in the scope for some people, which in turn resulted in the serialnumbers getting mangled for them.DSAZ just had a math problem in rikey.c that triggered on some serialnumbers (which may have been fixed now by doma and "some guy"), it had no effect at all on the scopes (as I understood it the license codes weren't even accepted by the scopes, so no effect was possible).

DSAZ is perfect - if you can't generate one try a different seed value until you can. You don't want to use DSA9.

Apparently you have not read to all the posts where the DSAZ is giving problems, but no problem, the tools we have are flexible

I think you are focusing on the wrong detail; Using DSA9 is what has resulted in an invalid state in the scope for some people, which in turn resulted in the serialnumbers getting mangled for them.DSAZ just had a math problem in rikey.c that triggered on some serialnumbers (which may have been fixed now by doma and "some guy"), it had no effect at all on the scopes (as I understood it the license codes weren't even accepted by the scopes, so no effect was possible).

This is my general feeling as well. The reports of serial numbers getting hosed, etc are a little concerning. Assuming the feature table posted earlier is correct, DSAZ would seem to be more "valid" than DSA9.

I used the DSAZ code on my brand new DS2072 (came with latest fw) and it worked perfectly, serial remained, etc.

Need to get the best parts all put together, maybe I will do this too when I get home

Maybe worth sticking it on GitHub? (Or perhaps that might violate their policies?)

Not Github, but somewhere.

Anyway here's a cleaned up version, with more verbose help - do you like it? Beautified, fixes bugs (license padding, lic2 prime check, no brute-force). Adds optional run-time requirement for the private key (if not compiled with it, it is required).

EDIT: the single downloader, minor bug! you don't need to redownload, but if you want to send it to others, send this version.