wwwtyro / cryptico

An easy-to-use encryption system utilizing RSA and AES for javascript.

Home Page:http://wwwtyro.github.com/cryptico

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Uncaught TypeError: Cannot read property 'toString' of undefined

ckproduct opened this issue · comments

Uncaught TypeError: Cannot read property 'toString' of undefined
at Object.a.publicKeyString (cryptico.min.js:105)

I put a KeyString to cryptico.publicKeyString()
and It just happen

Can you provide some code if issue is still actual of cause =)
I've same issue because of treating RSA key from method generateRSAKey as string but its object and publicKeyString expect object

commented

i have same issue.in my case m copying the result of generateRSAKey into publicKeyString function as follows.

  var key=cryptico.generateRSAKey(PassPhrase, Bits);
  console.log(key);//copied the key from console and pasted below.
  var publicKey = cryptico.publicKeyString();

while passing key variable is working well.

@awdDev786 you should pass a key in publicKeyString it will not work without it. Here is its implementation in cryptico.js:

    // Returns the ascii-armored version of the public key.
    my.publicKeyString = function(rsakey) 
    {
        pubkey = my.b16to64(rsakey.n.toString(16));
        return pubkey; 
    }