Closed paragonie-scott closed 8 years ago
Instead of allowing arbitrary strings (and running the risk that someone might want to encrypt with the string "MySecretPassword"), should we create a Key class to encapsulate this behavior?
"MySecretPassword"
Example Class Hierarchy:
PCO\Key |\__ SymmetricKey \___ AsymmetricKeyPair |\___ PrivateKey \___ PublicKey
See https://github.com/paragonie/halite_cookie/blob/master/src/Key.php for an example of how I have used it before. (Although, we need not be so strict!)
Using typed keys is much easier to reason about than just string data.
Instead of allowing arbitrary strings (and running the risk that someone might want to encrypt with the string
"MySecretPassword"
), should we create a Key class to encapsulate this behavior?Example Class Hierarchy:
See https://github.com/paragonie/halite_cookie/blob/master/src/Key.php for an example of how I have used it before. (Although, we need not be so strict!)