#9726: An educational RSA crpytosystem
-------------------------------------------+--------------------------------
   Reporter:  gauravluthra                 |       Owner:  mvngu           
       Type:  enhancement                  |      Status:  needs_work      
   Priority:  minor                        |   Milestone:                  
  Component:  cryptography                 |    Keywords:  RSA, educational
     Author:  Gaurav Luthra(gauravluthra)  |    Upstream:  N/A             
   Reviewer:                               |      Merged:                  
Work_issues:                               |  
-------------------------------------------+--------------------------------

Comment(by mvngu):

 Some problems with [attachment:srsa.2.patch]:

  * What if I want `n` to be odd? In that case, I get an error:
  {{{
 #!python
 sage: from sage.crypto.public_key.srsa import RSA
 sage: RSA(11, 2)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /dev/shm/mvngu/sage-4.5.3.alpha0/<ipython console> in <module>()

 /dev/shm/mvngu/sage-4.5.3.alpha0/local/lib/python2.6/site-
 packages/sage/crypto/public_key/srsa.pyc in __init__(self, n, e)
     152             1234567890
     153         """
 --> 154         p = random_prime(2**((n/2)-1), 2**(n/2))
     155         q = random_prime(2**((n/2)-1), 2**(n/2))
     156         while( q == p ):

 /dev/shm/mvngu/sage-4.5.3.alpha0/local/lib/python2.6/site-
 packages/sage/rings/arith.pyc in random_prime(n, proof, lbound)
    1139     from sage.structure.proof.proof import get_flag
    1140     proof = get_flag(proof, "arithmetic")
 -> 1141     n = ZZ(n)
    1142     if n < lbound:
    1143         raise ValueError, "n must be greater than lbound:
 %s"%(lbound)

 /dev/shm/mvngu/sage-4.5.3.alpha0/local/lib/python2.6/site-
 packages/sage/structure/parent.so in sage.structure.parent.Parent.__call__
 (sage/structure/parent.c:6407)()

 /dev/shm/mvngu/sage-4.5.3.alpha0/local/lib/python2.6/site-
 packages/sage/structure/coerce_maps.so in
 sage.structure.coerce_maps.NamedConvertMap._call_
 (sage/structure/coerce_maps.c:4053)()

 /dev/shm/mvngu/sage-4.5.3.alpha0/local/lib/python2.6/site-
 packages/sage/symbolic/expression.so in
 sage.symbolic.expression.Expression._integer_
 (sage/symbolic/expression.cpp:4034)()

 TypeError: unable to convert x (=16*sqrt(2)) to an integer
  }}}

  * Running doctests over `srsa.py` fails with the following message:
  {{{
 #!sh
 [mv...@sage sage-4.5.3.alpha0]$ ./sage -t -long devel/sage-
 main/sage/crypto/public_key/srsa.py
 sage -t -long "devel/sage-main/sage/crypto/public_key/srsa.py"
 Exception raised by doctesting framework. Use -verbose for details.
          [1.8 s]

 ----------------------------------------------------------------------
 The following tests failed:


         sage -t -long "devel/sage-main/sage/crypto/public_key/srsa.py" #
 Exception from doctest framework
 Total time for all tests: 1.8 seconds
  }}}

 This patch needs a lot of work and a lot of redesign.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9726#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to