Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does RSA work with Python 3? #15

Closed
parke opened this issue Aug 27, 2013 · 7 comments
Closed

Does RSA work with Python 3? #15

parke opened this issue Aug 27, 2013 · 7 comments

Comments

@parke
Copy link

parke commented Aug 27, 2013

I'm running Python versions 2.7.4 and 3.3.1 on Ubuntu 13.04. I've set up both Python 2 and 3 in separate virtualenv environments so I can install packages as non-root.

I'm running PyTomCrypt 0.6.1 in both virtual environments. I cannot "import tomcrypt.rsa" in Python3. (In Python2 it works fine.)

$ python3
Python 3.3.1 (default, Apr 17 2013, 22:32:14) 
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tomcrypt.rsa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tomcrypt.prng.pxd", line 8, in init tomcrypt.rsa (tomcrypt/rsa.c:6174)
  File "tomcrypt.prng.pyx", line 1, in init tomcrypt.prng (tomcrypt/prng.c:2905)
  File "tomcrypt._core.pyx", line 16, in init tomcrypt._core (tomcrypt/_core.c:872)
ValueError: level must be >= 0
@mikeboers
Copy link
Owner

On first glance, this seems to be related to http://bugs.python.org/issue15610

I'm seriously swamped for a couple days. Mind if I take a little time to try to figure it out, or is this super critical?

If you have the time, I'd try building it from source in your Python 3 environment, as this seems like it might related to the specific version of Cython I use with 2.X not being usable in 3.3... maybe.

The means to build this are somewhat convoluted, but the README describes it.

@parke
Copy link
Author

parke commented Aug 27, 2013

It is not time critical (at present, anyway).

If I have the time, I'll try looking at the build instructions in the README, and I will report any progress I make.

@mikeboers
Copy link
Owner

I believe that this was fixed with a newer version of Cython, although I was unable to reproduce the issue on my end.

I have rolled a number of fixes in, along with your other issue, and pushed 0.7.0 to the PyPI.

Let me know if that fixes this issue.

@parke
Copy link
Author

parke commented Aug 29, 2013

0.7.0 seems to work with Python 3! Thanks! I'll let you know if I find anything else noteworthy.

@parke parke closed this as completed Aug 29, 2013
@mikeboers
Copy link
Owner

Great!

Please let me know your thoughts as you use it. I love getting feedback on this project. =]

@parke
Copy link
Author

parke commented Aug 29, 2013

I switched from ctr mode to cbc mode, and got this error:

tomcrypt.LibError: Invalid argument provided.

I guess CBC mode needs the input to be a multiple of the block size. A more descriptive error message would have been helpful.

@mikeboers
Copy link
Owner

I agree. It is on the TODO list.

Just opened #19 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants