Crypto.PublicKey.RSA.error: Plaintext too large

Discussion in 'Python' started by Ajay Brar, Aug 3, 2004.

  1. Ajay Brar

    Ajay Brar Guest

    hi!

    I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too large
    - when verifying the signature of a document.
    What i am doing is - the document and the signature are downloaded off
    the net, my verify script then connects to a server and obtains a public
    key. It then uses the public key to verify the signature.
    The whole thing works fine when i do the same thing in the interactive
    interpreter. Its only when i download the files and obtain the public
    key from the server and then verify, that i get the above error.

    any suggesstions...ideas???

    cheers

    --
    Ajay Brar
    CS Honours 2004
    Smart Internet Technology Research Group

    http://www.it.usyd.edu.au/~abrar1
    Ajay Brar, Aug 3, 2004
    #1
    1. Advertising

  2. Ajay Brar

    Peter Hansen Guest

    Ajay Brar wrote:

    > I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too large
    > - when verifying the signature of a document.
    > What i am doing is - the document and the signature are downloaded off
    > the net, my verify script then connects to a server and obtains a public
    > key. It then uses the public key to verify the signature.
    > The whole thing works fine when i do the same thing in the interactive
    > interpreter. Its only when i download the files and obtain the public
    > key from the server and then verify, that i get the above error.
    >
    > any suggesstions...ideas???


    Carriage Return/Line Feed problems? Or trailing newline problems?

    -Peter
    Peter Hansen, Aug 3, 2004
    #2
    1. Advertising

  3. Ajay Brar

    Ajay Brar Guest

    Peter Hansen wrote:

    > Ajay Brar wrote:
    >
    >> I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too
    >> large - when verifying the signature of a document.
    >> What i am doing is - the document and the signature are downloaded
    >> off the net, my verify script then connects to a server and obtains a
    >> public key. It then uses the public key to verify the signature.
    >> The whole thing works fine when i do the same thing in the
    >> interactive interpreter. Its only when i download the files and
    >> obtain the public key from the server and then verify, that i get the
    >> above error.
    >>
    >> any suggesstions...ideas???

    >
    >
    > Carriage Return/Line Feed problems? Or trailing newline problems?


    thats what i am going to investigate now. But even if there were
    trailing newline or carriage return characters, shouldn't the verify
    return false instead of giving the error.
    cheers

    >
    > -Peter




    --
    Ajay Brar
    CS Honours 2004
    Smart Internet Technology Research Group

    http://www.it.usyd.edu.au/~abrar1
    Ajay Brar, Aug 3, 2004
    #3
  4. Ajay Brar

    Peter Hansen Guest

    Ajay Brar wrote:

    > Peter Hansen wrote:
    >> Ajay Brar wrote:
    >>> I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too
    >>> large - when verifying the signature of a document. ...

    >>
    >> Carriage Return/Line Feed problems? Or trailing newline problems?

    >
    > thats what i am going to investigate now. But even if there were
    > trailing newline or carriage return characters, shouldn't the verify
    > return false instead of giving the error.


    I couldn't say, not having used that particular API. What does
    the documentation say it should do? Always return just True or
    False? Does it not make reference to this type of error?

    -Peter
    Peter Hansen, Aug 4, 2004
    #4
  5. Ajay Brar

    Ajay Brar Guest

    Peter Hansen wrote:

    > Ajay Brar wrote:
    >
    >> Peter Hansen wrote:
    >>
    >>> Ajay Brar wrote:
    >>>
    >>>> I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too
    >>>> large - when verifying the signature of a document. ...
    >>>
    >>>
    >>> Carriage Return/Line Feed problems? Or trailing newline problems?

    >>
    >>
    >> thats what i am going to investigate now. But even if there were
    >> trailing newline or carriage return characters, shouldn't the verify
    >> return false instead of giving the error.

    >
    >
    > I couldn't say, not having used that particular API. What does
    > the documentation say it should do? Always return just True or
    > False? Does it not make reference to this type of error?
    >
    > -Peter


    the documentation says verify should return true or false. it will
    generate an error if plaintext is too large - which is not helping me much
    i have pinned the problem down to the signature itself and the way i am
    downloading it.
    what i do is when a user clicks on a signature link, i calculate the
    signature on the fly and then do
    print "Content-type: application\n"
    print signature
    i am using content-type application to force explorer to give the
    download dalog box (the application i am building will later be ported
    to a pocket pc). Microsoft on their website said to put the header
    "Content-disposition: attachment;filename=blah" to force dowload, but
    that didn't work - i am yet to find out what i am doing wrong?
    so any ideas on how i send the signature across and make the user
    download it?

    btw, are there other free Python cryptography packages?

    thanks

    cheers

    --
    Ajay Brar
    CS Honours 2004
    Smart Internet Technology Research Group

    http://www.it.usyd.edu.au/~abrar1
    Ajay Brar, Aug 4, 2004
    #5
  6. Ajay Brar

    Peter Hansen Guest

    Ajay Brar wrote:

    > the documentation says verify should return true or false. it will
    > generate an error if plaintext is too large - which is not helping me much
    > i have pinned the problem down to the signature itself and the way i am
    > downloading it.
    > what i do is when a user clicks on a signature link, i calculate the
    > signature on the fly and then do
    > print "Content-type: application\n"
    > print signature
    > i am using content-type application to force explorer to give the
    > download dalog box (the application i am building will later be ported
    > to a pocket pc). Microsoft on their website said to put the header
    > "Content-disposition: attachment;filename=blah" to force dowload, but
    > that didn't work - i am yet to find out what i am doing wrong?
    > so any ideas on how i send the signature across and make the user
    > download it?


    Internet Explorer is, of course, broken. The only guaranteed
    solution of which I'm aware to the problem that it sounds like
    you are describing (IE refusing to download a file in the right
    way or to save it as right type) is to set the file extension
    to something that it recognizes as requiring a download. For
    example, if you use a file extension of .txt on something, it
    will generally not try to download it automatically. Same for
    other things that it recognizes. Setting the extension to
    ..exe would presumably force the same behaviour as using content
    type "application". Leaving the extension off might also work,
    though I haven't tried that.

    Or I might be interpreting what you are saying incorrectly.

    -Peter
    Peter Hansen, Aug 4, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gg
    Replies:
    0
    Views:
    2,691
  2. Rogue Chameleon

    KeyStore and PublicKey

    Rogue Chameleon, Sep 27, 2004, in forum: Java
    Replies:
    3
    Views:
    398
    Sudsy
    Sep 27, 2004
  3. Bond
    Replies:
    4
    Views:
    501
    Bjorn Abelli
    Sep 25, 2005
  4. Sven Bluege
    Replies:
    1
    Views:
    833
    Roedy Green
    Sep 21, 2005
  5. David Clymer

    Re: Crypto plaintext padding (SOLVED)

    David Clymer, May 6, 2007, in forum: Python
    Replies:
    0
    Views:
    386
    David Clymer
    May 6, 2007
Loading...

Share This Page