Comments for "Crypt_RSA"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Helgi Þormar Þorbjörnsson  [2005-03-31 01:52 UTC]

    Could be maybe get some .phps of the package online also ? :)
    And even some examples would be helpful ;)
  • Matthew Fonda  [2005-03-31 02:23 UTC]

    Looks very nice and useful to me. And as Helgi said, it would be nice to put up a .phps, makes things much easier.

    Theres a few minor CS issues:
    *All classes should be in their own file, with the name of the class - so RSAKey.php would contain Crypt_RSAKey class, etc
    *Method names should follow "studly caps " scheme, for example use generateKeyPair instead of generate_key_pair.

    Looks nice so far.
  • Philippe Jausions  [2005-03-31 04:36 UTC]

    For portability reasons, you should look into adding support for BCMath and GMP extensions. You can also probably depend on one of the Math_* PEAR packages although it would probably be slower...

    Also, make use of the OpenSSL extension if available.

    I did write a very similar package but haven't got much the time to turn it into a PEAR package...

  • Alexander Valyalkin  [2005-03-31 07:19 UTC]

    I've wrote new version of package, which is available at
    It consists an example script /examples/1.php .
    I put all classes into their own files and changed methods naming.
  • Philippe Jausions  [2005-03-31 19:58 UTC]

    To load your extension use the existing PEAR::loadExtension() static method instead of the strange big_int_loader.php file.

    Still, this is silly to force people to use your extension to be able to use this package. BCMath and GMP are widely in use, especially in web hosting environment where your extension can't be installed.

    The exit() statements won't work good either. Make it return a PEAR_Error instead.

  • Alexander Valyalkin  [2005-04-01 10:00 UTC]

    Thanks, Philippe, for your notices. I'll add support of BCMath and GMP in the next release.
    Sorry, but I'm novice in PEAR developement, so I didn't know about PEAR::loadExtension() and PEAR_Error. I'll fix this in the next release.

    I have a question: is it good idea to don't support PHP versions less than 5 in my package? The reason: PHP4 don't support exceptions, interfaces and real private members of classes.
  • Michael Wallner  [2005-04-01 13:24 UTC]

    If your extension is available for PHP4 I'd suggest to keep the package PHP4/5 too, as gmp and bcmath are also available for PHP4.

    There should be better reasons than exceptions and OO visibility.
  • Evgeny Stepanischev  [2005-04-02 11:05 UTC]

    Ìíå êàæåòñÿ, áûëî áû ëó÷øå èñïîëüçîâàòü

    âìåñòî PECL big_int.
  • Alexander Valyalkin  [2005-04-13 14:45 UTC]

    New version of Crypt_RSA package is available for exploring and testing at

    Now it supports two math packages: PECL big_int and bundled into PHP BCMath. It is easy to implement support for additional math packages. See /RSA/MathClasses folder in the package for details of implementation.