Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread Jesse Callaway
So you'd like the file to be encrypted before it's sent or stored somewhere you can grab it? How are you getting this file? I think this would be a good use of public key crypto. You can store or publish (or whatever) your public key either in the code or loaded from a URL. Encrypt the file using t

Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread CED
I'm pulling in a file, encrypting and then sending... Psuedo code: function dencrypt($str, $key){ $str = mcrypt_decrypt(MCRYPT_DES, $key, $str, MCRYPT_MODE_ECB); $block = mcrypt_get_block_size('des', 'ecb'); $pad = ord($str[($len = strlen($str))-1]); return sub

Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread Anthony Ferrara
When you say "encryption and decryption of credentials", what are you talking about? User credentials? If so, why aren't you hashing them one-way instead of encrypting them (and therefore making them FAR easier for an attacker to steal)? Anthony On Thu, Nov 29, 2012 at 11:13 AM, CED wrote: > J

Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread CED
Yeah, that's why I was looking for a module, do you have one that you prefer? On 11/29/2012 8:28 AM, Rob Marscher wrote: > I have used these functions before for encrypting/decrypting with > public/private key pairs: > > openssl_get_privatekey() > openssl_get_publickey() > openssl_public_encrypt()

Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread Rob Marscher
I have used these functions before for encrypting/decrypting with public/private key pairs: openssl_get_privatekey() openssl_get_publickey() openssl_public_encrypt() openssl_private_decrypt() You need to have the openssl module enabled though (compile php using --with-openssl in the configure arg

Re: [nyphp-talk] PHP and keystores

2012-11-29 Thread CED
Just encryption and decryption of credentials. On 11/28/2012 6:25 PM, Rob Marscher wrote: > On Nov 28, 2012, at 7:23 PM, CED wrote: > >> I have a need to use a private key within PHP... does anyone have any >> recommendations on this? >> I looked at http://phpkeystore.com/ but I'm not sure... an