f



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

0
abra9823 (112)
8/3/2004 3:17:53 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

5 Replies
1104 Views

Similar Articles

[PageSpeed] 15

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
0
peter34 (3696)
8/3/2004 3:44:30 PM
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

0
abra9823 (112)
8/3/2004 10:28:55 PM
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
0
peter34 (3696)
8/3/2004 11:03:12 PM
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

0
abra9823 (112)
8/4/2004 2:32:49 AM
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
0
peter34 (3696)
8/4/2004 12:05:16 PM
Reply:

Similar Artilces:

crypto key generate rsa error
Dear Reader; Cisco 2621 router with IOS (tm) C2600 Software (C2600-I-M), Version 12.2(5) I want to be able to use SSH from the internet. Looking at Cisco's Secure Shell Commands reference it says to generate an RSA key first using crypto key generate rsa from global config mode. When I do that I receive the following. According to Cisco's reference this feature was added to 11(3). Any suggestions? Thanks. Michael Hubbard Loud_2620(config)#crypto key generate rsa ^ % Invalid input detected at '^' marker. Loud_2620(config)# Do you ha...

Help with large data set and fatal python error
I'm running a process which uses python numeric arrays extensively and also does some calculations in c. All objects are created in python or through the Numeric library and then passed to the c routines. I'm dealing with very large sets of data. I'm getting the following exceptions in the early part of the program: Exception exceptions.AssertionError: <exceptions.AssertionError instance at 0x02639C10> in <function remove at 0x025CF5B0> ignored ....and then after about at the 1060 iteration of the main processing loop I get the following error: Fatal Python error: d...

..\..\Python-2.5.2\Include\pyport.h(117) : fatal error C1189: #error : "Python needs a typedef for Py_ssize_t in pyport.h."
When I try and compile using VS2003 for Release. Compiles fine for Debug. In a hurry (should be gardening). Any solution? TIA Bill ...

