login about faq

I use the class CkSshKey and the function FromOpenSshPublicKey.

The verification of my public key file failed. The LastErrorText contains the following text:

    P is not prime.

I did not find any error description in the documentation that will explained the error. What is going wrong?

asked Nov 26 '12 at 11:29

chilkat's gravatar image

chilkat ♦♦

The problem is that the key is not a valid one. The "P" part of the key should be a large prime number. The software that produced the key created one that did not use a prime number for the "P".

See this: http://en.wikipedia.org/wiki/RSA_%28algorithm%29

Key generation

RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. The keys for the RSA algorithm are generated the following way:

Choose two distinct prime numbers p and q.

For security purposes, the integers p and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primality test.

Unfortunately, the only solution is to re-generate a new key such that the p and q are valid prime numbers. There are computational issues w/ using non-prime numbers, and it wouldn't be a good idea to use a key where these parts are not prime.


answered Nov 26 '12 at 11:30

chilkat's gravatar image

chilkat ♦♦

edited Nov 26 '12 at 11:30

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Nov 26 '12 at 11:29

Seen: 1,532 times

Last updated: Nov 26 '12 at 11:30

powered by OSQA