RSA Encryption not returning result

Posted 16 February 2013 - 08:08 PM

Im trying to do RSA Encryption and I am not sure what to try anymore.
I know modExp() works cause I tested it already. So, I think the problem is rsa_encypt().
If someone could help me I would appreciate it.

My code compiles and when I try to type in the word for example "The Queen Can't Roll When Sand is in the Jar." It tells me None...

Re: RSA Encryption not returning result

I'm trying to do RSA Encryption and I am not sure what to try anymore and getting frustrated. I know mod_exp works from modular class because I tested it already. So, I think the problem is in the Encryptions class.

My code compiles and when I try the phrase "The Queen Can't Roll When Sand is in the Jar.", it doesn't do anything

Re: RSA Encryption not returning result

Well... I haven't actually messed around doing anything with RSA myself but...
You didn't call your main function at the end of the program so... that might be a problem.

Change this:

if __name__ == '__main__':
pass

To this:

if __name__ == '__main__':
main()

After changing that and fixing the indentation (which was probably just a result of how you pasted it in) this is the output I get:

Encrypting message: The Queen Can't Roll When Sand is in the Jar.
2159,2170,1313,1992,2718,2160,1313,1313,2235,1992,641,1632,2235,1956,884,1992,1859,2185,745,745,1992,604,2170,1313,2235,1992,2680,1632,2235,1773,1992,3179,1230,1992,3179,2235,1992,884,2170,1313,1992,1877,1632,2412,2825
Decrypting message:
The Queen Can't Roll When Sand is in the Jar.

Re: RSA Encryption not returning result

Well... I haven't actually messed around doing anything with RSA myself but...
You didn't call your main function at the end of the program so... that might be a problem.

Change this:

if __name__ == '__main__':
pass

To this:

if __name__ == '__main__':
main()

After changing that and fixing the indentation (which was probably just a result of how you pasted it in) this is the output I get:

Encrypting message: The Queen Can't Roll When Sand is in the Jar.
2159,2170,1313,1992,2718,2160,1313,1313,2235,1992,641,1632,2235,1956,884,1992,1859,2185,745,745,1992,604,2170,1313,2235,1992,2680,1632,2235,1773,1992,3179,1230,1992,3179,2235,1992,884,2170,1313,1992,1877,1632,2412,2825
Decrypting message:
The Queen Can't Roll When Sand is in the Jar.

Kinda looks like it is working.
-Mek

hey thanks...I actually did notice if __name__ == '__main__': as well but im still getting an error...what version of Python are you running ? can you post the code here please I think im not getting indentation right...

This post has been edited by stephanie904: 17 February 2013 - 09:43 AM