NDSolve: large relative error without error message
Dear mathgroup, I'm trying to solve a partial differential equation for quite a while now and have several questions regarding the options for NDSolve. Here's the PDE: T = 100 mu = 0 g = 3.2 \[CurlyPhi]rb = 120^2 rb = D[10/4*\[CurlyPhi]^2, \[CurlyPhi]] /. \[CurlyPhi] -> \[CurlyPhi]rb sol = NDSolve[{k*D[U[k, \[CurlyPhi]], k] == k^5/(12*\[Pi]^2)*(3/Sqrt[ k^2 + 2*D[U[k, \[CurlyPhi]], \[CurlyPhi]]]* Coth[Sqrt[k^2 + 2*D[U[k, \[CurlyPhi]], \[CurlyPhi]]]/(2*T)] + 1/Sqrt[k^2 + 2*D[U[k, \[CurlyPhi]], \[CurlyPhi]] + 4*\[CurlyPhi]*D...

Fatal Python error with Py_InitModule (Python 2.3)
I'm using Python embedded in my app, and I've run into problems creating my own modules. I'm using Python version 2.3 compiled with MSVC .NET (not 2003). When I call Py_InitModule I get the message: "Fatal Python error: Interpreter not initialized (version mismatch?)" However, Python does seem to be initialized. Py_IsInitialized() returns 1, and I can PyImport_Import() and I can run scripts successfully from my program. I'm not sure what I could be doing wrong, all the information I've found online indicates that the above message comes from incompatible v...

python ScriptControl error in Excel while running fine in python
I am trying to use ScriptControl under Excel (Windows XP) with the code: Global sc As New MSScriptControl.ScriptControl Public Function os_getcwd() sc.Language = "python" sc.ExecuteStatement ("import os") os_getcwd = sc.Eval("os.getcwd()") End Function When setting the language to python I have the error "A script engine for the specified language..." On the other side, under python, the translated code: import win32com.client sc=win32com.client.Dispatch("ScriptControl") sc.Language = "python" sc.ExecuteStatement (&q...

Python Error
Dear Group, I was trying to convert the list to a set, with the following code: set1=set(list1) the code was running fine, but all on a sudden started to give the following error, set1=set(list1) TypeError: unhashable type: 'list' please let me know how may I resolve. And sometimes some good running program gives error all on a sudden with no parameter changed, how may I debug it? Thanking You in Advance, Regards, Subhabrata Banerjee. subhabangalore@gmail.com wrote: > Dear Group, > > I was trying to convert the list to a set, with the follo...

Fatal Python error using ctypes & python exceptions
Hi Everyone, I've created a 'C' dll that is accessed via ctypes library containing a bunch of functions. I've successfully been able to use the functions. However, I would like to throw python exceptions from some of them. I throw them using: ::PyErr_SetString(::PyExc_RuntimeError, theErrorString); I crash the console when this function is invoked in the 'C' domain. I get an error stating: Fatal Python error: PyThreadState_Get: no current thread when the calling code in python is: try: cdll.MyDll.ThrowingFunction() except: print "An error has occurred&...

When is an error not an error?
When it's OSS slopware, of course. http://www.angelfire.com/planet/dfs0/Knode_send_error.png On 2006-09-12 02:42, * DFS wrote: > When it's OSS slopware, of course. > > http://www.angelfire.com/planet/dfs0/Knode_send_error.png > Well, some time ago I had a problem with OE - too long reference line to other posts, and OE of course refused to send... then crashed. Should I name it a feature? -- Andrea On Tue, 12 Sep 2006 03:25:29 +0200, Andrea wrote: > On 2006-09-12 02:42, * DFS wrote: >> When it's OSS slopware, of course. >> >> http:/...

Error with Python
Hello I have created a tool in Python 2.3 under WinXP Now I extended this tool and now my tool makes Python crash. I see Dr Watson showing a stacktrace. This tool also uses wxPython. Dr Watson says: AppName: python.exe AppVer: 0.0.0.0 ModName: python23.dll ModVer: 2.3.5150.1012 Offset: 0003736a The stacktrace is very long and I don't know how to copy and paste it, because it cannot be selected. (I have made some screenshots) Python crashes as I can see from my tools log file, when the tool is handling messages on the Queue object. My tool is multi threaded and unsing Queue to send mess...

RSA in python
Hello, I am looking for good RSA implementations in python that can import a public key in PEM format and encrypt a buffer using the imported public key. I tried m2crypto, but somehow it is giving me exceptions which I couldnt solve as of now. I get the following with m2crypto: rsa =3D M2Crypto.RSA.load_pub_key("pubkey.pem") gives me: File "KB_Client.py", line 63, in SessionInit rsa =3D M2Crypto.RSA.load_pub_key("pubkey.pem") File "/usr/lib/python2.4/site-packages/M2Crypto/RSA.py", line 225, in load_pub_key return load_pub_key_bio(bio) Fi...

python is a python
python is a python ...

Python Error :(
I wasn't able to run a Python script. But then later I was able to run it through the Shell. I was experimenting with cron jobs and set up the python execution in as a cron. The first time it ran, It was fine but then after that, it started giving me some errors. Now when I try to run the script directly, I get the following error: Traceback (most recent call last): File "<stdin>", line 1, in ? File "userbot.py", line 637, in ? con = connect() File "userbot.py", line 607, in connect con.requestRoster() File "user.py", line 53...

error or not an error ...
I was just testing out the R4 REXX thingy, and it found an error in the following program. My question is this, is it an error or not? My PC/REXX and Regina don't barf on it, but I thought they should've. _____________________________________________ /**/ ?.='' ?.z='batman' trace i if ?.z\==''then do; say '?.z=' ?.z; end ______________________________________________ Note that there is space before the THEN. I'm not sure of the exact rules for parsing an IF statement, I know that THEN is a "reserved" keyword when an IF statement is...

My Python error...
Basically I have Mac OS X 10.4.11 and I've got python 2.5. When I go to TextEdit and type in something like #!/usr/bin/env python print 2+2 and save it as simplescript.py. Then I go to terminal and cd my way to the dir that the script source is in and type: python simplescript.py And the output is: File "simplescript.py", line 1 SyntaxError: Non-ASCII character '\xfe' in file simplescript.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details What does this mean? And how do I make it work again? Thanks for reading SaMTHG SaMTHG@...

Error on Python
Hi, right now I'm using Python and Multicast. I have the code for Multicast receiver on Python but I keep getting this error; File "<string>", line 1, in bind error: (10049, "Can't assign requested address") The error is coming from this line; sock.bind ((MCAST_ADDR, MCAST_PORT)) Can anyone please help me solve this problem? Thanks maehhheeyy <maehhheeyy@gmail.com> wrote: >Hi, right now I'm using Python and Multicast. I have the code for >Multicast receiver on Python but I keep getting this error; > >File "<string>", ...

When is an error not an error?
The Java language specification claims in: 8.8.7.1 Explicit Constructor Invocations .... "If an anonymous class instance creation expression appears within an explicit constructor invocation statement, then the anonymous class may not refer to any of the enclosing instances of the class whose constructor is being invoked." Helpfully it gives an example: "For example: class Top { int x; class Dummy { Dummy(Object o) {} } class Inside extends Dummy { Inside() { super(new Object() { int r = x; }); // err...

??? Error using ==> sym/maple Error, integer too large in context
Hi, everyone! How to solve this problem. ??? Error using ==> sym/maple Error, integer too large in context I will appreciate your help if some one knows and replies this. ...

??? Error using ==> sym.maple Error, integer too large in context
when computation a very complex multi -polynomials. and got the warning as the title. how can I fix it. -394928775117283204389837053363758411028360043319687936/12624892865007 1599560637181762273173226171875*a^2*y^14*b^10*c^4+....+... ...

Trying to solve a python/mechanize "error 500" http error
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. When I insert the link into the browser, I actually get an err page.. so, I suspect that there is a handler that I should be able to modify/use to handle this situation... Thoughts/Comments will be greatly appreciated... Thanks the output is: www = www.1800ink.com url2= http://www.quantcast.com/www.1800in...

Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Good day to all, I have installed the j2se/netbeans binary bundle on red hat 9. I can run everything perfectly as root but when I try to compile with any other user I get: Error occurred during intialization of VM java/lang/NoClassDefFoundError: java/lang/Object When I saw this it seemed like a permissions problem but I checked the permissions and everything seemed fine. All users have execute permissions of javac and java. I have read other threads dealing with the same or similar problem but have not reached any solution yet. I would appreciate if anyone that has run into this type o...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-so...

"Unable to find a valid Python installation" error, a python__define error ?
Dear all, I had difficulties using the Python bridge with my own winpython installation and I received the 'Unable to find a valid Python installation.' error message. Thus after spending a lot of time in Windows innards, I just opened the python__define.pro file and found the following piece of code : ; Determine which Python version to load. SPAWN, ['python', '--version'], stdout, stderr, /noshell if (stderr[0].Contains('Python 2.7')) then begin DLM_LOAD, 'Python27' endif else if (stderr[0].Contains('Python 3.4')) the...

Trying to solve a python/mechanize "error 500" http error #2
i'm getting the following error: mechanize._response.httperror_seek_wrapper: HTTP Error 500: i'm running python 5.1 and mechanize 0.1.7b I have no idea as to what I have to change/modify/include to handle this issue. The link that I'm testing is at the bottom of the page. When I insert the link into the browser, I actually get an err page.. so, I suspect that there is a handler that I should be able to modify/use to handle this situation... Thoughts/Comments will be greatly appreciated... Thanks the output is: www = www.1800ink.com url2= http://www.quantcast.com/www.1800in...

Web resources about - Crypto.PublicKey.RSA.error: Plaintext too large - comp.lang.python

Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Secure Shell - Wikipedia, the free encyclopedia
The protocol specification distinguishes two major versions that are referred to as SSH-1 and SSH-2. The best-known application of the protocol ...

MRT Engineering Office,BOHSR-Information Security
1. Preface In the current operating environment of the MRT Engineering Office, BOHSR(called as our Office in the following), information technology ...

Contact Us - Carillon Information Security Inc.
Carillon Information Security inc., a security consulting firm specialized in Identity and Access Management solutions, can be reached at this ...

Ana Gainaru - PhD Student at The University of Illinois at Urbana-Champaign, Computer Science
Personal website of Ana Gainaru - PhD Student at The University of Illinois at Urbana-Champaign, Computer Science

How do I create and use Public Keys with SSH?
SSH and SFTP Public Key Authentication requires that you create a public/private key pair. We'll look at how to create, and then use, those keys. ...

Disabling public key authentication in sftp
... and got: debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password ...

New in Android Samples: Authenticating to remote servers using the Fingerprint API
... the created private and public keys with as follows: KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); PublicKey ...

Technical notes on Java, JavaScript, S/MIME, WebLogic, Apache Tomcat etc
S/MIME S/MIME (Secure / Multipurpose Internet Mail Extensions) is a standard for public key encryption and signing of e-mail encapsulated in ...

APT repository • Charles Web Debugging Proxy
Charles Web Debugging Proxy - Official Site

Resources last updated: 2/20/2016 12:52:27 PM