openssl_pkey_new()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brad Kent

    openssl_pkey_new()

    Has anyone had any luck with this function on any platform? Or have
    any insight?

    I'm hoping to use the OpenSSL module to encrypt data in a database (no
    https or certification stuff necessary). (public key on server...
    private key all nice n secure...)

    I've been able to work with the example keys that came with the
    distrobution just fine but have been unable generate my own..

    <?php
    $privkey = openssl_pkey_ne w();
    while ( ($e = openssl_error_s tring()) !== false )
    debug($e);
    ?>

    On NT this outputs:
    outputs:
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value
    error:0E06D06C: configuration file routines:NCONF_ get_string:no value

    On Solaris, I get:
    Warning: openssl_pkey_ne w() [function.openss l-pkey-new]: unable to
    load random state; not enough random data!
  • Fred Emmott

    #2
    Re: openssl_pkey_ne w()

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Brad Kent wrote:
    [color=blue]
    > Has anyone had any luck with this function on any platform? Or have
    > any insight?
    >
    > I'm hoping to use the OpenSSL module to encrypt data in a database (no
    > https or certification stuff necessary). (public key on server...
    > private key all nice n secure...)[/color]

    [snip]

    Just wondering - how can the private key by "nice n secure" if a script
    running on a web-server can access/use it?

    Fred Emmott
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.2 (GNU/Linux)

    iD8DBQFAml7Sima 0zti2BQgRAoleAJ 93vIK4AmZcNB66u ThlQ+7Pyion3ACf eDaX
    7c1dIDZFDELSHPG 60IWBHns=
    =ICi+
    -----END PGP SIGNATURE-----

    Comment

    Working...