paragonie / pco_prototype

PCO - PHP Crypto Objects
Do What The F*ck You Want To Public License
12 stars 1 forks source link

DSN Format #2

Closed paragonie-scott closed 8 years ago

paragonie-scott commented 9 years ago

Since we are using DSN-like strings for the constructor, we should decide how they behave.

Thoughts or contrary positions are welcome.

paragonie-scott commented 9 years ago
$crypto = new \PCO\Asymmetric('openssl'); // should work, but
$crypto = new \PCO\Asymmetric('openssl:cipher=AES'); // should this fail?
ircmaxell commented 9 years ago

I would have it fail, if only for not specifying the variant of AES (should be openssl:cipher=AES-128)

paragonie-scott commented 9 years ago

I've updated the OP. That makes more sense than separating the keysize out as a second option.

$crypto = new \PCO\Asymmetric('openssl'); // should work, but
$crypto = new \PCO\Asymmetric('openssl:cipher=AES-128'); // should this fail?
AshleyPinner commented 9 years ago

@ircmaxell What about making it assume you want AES-128 and throw a notice?

ircmaxell commented 9 years ago

I wouldn't raise a notice. If we want to default to AES-128, that's fine. Just make that the default.

paragonie-scott commented 9 years ago

Updated the OP. I agree that AES should map to AES-128 since simply "openssl" is a sane default.