473,382 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Crypto.PublicKey.RSA.error: Plaintext too large

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

Jul 18 '05 #1
5 4505
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
Jul 18 '05 #2
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

Jul 18 '05 #3
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
Jul 18 '05 #4
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

Jul 18 '05 #5
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
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gandalf | last post by:
Hi All! I have an interesting problem here. I have written a Delphi program that should connect to a server written in Python. I'm using a package called DCP for encryption in Delphi and the...
0
by: Mike Tinnes | last post by:
I've trying to use the public/private key framework in C# and been unable to successfully use RSA and RSAOAEPKeyExchangeFormatter to create a secret key under 98. I'm trying to exchange a plaintext...
1
by: Lisa Tang | last post by:
Hi, I am trying to call a C function from PL/SQL and I encounter "ORA-06525 Length Mismatch for CHAR or RAW data". Following is the information: C function in util.dll: INT Scramble(BYTE...
0
by: Brewman | last post by:
When I run aximp /delay /public:..\G10PublicKey.snk /verbose c:\Windows\System32\SHDocVw.dl I get the following Microsoft (R) .NET ActiveX Control to Windows Forms Assembly Generato...
8
by: Dave | last post by:
Hi, I want to simply generate an encrypted text (with a static key) store in a text file and validate it by decrypting the enrypted text with the static key. The static key is a plain text...
2
by: DazedAndConfused | last post by:
I converted a C# example of using dll crypt32 to VB .NET. The converted example fails when Encypting/Decypting. I found that if instead of defining a variable as and setting the values for...
1
by: simon | last post by:
I have an unbound RTF2 control in an Access 2003 form which I set to show either unformatted text or else text with words and sentences highlighted. I do this by setting the PlainText property,...
1
by: Brian Mitchell | last post by:
I'm sorry if this is the wrong group but I couldn't find one relating to cryptography. I have a byte array that I am encrypting using the System.Cryptography classes and it encrypts just...
12
by: Fett | last post by:
I need a crypto package that works on windows with python 2.5. Can anyone suggest one for me? I have been searching for a couple days for a good cryptography package to use for public/private...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.