| 
			 	
Prev: CLICK WEB AND ERAN MONEY 
		Next: shelve.open generates (22, 'Invalid argument') Os X 10.5 with Python 2.5 	
		 From: Jordan Apgar on 9 Feb 2010 13:09 I am trying to encrypt public data along with another tuple and then decrypt it after sending. RSA is needed for negotiation of keys for AES. But I just get garbage after I decrypt it. This is what I'm attempting to do: from Crypto.PublicKey import RSA from Crypto import Random gkey = RSA.generate(384, Random.new().read) string = str((gkey.publickey().__getstate__(), (333,444))) print string data = gkey.encrypt(string,"") print "data:",data print "decrypt" print "decrypt,", gkey.decrypt(data) print "done" All I get are junk values when printing the decrypted value. 	
		 From: Legrandin on 9 Feb 2010 13:27 		> gkey = RSA.generate(384, Random.new().read) > string = str((gkey.publickey().__getstate__(),(333,444))) You are encrypting with RSA a piece of data which is way larger than the key size (48 bytes). 	
		 From: Jordan Apgar on 9 Feb 2010 14:14 		
		On Feb 9, 1:27 pm, Legrandin <pheenso...(a)farifluset.mailexpire.com> wrote: > > gkey = RSA.generate(384, Random.new().read) > > string = str((gkey.publickey().__getstate__(),(333,444))) > > You are encrypting with RSA a piece of data which is way > larger than the key size (48 bytes). ah thanks Legrandin  |