cryptico icon indicating copy to clipboard operation
cryptico copied to clipboard

Uncaught TypeError: Cannot read property 'toString' of undefined

Open ckproduct opened this issue 8 years ago • 3 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

ckproduct avatar Aug 15 '17 09:08 ckproduct

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

comrat avatar Sep 12 '18 08:09 comrat

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 avatar Sep 23 '18 14:09 awdDev786

@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; 
    }

comrat avatar Sep 24 '18 07:09 comrat