[Tech Note] Playing with RSA functions

General Discussions about the API

[Tech Note] Playing with RSA functions

Postby oliver » Sat Sep 15, 2012 9:10 pm

BigInteger support in ND1 is implemented via Tom Wu's jsbn class. There's complementary code for RSA available on his website (http://www-cs-students.stanford.edu/~tjw/jsbn/) and here're instructions how to pull these into the calculator, in case you'd like to play with RSA.

You can pull in the remote source files like this
Code: Select all
function() {
    if (!(require("http://www-cs-students.stanford.edu/~tjw/jsbn/prng4.js", true) && require("http://www-cs-students.stanford.edu/~tjw/jsbn/rng.js", true) && require("http://www-cs-students.stanford.edu/~tjw/jsbn/rsa.js", true) && require("http://www-cs-students.stanford.edu/~tjw/jsbn/rsa2.js", true)))
        return false;
    /* do something with RSA objects */
}

Or, you can add the URLs to these source files as "Definition" on folder keys and use the folder's Sharing | Download Assets button (which will only appear when you have URLs among your key functions) to localize them. See the BigInt folder for an example of this.
Then, the files will be local, and you can use them like this
Code: Select all
function() {
    if (!(require("prng4.js", true) && require("rng.js", true) && require("rsa.js", true) && require("rsa2.js", true)))
        return false;
    /* do something with RSA objects */
}
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron